Merge pull request #8152 from RoadieHQ/sidebar-pin-default

Pin Sidebar by default
This commit is contained in:
Himanshu Mishra
2021-11-19 17:24:06 +05:30
committed by GitHub
3 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Pin sidebar by default for easier navigation
@@ -49,7 +49,7 @@ export type SidebarPinStateContextType = {
export const SidebarPinStateContext = createContext<SidebarPinStateContextType>(
{
isPinned: false,
isPinned: true,
toggleSidebarPinState: () => {},
},
);
@@ -24,10 +24,10 @@ export const LocalStorage = {
try {
value = JSON.parse(
window.localStorage.getItem(LocalStorageKeys.SIDEBAR_PIN_STATE) ||
'false',
'true',
);
} catch {
return false;
return true;
}
return !!value;
},