Add local storage effect to save sidebar state (#13591)
Add local storage effect to keep the behavior across sessions
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { atom } from 'recoil';
|
||||
import { MOBILE_VIEWPORT } from 'twenty-ui/theme';
|
||||
import { localStorageEffect } from '~/utils/recoil-effects';
|
||||
|
||||
const isMobile = window.innerWidth <= MOBILE_VIEWPORT;
|
||||
|
||||
export const isNavigationDrawerExpandedState = atom({
|
||||
key: 'isNavigationDrawerExpanded',
|
||||
default: !isMobile,
|
||||
effects: [localStorageEffect()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user