11import { Layout , Modal , Input , message , ConfigProvider , theme as antTheme } from "antd"
2+ import { HomeOutlined , SettingOutlined } from "@ant-design/icons"
23import { useEffect , useMemo , useRef , useState } from "react"
34import { HashRouter , useLocation , useNavigate , Routes , Route } from "react-router-dom"
45import { useTranslation } from "react-i18next"
@@ -352,6 +353,7 @@ function MainContent(): React.JSX.Element {
352353
353354 const isDark = currentTheme ?. mode === "dark"
354355 const brandColor = currentTheme ?. config ?. tdesign ?. brandColor || "#0052D9"
356+ const showMobileBottomNav = isPortraitMode && ! immersiveMode
355357
356358 return (
357359 < ConfigProvider
@@ -365,25 +367,27 @@ function MainContent(): React.JSX.Element {
365367 } }
366368 >
367369 { contextHolder }
368- < Layout style = { { height : "100%" , flexDirection : "row" , overflow : "hidden" } } >
369- < div
370- className = { `ss-immersive-sidebar ${ immersiveMode ? "is-hidden" : "is-visible" } ` }
371- style = {
372- {
373- "--ss-sidebar-width" : `${ sidebarCollapsed ? 64 : 200 } px` ,
374- } as React . CSSProperties
375- }
376- >
377- < Sidebar
378- activeMenu = { activeMenu }
379- permission = { permission }
380- onMenuChange = { onMenuChange }
381- collapsed = { sidebarCollapsed }
382- floatingExpand = { isPortraitMode }
383- floatingExpanded = { floatingSidebarExpanded }
384- onFloatingExpandedChange = { setFloatingSidebarExpanded }
385- />
386- </ div >
370+ < Layout style = { { height : "100%" , flexDirection : "row" , overflow : "hidden" , position : "relative" } } >
371+ { ! isPortraitMode && (
372+ < div
373+ className = { `ss-immersive-sidebar ${ immersiveMode ? "is-hidden" : "is-visible" } ` }
374+ style = {
375+ {
376+ "--ss-sidebar-width" : `${ sidebarCollapsed ? 64 : 200 } px` ,
377+ } as React . CSSProperties
378+ }
379+ >
380+ < Sidebar
381+ activeMenu = { activeMenu }
382+ permission = { permission }
383+ onMenuChange = { onMenuChange }
384+ collapsed = { sidebarCollapsed }
385+ floatingExpand = { isPortraitMode }
386+ floatingExpanded = { floatingSidebarExpanded }
387+ onFloatingExpandedChange = { setFloatingSidebarExpanded }
388+ />
389+ </ div >
390+ ) }
387391 < ContentArea
388392 permission = { permission }
389393 hasAnyPassword = { hasAnyPassword }
@@ -398,7 +402,70 @@ function MainContent(): React.JSX.Element {
398402 immersiveMode = { immersiveMode }
399403 isHomePage = { activeMenu === "home" }
400404 onToggleImmersiveMode = { toggleImmersiveMode }
405+ showSidebarToggle = { ! isPortraitMode }
406+ bottomInset = { showMobileBottomNav ? 84 : 0 }
401407 />
408+ { showMobileBottomNav && (
409+ < div
410+ style = { {
411+ position : "fixed" ,
412+ left : 0 ,
413+ right : 0 ,
414+ bottom : 0 ,
415+ background : "var(--ss-header-bg)" ,
416+ borderTop : "1px solid var(--ss-border-color)" ,
417+ zIndex : 1400 ,
418+ paddingBottom : "env(safe-area-inset-bottom, 0px)" ,
419+ } }
420+ >
421+ < div style = { { display : "flex" , height : "60px" } } >
422+ < button
423+ type = "button"
424+ onClick = { ( ) => onMenuChange ( "home" ) }
425+ style = { {
426+ flex : 1 ,
427+ border : "none" ,
428+ background : "transparent" ,
429+ color :
430+ activeMenu === "home"
431+ ? "var(--ant-color-primary)"
432+ : "var(--ss-text-secondary, var(--ss-text-main))" ,
433+ display : "flex" ,
434+ flexDirection : "column" ,
435+ alignItems : "center" ,
436+ justifyContent : "center" ,
437+ gap : "2px" ,
438+ fontSize : "12px" ,
439+ } }
440+ >
441+ < HomeOutlined style = { { fontSize : "18px" } } />
442+ < span > { t ( "sidebar.home" ) } </ span >
443+ </ button >
444+ < button
445+ type = "button"
446+ onClick = { ( ) => onMenuChange ( "settings" ) }
447+ style = { {
448+ flex : 1 ,
449+ border : "none" ,
450+ background : "transparent" ,
451+ color :
452+ activeMenu === "home"
453+ ? "var(--ss-text-secondary, var(--ss-text-main))"
454+ : "var(--ant-color-primary)" ,
455+ display : "flex" ,
456+ flexDirection : "column" ,
457+ alignItems : "center" ,
458+ justifyContent : "center" ,
459+ gap : "2px" ,
460+ fontSize : "12px" ,
461+ } }
462+ >
463+ < SettingOutlined style = { { fontSize : "18px" } } />
464+ < span > { t ( "sidebar.settings" ) } </ span >
465+ </ button >
466+ </ div >
467+ </ div >
468+ ) }
402469
403470 < OOBE visible = { wizardVisible } onComplete = { ( ) => setWizardVisible ( false ) } />
404471
0 commit comments