|
@@ -1,4 +1,5 @@
|
|
|
-import { theme, utils } from "../..";
|
|
|
+import theme from "../../theme";
|
|
|
+import { makeStyles, StyleFn } from "../../utils";
|
|
|
|
|
|
export const SIDENAV_WIDTH = 56;
|
|
|
export const EXPANDED_SIDENAV_WIDTH = 360;
|
|
@@ -7,7 +8,7 @@ type SidenavStyleProps = {
|
|
|
expanded: boolean;
|
|
|
};
|
|
|
|
|
|
-const nav: utils.StyleFn = () => ({
|
|
|
+const nav: StyleFn = () => ({
|
|
|
position: "fixed",
|
|
|
top: 0,
|
|
|
left: 0,
|
|
@@ -26,12 +27,12 @@ const nav: utils.StyleFn = () => ({
|
|
|
color: theme.colors.white,
|
|
|
});
|
|
|
|
|
|
-const expandButton: utils.StyleFn = () => ({
|
|
|
+const expandButton: StyleFn = () => ({
|
|
|
padding: "7px",
|
|
|
margin: "-4px",
|
|
|
});
|
|
|
|
|
|
-const drawerOverlay: utils.StyleFn<SidenavStyleProps> = (_, { expanded }) => ({
|
|
|
+const drawerOverlay: StyleFn<SidenavStyleProps> = (_, { expanded }) => ({
|
|
|
position: "fixed",
|
|
|
top: 0,
|
|
|
right: 0,
|
|
@@ -44,11 +45,11 @@ const drawerOverlay: utils.StyleFn<SidenavStyleProps> = (_, { expanded }) => ({
|
|
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
|
});
|
|
|
|
|
|
-const navItemsWrapper: utils.StyleFn = () => ({
|
|
|
+const navItemsWrapper: StyleFn = () => ({
|
|
|
marginTop: "90px",
|
|
|
});
|
|
|
|
|
|
-const navItemContainer: utils.StyleFn = () => ({
|
|
|
+const navItemContainer: StyleFn = () => ({
|
|
|
":not(:first-child)": {
|
|
|
marginTop: theme.spacing.xxxl,
|
|
|
},
|
|
@@ -56,7 +57,7 @@ const navItemContainer: utils.StyleFn = () => ({
|
|
|
flexDirection: "column",
|
|
|
});
|
|
|
|
|
|
-const navItem: utils.StyleFn = () => ({
|
|
|
+const navItem: StyleFn = () => ({
|
|
|
display: "flex",
|
|
|
alignItems: "center",
|
|
|
"> span": {
|
|
@@ -68,7 +69,7 @@ const navItem: utils.StyleFn = () => ({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-const navSubitemsWrapper: utils.StyleFn = () => ({
|
|
|
+const navSubitemsWrapper: StyleFn = () => ({
|
|
|
paddingLeft: `calc(${theme.typography.sizes.icon.xlarge} + ${theme.spacing.xxl})`,
|
|
|
overflow: "hidden",
|
|
|
"> div": {
|
|
@@ -77,7 +78,7 @@ const navSubitemsWrapper: utils.StyleFn = () => ({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-const navSubitem: utils.StyleFn = () => ({
|
|
|
+const navSubitem: StyleFn = () => ({
|
|
|
fontSize: theme.typography.sizes.body2,
|
|
|
fontFamily: theme.typography.fonts.base,
|
|
|
marginTop: theme.spacing.xxl,
|
|
@@ -87,15 +88,15 @@ const navSubitem: utils.StyleFn = () => ({
|
|
|
});
|
|
|
|
|
|
export const useSidenavCSS = (props: SidenavStyleProps) => ({
|
|
|
- nav: utils.makeStyles([nav])(props),
|
|
|
- expandButton: utils.makeStyles([expandButton])(props),
|
|
|
- drawerOverlay: utils.makeStyles([drawerOverlay])(props),
|
|
|
- navItemsWrapper: utils.makeStyles([navItemsWrapper])(props),
|
|
|
+ nav: makeStyles([nav])(props),
|
|
|
+ expandButton: makeStyles([expandButton])(props),
|
|
|
+ drawerOverlay: makeStyles([drawerOverlay])(props),
|
|
|
+ navItemsWrapper: makeStyles([navItemsWrapper])(props),
|
|
|
});
|
|
|
|
|
|
export const useNavItemCSS = (props: SidenavStyleProps) => ({
|
|
|
- navItemContainer: utils.makeStyles([navItemContainer])(props),
|
|
|
- navItem: utils.makeStyles([navItem])(props),
|
|
|
- navSubitemsWrapper: utils.makeStyles([navSubitemsWrapper])(props),
|
|
|
- navSubitem: utils.makeStyles([navSubitem])(props),
|
|
|
+ navItemContainer: makeStyles([navItemContainer])(props),
|
|
|
+ navItem: makeStyles([navItem])(props),
|
|
|
+ navSubitemsWrapper: makeStyles([navSubitemsWrapper])(props),
|
|
|
+ navSubitem: makeStyles([navSubitem])(props),
|
|
|
});
|