Complete main UI #37

Merged
FatttSnake merged 192 commits from FatttSnake into dev 2024-02-23 16:31:17 +08:00
Showing only changes of commit 0bcadab98c - Show all commits

View File

@@ -13,11 +13,11 @@ interface SidebarProps extends React.PropsWithChildren {
} }
const Sidebar: React.FC<SidebarProps> = (props) => { const Sidebar: React.FC<SidebarProps> = (props) => {
const [hideSidebar, setHideSidebar] = useState(getLocalStorage('hideSidebar') === 'false') const [hideSidebar, setHideSidebar] = useState(getLocalStorage('HIDE_SIDEBAR') === 'true')
const switchSidebar = () => { const switchSidebar = () => {
setLocalStorage('HIDE_SIDEBAR', !hideSidebar ? 'true' : 'false')
setHideSidebar(!hideSidebar) setHideSidebar(!hideSidebar)
setLocalStorage('hideSidebar', hideSidebar ? 'true' : 'false')
props.onSidebarSwitch && props.onSidebarSwitch(hideSidebar) props.onSidebarSwitch && props.onSidebarSwitch(hideSidebar)
} }