forked from baron/baron-sso
사이드바 접기 기능 추가
This commit is contained in:
@@ -27,6 +27,8 @@ type ShellProfileSummaryParams = {
|
||||
|
||||
export const SHELL_THEME_STORAGE_KEY = "admin_theme";
|
||||
export const SHELL_SESSION_EXPIRY_STORAGE_KEY = SESSION_EXPIRY_STORAGE_KEY;
|
||||
export const SHELL_SIDEBAR_COLLAPSED_STORAGE_KEY =
|
||||
"baron_shell_sidebar_collapsed";
|
||||
export type { ShellSidebarNavItem } from "./AppSidebar";
|
||||
export { AppSidebar } from "./AppSidebar";
|
||||
export { shellLayoutClasses } from "./layout";
|
||||
@@ -52,6 +54,25 @@ export function writeShellSessionExpiryEnabled(isEnabled: boolean) {
|
||||
writeSessionExpiryEnabled(isEnabled);
|
||||
}
|
||||
|
||||
export function readShellSidebarCollapsed(defaultCollapsed = false) {
|
||||
const stored = window.localStorage.getItem(
|
||||
SHELL_SIDEBAR_COLLAPSED_STORAGE_KEY,
|
||||
);
|
||||
|
||||
if (stored === null) {
|
||||
return defaultCollapsed;
|
||||
}
|
||||
|
||||
return stored === "true";
|
||||
}
|
||||
|
||||
export function writeShellSidebarCollapsed(isCollapsed: boolean) {
|
||||
window.localStorage.setItem(
|
||||
SHELL_SIDEBAR_COLLAPSED_STORAGE_KEY,
|
||||
String(isCollapsed),
|
||||
);
|
||||
}
|
||||
|
||||
export function buildShellProfileSummary({
|
||||
profileName,
|
||||
profileEmail,
|
||||
|
||||
Reference in New Issue
Block a user