feat: improve single-column layout
This commit is contained in:
parent
1674671d7f
commit
936b15e5c2
13 changed files with 316 additions and 231 deletions
|
|
@ -1,13 +1,21 @@
|
|||
import { toSettings } from '@/lib/link'
|
||||
import { useSecondaryPage } from '@/PageManager'
|
||||
import { usePrimaryPage, useSecondaryPage } from '@/PageManager'
|
||||
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
|
||||
import { Settings } from 'lucide-react'
|
||||
import SidebarItem from './SidebarItem'
|
||||
|
||||
export default function SettingsButton({ collapse }: { collapse: boolean }) {
|
||||
const { current, navigate } = usePrimaryPage()
|
||||
const { push } = useSecondaryPage()
|
||||
const { enableSingleColumnLayout } = useUserPreferences()
|
||||
|
||||
return (
|
||||
<SidebarItem title="Settings" onClick={() => push(toSettings())} collapse={collapse}>
|
||||
<SidebarItem
|
||||
title="Settings"
|
||||
onClick={() => (enableSingleColumnLayout ? navigate('settings') : push(toSettings()))}
|
||||
collapse={collapse}
|
||||
active={enableSingleColumnLayout ? current === 'settings' : false}
|
||||
>
|
||||
<Settings />
|
||||
</SidebarItem>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue