Add local storage effect to save sidebar state (#13591)

Add local storage effect to keep the behavior across sessions
This commit is contained in:
Félix Malfait
2025-08-04 14:44:11 +02:00
committed by GitHub
parent 86f813c26d
commit 2c87c6fc1b
@@ -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()],
});