Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remeber menuToggle status, fix styles

Krzysztof Bialoglowicz5f8169a4db6c
diff --git a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
index 97a995e68b..0c98243285 100644
--- a/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/AppLayout.tsx
@@ -167,7 +167,7 @@ const styles = (theme: Theme) =>
background: theme.palette.background.paper,
boxShadow: "0px 0px 12px 1px rgba(0,0,0,0.2)",
height: "100vh",
- padding: "0 25px"
+ padding: 25
},
menuToggle: {
"& path": {
@@ -258,7 +258,10 @@ const AppLayout = withStyles(styles, {
const { isDark, toggleTheme } = useTheme();
const [isDrawerOpened, setDrawerState] = React.useState(false);
const [isMenuOpened, setMenuState] = React.useState(false);
- const [menuToggle, setMenuToggle] = React.useState(false);
+ const [menuToggle, setMenuToggle] = React.useState(
+ localStorage.getItem("menuToggle") === "true" ? true : false
+ );
+ localStorage.setItem("menuToggle", menuToggle.toString());
const appActionAnchor = React.useRef<HTMLDivElement>();
const appHeaderAnchor = React.useRef<HTMLDivElement>();
const anchor = React.useRef<HTMLDivElement>();
@@ -281,6 +284,7 @@ const AppLayout = withStyles(styles, {
};
const handleMenuToggle = () => {
+ localStorage.setItem("menuToggle", (!menuToggle).toString());
setMenuToggle(!menuToggle);
};
diff --git a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
index fc1e200c33..43b8c0af04 100644
--- a/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
+++ b/saleor/static/dashboard-next/components/AppLayout/MenuList.tsx
@@ -84,7 +84,7 @@ const styles = (theme: Theme) =>
}
},
menuListItemSmall: {
- marginTop: theme.spacing.unit * 3.5
+ marginTop: theme.spacing.unit * 2
},
menuListItemText: {
"&:hover": {
@@ -101,6 +101,7 @@ const styles = (theme: Theme) =>
},
menuListItemTextHide: {
opacity: 0,
+ position: "absolute",
transition: "opacity 0.2s ease"
},
menuListNested: {