Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit d280178

Browse files
authored
feat(dashboard): basic UI/UX (#1330)
* feat(sidebar): basic ui * refactor: setup basic parts
1 parent c2c06c9 commit d280178

File tree

34 files changed

+616
-8
lines changed

34 files changed

+616
-8
lines changed

src/containers/content/CommunityContent/ThreadContent.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ChangeThread from '@/containers//thread/ChangelogThread'
1010
import CperMapThread from '@/containers/thread/CperMapThread'
1111
import AboutThread from '@/containers/thread/AboutThread'
1212
import HelpThread from '@/containers/thread/HelpThread'
13+
import DashboardThread from '@/containers/thread/DashboardThread'
1314

1415
import WipThread from './WipThread'
1516

@@ -63,6 +64,10 @@ const ThreadContent: FC<TProps> = ({ thread }) => {
6364
return <HelpThread />
6465
}
6566

67+
case THREAD.DASHBOARD: {
68+
return <DashboardThread />
69+
}
70+
6671
default:
6772
return <ArticlesThread />
6873
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/admin'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const Admin: FC<TProps> = ({ testid = 'admin' }) => {
10+
return (
11+
<Wrapper>
12+
<div>Admin</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(Admin)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/basic_info'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const BasicInfo: FC<TProps> = ({ testid = 'BasicInfo' }) => {
10+
return (
11+
<Wrapper>
12+
<div>BasicInfo</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(BasicInfo)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/domain'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const Domain: FC<TProps> = ({ testid = 'domain' }) => {
10+
return (
11+
<Wrapper>
12+
<div>Domain</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(Domain)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Br } from '@/widgets/Common'
4+
5+
import { TAB } from './constant'
6+
import type { TTab } from './spec'
7+
8+
import { Wrapper, Folder, Icon, Title, Item } from './styles/sidebar'
9+
import { tabOnChange } from './logic'
10+
11+
type TProps = {
12+
curTab: TTab
13+
}
14+
15+
const Sidebar: FC<TProps> = ({ curTab }) => {
16+
return (
17+
<Wrapper>
18+
<Folder>
19+
<Icon.Basic />
20+
<Title>基础设置</Title>
21+
</Folder>
22+
<Item
23+
$active={TAB.BASIC_INFO === curTab}
24+
onClick={() => tabOnChange(TAB.BASIC_INFO)}
25+
>
26+
基本信息
27+
</Item>
28+
<Item $active={TAB.UI === curTab} onClick={() => tabOnChange(TAB.UI)}>
29+
外观样式
30+
</Item>
31+
<Item
32+
$active={TAB.THREADS === curTab}
33+
onClick={() => tabOnChange(TAB.THREADS)}
34+
>
35+
社区板块
36+
</Item>
37+
<Item
38+
$active={TAB.ADMINS === curTab}
39+
onClick={() => tabOnChange(TAB.ADMINS)}
40+
>
41+
管理员
42+
</Item>
43+
44+
<Br top={30} />
45+
<Folder>
46+
<Icon.Analysis />
47+
<Title>统计分析</Title>
48+
</Folder>
49+
<Item>--</Item>
50+
<Br top={30} />
51+
<Folder>
52+
<Icon.Management />
53+
<Title>内容管理</Title>
54+
</Folder>
55+
<Item>--</Item>
56+
<Br top={30} />
57+
<Folder>
58+
<Icon.Bind />
59+
<Title>绑定集成</Title>
60+
</Folder>
61+
<Item
62+
$active={TAB.DOMAIN === curTab}
63+
onClick={() => tabOnChange(TAB.DOMAIN)}
64+
>
65+
域名
66+
</Item>
67+
<Item
68+
$active={TAB.THIRD_PART === curTab}
69+
onClick={() => tabOnChange(TAB.THIRD_PART)}
70+
>
71+
外部应用
72+
</Item>
73+
<Item
74+
$active={TAB.WIDGETS === curTab}
75+
onClick={() => tabOnChange(TAB.WIDGETS)}
76+
>
77+
网站组件
78+
</Item>
79+
</Wrapper>
80+
)
81+
}
82+
83+
export default memo(Sidebar)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/third_part'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const ThirdPart: FC<TProps> = ({ testid = 'third-part' }) => {
10+
return (
11+
<Wrapper>
12+
<div>ThirdPart</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(ThirdPart)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/threads'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const Threads: FC<TProps> = ({ testid = 'threads' }) => {
10+
return (
11+
<Wrapper>
12+
<div>Threads</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(Threads)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/ui'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const UI: FC<TProps> = ({ testid = 'ui' }) => {
10+
return (
11+
<Wrapper>
12+
<div>UI</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(UI)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { FC, memo } from 'react'
2+
3+
import { Wrapper } from '../styles/widgets'
4+
5+
type TProps = {
6+
testid?: string
7+
}
8+
9+
const Widgets: FC<TProps> = ({ testid = 'widgets' }) => {
10+
return (
11+
<Wrapper>
12+
<div>Widgets</div>
13+
</Wrapper>
14+
)
15+
}
16+
17+
export default memo(Widgets)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { TTab } from './spec'
2+
3+
export const TAB = {
4+
OVERVIEW: 'overview',
5+
BASIC_INFO: 'basic_info',
6+
UI: 'ui',
7+
THREADS: 'threads',
8+
DOMAIN: 'domain',
9+
THIRD_PART: 'third_part',
10+
ADMINS: 'admins',
11+
WIDGETS: 'widgets',
12+
} as Record<Uppercase<TTab>, TTab>
13+
14+
export const holder = 1

0 commit comments

Comments
 (0)