Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 42dede2

Browse files
committed
migration to v6 & refactor
1 parent 74e8243 commit 42dede2

File tree

14 files changed

+37
-45
lines changed

14 files changed

+37
-45
lines changed

src/components/Epic/index.tsx renamed to src/AppWrapper/App/Epic.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useActiveVkuiLocation } from '@vkontakte/vk-mini-apps-router'
22
import { useAdaptivityConditionalRender } from '@vkontakte/vkui'
33
import { Epic as VKUIEpic } from '@vkontakte/vkui/dist/components/Epic/Epic'
44
import { FC } from 'react'
5+
import Suspense from '../../components/Suspense.tsx'
6+
import Tabbar from '../../components/Tabbar'
57
import {
68
VIEW_CONTACTS,
79
VIEW_PROFILE,
@@ -11,8 +13,6 @@ import {
1113
} from '../../routes'
1214
import { Pages } from '../../types'
1315
import { Contacts, Profile, Projects, Settings, Stack } from '../../views'
14-
import Suspense from '../Suspense'
15-
import Tabbar from '../Tabbar'
1616

1717
interface IEpic {
1818
onStoryChange: (current: Pages) => void

src/App.tsx renamed to src/AppWrapper/App/index.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ import {
1212
useAdaptivityConditionalRender,
1313
usePlatform
1414
} from '@vkontakte/vkui'
15-
import { lazy, useCallback, useEffect, useState } from 'react'
16-
17-
import { VIEW_PROFILE } from './routes'
18-
import { Pages } from './types'
19-
20-
import Suspense from './components/Suspense'
21-
22-
const Sidebar = lazy(() => import('./components/Sidebar'))
23-
const Epic = lazy(() => import('./components/Epic'))
15+
import { Suspense, lazy, useCallback, useEffect, useState } from 'react'
16+
import Sidebar from '../../components/Sidebar'
17+
import { VIEW_PROFILE } from '../../routes'
18+
import { Pages } from '../../types'
19+
import Epic from './Epic.tsx'
2420

2521
const App = () => {
2622
const platform = usePlatform()
@@ -71,7 +67,7 @@ const App = () => {
7167
<ConfigProvider appearance={appearance}>
7268
<AppRoot>
7369
<SplitLayout
74-
header={isVKCOM && <PanelHeader separator={false} />}
70+
header={isVKCOM && <PanelHeader delimiter='none' />}
7571
style={{ justifyContent: 'center' }}
7672
>
7773
{sidebar}
File renamed without changes.

src/AppWrapper.tsx renamed to src/AppWrapper/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { RouterProvider } from '@vkontakte/vk-mini-apps-router'
22
import { AdaptivityProvider } from '@vkontakte/vkui'
33
import { lazy } from 'react'
4-
5-
import Suspense from './components/Suspense'
6-
7-
import { router } from './routes'
4+
import Suspense from '../components/Suspense.tsx'
5+
import { router } from '../routes'
86

97
const App = lazy(() => import('./App'))
10-
const NotFound = lazy(() => import('./components/NotFound'))
8+
const NotFound = lazy(() => import('./NotFound'))
119

1210
const AppWrapper = () => (
1311
<AdaptivityProvider>

src/components/ExplanationTooltip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const ExplanationTooltip: FC<TooltipTextProps> = ({ text, tooltipContent }) => {
1111
const textTooltip = (
1212
<Subhead
1313
style={{ padding: '8px 12px', color: 'var(--vkui--color_text_primary)' }}
14+
Component='h5'
1415
>
1516
{tooltipContent}
1617
</Subhead>

src/components/ProfileInfo/UserInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ const UserInfo = () => (
2121
<>
2222
<Gradient style={{ ...styles, ...gradientBorder }}>
2323
<Avatar size={90} src={ava} alt='ava' />
24-
<Title style={{ marginTop: 20 }} level='2' weight='2'>
24+
<Title style={{ marginTop: 20 }} level='2' weight='2' Component='h2'>
2525
Семён Окулов
2626
</Title>
2727
<Link href={VK_URL} target='_blank'>
2828
@scffs
2929
</Link>
30-
<Title level='3' weight='3'>
30+
<Title level='3' weight='3' Component='h3'>
3131
Fullstack-разработчик
3232
</Title>
3333
</Gradient>

src/routes/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import {
33
createHashRouter
44
} from '@vkontakte/vk-mini-apps-router'
55

6-
export const PAGE_MAIN = '/'
7-
export const PAGE_PROFILE = '/profile'
8-
export const PAGE_CONTACTS = '/contacts'
9-
export const PAGE_PROJECTS = '/projects'
10-
export const PAGE_STACK = '/stack'
11-
export const PAGE_SETTINGS = '/settings'
12-
136
export const VIEW_PROFILE = 'profile'
147
export const VIEW_CONTACTS = 'contacts'
158
export const VIEW_PROJECTS = 'projects'
169
export const VIEW_STACK = 'stack'
1710
export const VIEW_SETTINGS = 'settings'
1811

12+
export const PAGE_MAIN = '/'
13+
export const PAGE_PROFILE = `/${VIEW_PROFILE}`
14+
export const PAGE_CONTACTS = `/${VIEW_CONTACTS}`
15+
export const PAGE_PROJECTS = `/${VIEW_PROJECTS}`
16+
export const PAGE_STACK = `/${VIEW_STACK}`
17+
export const PAGE_SETTINGS = `/${VIEW_SETTINGS}`
18+
1919
const routes: RouteWithoutRoot[] = [
2020
{
2121
path: PAGE_MAIN,

src/views/Projects.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const Projects: FC<{ id: string }> = ({ id }) => {
4545
subtitle='React, TypeScript etc...'
4646
header='Gatto'
4747
caption="Gatto - это большая, яркая и увлекательная игра. По типу напоминает 'тамагочи' - есть прокачка персонажей, различные локации и элементы скрещивания."
48+
headerComponent='h4'
4849
/>
4950
<ContentCard
5051
onClick={() => window.open('https://vk.com/diary_spo', '_blank')}
@@ -53,6 +54,7 @@ const Projects: FC<{ id: string }> = ({ id }) => {
5354
subtitle='Preact, TypeScript, VKUI etc...'
5455
header='Дневник СПО'
5556
caption='Обёртка над дневником Сетевого города для СПО (API совпадает с Томской областью). В сервисе студенты могут полностью следить за своей успеваемостью и расписанием.'
57+
headerComponent='h4'
5658
/>
5759
<ContentCard
5860
onClick={() =>
@@ -66,6 +68,7 @@ const Projects: FC<{ id: string }> = ({ id }) => {
6668
subtitle='Preact, TypeScript, VKUI, Docker, ElysiaJS etc...'
6769
header='Дневник Admin'
6870
caption='Попытка сделать собственный дневник, а именно часть администратора: создание групп, расписаний, выставление оценок и тд.'
71+
headerComponent='h4'
6972
/>
7073
<ContentCard
7174
onClick={() =>
@@ -76,6 +79,7 @@ const Projects: FC<{ id: string }> = ({ id }) => {
7679
subtitle='C#'
7780
header='Fake DB'
7881
caption='Консольное приложение для управления пользователями с использованием фейковой базы данных.'
82+
headerComponent='h4'
7983
/>
8084
<ContentCard
8185
onClick={() =>
@@ -86,6 +90,7 @@ const Projects: FC<{ id: string }> = ({ id }) => {
8690
subtitle='C#, WPF'
8791
header='WPF Quiz'
8892
caption='Игроку предлагается лист, на котором написан текст. В тексте некоторые слова заменены пиктограммами. Пиктограммы в тексте заменены в случайном порядке.'
93+
headerComponent='h4'
8994
/>
9095
</CardGrid>
9196
</Group>

src/views/Settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Settings: FC<ISettings> = ({ id, toggleAppearance }) => {
106106
header={
107107
<Header
108108
mode='secondary'
109-
aside={<Subhead>Хранится в LocalStorage</Subhead>}
109+
aside={<Subhead Component='h5'>Хранится в LocalStorage</Subhead>}
110110
>
111111
Кеш
112112
</Header>

src/components/CustomList.tsx renamed to src/views/Stack/StackInfo/CustomList.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ import {
55
Image,
66
List
77
} from '@vkontakte/vkui'
8-
import React, { Dispatch, SetStateAction, memo } from 'react'
9-
10-
import { Technology } from './StackInfo/data'
11-
12-
export type UpdateDraggingList = Dispatch<SetStateAction<Technology[]>>
13-
8+
import React, { memo } from 'react'
9+
import { Technology } from './data.ts'
1410
interface CustomListProps {
1511
items: Technology[]
1612
isHorizontal: boolean

src/components/StackInfo/ExplanationGroup.tsx renamed to src/views/Stack/StackInfo/ExplanationGroup.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Div, Group, Header } from '@vkontakte/vkui'
2-
3-
import ExplanationTooltip from '../ExplanationTooltip'
2+
import ExplanationTooltip from '../../../components/ExplanationTooltip.tsx'
43

54
const ExplanationGroup = () => (
65
<Group header={<Header>Пояснение</Header>}>

src/components/StackInfo/TechnologyGroup.tsx renamed to src/views/Stack/StackInfo/TechnologyGroup.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Button, Group, Header } from '@vkontakte/vkui'
22
import { FC, lazy, memo, useEffect, useState } from 'react'
33

4-
import Suspense from '../Suspense'
5-
4+
import Suspense from '../../../components/Suspense.tsx'
65
import { Technology } from './data'
76

8-
const CustomList = lazy(() => import('../CustomList'))
7+
const CustomList = lazy(() => import('./CustomList'))
98

109
interface TechnologyGroupProps {
1110
id: string

src/components/StackInfo/data.ts renamed to src/views/Stack/StackInfo/data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
vk,
2525
vue,
2626
zustand
27-
} from '../../assets/technologies.ts'
27+
} from '../../../assets/technologies.ts'
2828

2929
export interface Technology {
3030
name: string

src/views/Stack.tsx renamed to src/views/Stack/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import {
44
} from '@vkontakte/vk-mini-apps-router'
55
import { Panel, View } from '@vkontakte/vkui'
66
import { FC } from 'react'
7-
8-
import PanelHeaderWithBack from '../components/PanelHeaderWithBack'
9-
import ExplanationGroup from '../components/StackInfo/ExplanationGroup'
10-
11-
import TechnologyGroup from '../components/StackInfo/TechnologyGroup'
7+
import PanelHeaderWithBack from '../../components/PanelHeaderWithBack'
8+
import ExplanationGroup from './StackInfo/ExplanationGroup.tsx'
9+
import TechnologyGroup from './StackInfo/TechnologyGroup.tsx'
1210
import {
1311
technologiesBackend,
1412
technologiesFront,
1513
technologiesOther
16-
} from '../components/StackInfo/data'
14+
} from './StackInfo/data.ts'
1715

1816
const Stack: FC<{ id: string }> = ({ id }) => {
1917
const { panel: activePanel, panelsHistory } = useActiveVkuiLocation()

0 commit comments

Comments
 (0)