mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Persist the viewAll states for left menu items
This commit is contained in:
parent
3eb3406d41
commit
49969b6c42
1 changed files with 9 additions and 2 deletions
|
|
@ -10,6 +10,7 @@ import { Label } from '../../../lib/networking/fragments/labelFragment'
|
|||
import { theme } from '../../tokens/stitches.config'
|
||||
import { useRegisterActions } from 'kbar'
|
||||
import { LogoBox } from '../../elements/LogoBox'
|
||||
import { usePersistedState } from '../../../lib/hooks/usePersistedState'
|
||||
|
||||
export const LIBRARY_LEFT_MENU_WIDTH = '233px'
|
||||
|
||||
|
|
@ -146,7 +147,10 @@ function SavedSearches(props: LibraryFilterMenuProps): JSX.Element {
|
|||
|
||||
function Subscriptions(props: LibraryFilterMenuProps): JSX.Element {
|
||||
const { subscriptions } = useGetSubscriptionsQuery()
|
||||
const [viewAll, setViewAll] = useState(false)
|
||||
const [viewAll, setViewAll] = usePersistedState<boolean>({
|
||||
key: `--subscriptions-view-all`,
|
||||
initialValue: false,
|
||||
})
|
||||
|
||||
useRegisterActions(
|
||||
(subscriptions ?? []).map((subscription, idx) => {
|
||||
|
|
@ -194,7 +198,10 @@ function Subscriptions(props: LibraryFilterMenuProps): JSX.Element {
|
|||
|
||||
function Labels(props: LibraryFilterMenuProps): JSX.Element {
|
||||
const { labels } = useGetLabelsQuery()
|
||||
const [viewAll, setViewAll] = useState(false)
|
||||
const [viewAll, setViewAll] = usePersistedState<boolean | undefined>({
|
||||
key: `--labels-view-all`,
|
||||
initialValue: false,
|
||||
})
|
||||
|
||||
return (
|
||||
<MenuPanel
|
||||
|
|
|
|||
Loading…
Reference in a new issue