@@ -14,7 +14,7 @@ import { menuFilter } from '@/router/utils';
14
14
import { useSettingActions , useSettings } from '@/store/settingStore' ;
15
15
import { useThemeToken } from '@/theme/hooks' ;
16
16
17
- import { NAV_COLLAPSED_WIDTH , NAV_WIDTH } from './config' ;
17
+ import { NAV_COLLAPSED_WIDTH , NAV_WIDTH } from '.. /config' ;
18
18
19
19
import { ThemeLayout } from '#/enum' ;
20
20
@@ -23,7 +23,7 @@ const slideInLeft = varSlide({ distance: 10 }).inLeft;
23
23
type Props = {
24
24
closeSideBarDrawer ?: ( ) => void ;
25
25
} ;
26
- export default function Nav ( props : Props ) {
26
+ export default function NavVertical ( props : Props ) {
27
27
const navigate = useNavigate ( ) ;
28
28
const matches = useMatches ( ) ;
29
29
const { pathname } = useLocation ( ) ;
@@ -113,53 +113,55 @@ export default function Nav(props: Props) {
113
113
} ;
114
114
115
115
return (
116
- < div
117
- className = "flex h-full flex-col"
118
- style = { {
119
- width : collapsed ? NAV_COLLAPSED_WIDTH : NAV_WIDTH ,
120
- borderRight : `1px dashed ${ Color ( colorBorder ) . alpha ( 0.6 ) . toString ( ) } ` ,
121
- } }
122
- >
123
- < div className = "relative flex h-20 items-center justify-center py-4" >
124
- < MotionContainer className = "flex items-center" >
125
- < Logo />
126
- { themeLayout !== ThemeLayout . Mini && (
127
- < m . div variants = { slideInLeft } >
128
- < span className = "ml-2 text-xl font-bold" style = { { color : colorPrimary } } >
129
- Slash Admin
130
- </ span >
131
- </ m . div >
132
- ) }
133
- </ MotionContainer >
134
- < button
135
- onClick = { toggleCollapsed }
136
- className = "absolute right-0 top-7 z-50 hidden h-6 w-6 translate-x-1/2 cursor-pointer select-none rounded-full text-center !text-gray md:block"
137
- style = { { color : colorTextBase , borderColor : colorTextBase , fontSize : 16 } }
138
- >
139
- { collapsed ? < MenuUnfoldOutlined size = { 20 } /> : < MenuFoldOutlined size = { 20 } /> }
140
- </ button >
141
- </ div >
142
-
143
- < Scrollbar
116
+ < div className = '"z-50 hidden h-full flex-shrink-0 md:block' >
117
+ < div
118
+ className = "flex h-full flex-col"
144
119
style = { {
145
- height : 'calc(100vh - 70px)' ,
120
+ width : collapsed ? NAV_COLLAPSED_WIDTH : NAV_WIDTH ,
121
+ borderRight : `1px dashed ${ Color ( colorBorder ) . alpha ( 0.6 ) . toString ( ) } ` ,
146
122
} }
147
123
>
148
- { /* <!-- Sidebar Menu --> */ }
149
- < Menu
150
- mode = { menuMode }
151
- items = { menuList }
152
- className = "h-full !border-none"
153
- defaultOpenKeys = { openKeys }
154
- defaultSelectedKeys = { [ pathname ] }
155
- selectedKeys = { [ pathname ] }
156
- openKeys = { openKeys }
157
- onOpenChange = { onOpenChange }
158
- onClick = { onClick }
159
- style = { menuStyle }
160
- inlineCollapsed = { collapsed }
161
- />
162
- </ Scrollbar >
124
+ < div className = "relative flex h-20 items-center justify-center py-4" >
125
+ < MotionContainer className = "flex items-center" >
126
+ < Logo />
127
+ { themeLayout !== ThemeLayout . Mini && (
128
+ < m . div variants = { slideInLeft } >
129
+ < span className = "ml-2 text-xl font-bold" style = { { color : colorPrimary } } >
130
+ Slash Admin
131
+ </ span >
132
+ </ m . div >
133
+ ) }
134
+ </ MotionContainer >
135
+ < button
136
+ onClick = { toggleCollapsed }
137
+ className = "absolute right-0 top-7 z-50 hidden h-6 w-6 translate-x-1/2 cursor-pointer select-none rounded-full text-center !text-gray md:block"
138
+ style = { { color : colorTextBase , borderColor : colorTextBase , fontSize : 16 } }
139
+ >
140
+ { collapsed ? < MenuUnfoldOutlined size = { 20 } /> : < MenuFoldOutlined size = { 20 } /> }
141
+ </ button >
142
+ </ div >
143
+
144
+ < Scrollbar
145
+ style = { {
146
+ height : 'calc(100vh - 70px)' ,
147
+ } }
148
+ >
149
+ { /* <!-- Sidebar Menu --> */ }
150
+ < Menu
151
+ mode = { menuMode }
152
+ items = { menuList }
153
+ className = "h-full !border-none"
154
+ defaultOpenKeys = { openKeys }
155
+ defaultSelectedKeys = { [ pathname ] }
156
+ selectedKeys = { [ pathname ] }
157
+ openKeys = { openKeys }
158
+ onOpenChange = { onOpenChange }
159
+ onClick = { onClick }
160
+ style = { menuStyle }
161
+ inlineCollapsed = { collapsed }
162
+ />
163
+ </ Scrollbar >
164
+ </ div >
163
165
</ div >
164
166
) ;
165
167
}
0 commit comments