-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_theme.tsx
57 lines (50 loc) · 1.26 KB
/
_theme.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from 'react'
import { createTheme, defaultSideNavs } from 'vite-pages-theme-doc'
import Component404 from './404'
import type { Theme } from 'vite-plugin-react-pages'
import './global.css'
const theme: Theme = (props) => {
const { loadedData, loadState } = props
const DocTheme = createTheme({
logo: <div style={{ fontSize: '20px' }}>pkg-name</div>,
topNavs: [
{
label: 'Components',
path: '/components',
activeIfMatch: '/components',
},
{
label: 'Hooks',
path: '/hooks',
activeIfMatch: '/hooks',
},
{
label: 'pkg-name',
href: 'https://github.com/yunsii/starter-vite-react-library',
},
],
sideNavs: (ctx) => {
return defaultSideNavs(ctx, {
groupConfig: {
components: {
'demos': {
label: 'Demos (dev only)',
order: -1,
},
'general': {
label: 'General',
order: 1,
},
'data-display': {
label: 'Data Display',
order: 2,
},
},
},
})
},
Component404,
})
return <DocTheme loadedData={loadedData} loadState={loadState} />
}
export default theme