@campxdev/react-blueprint 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -51,13 +51,8 @@ export const Sidebar = ({
|
|
|
51
51
|
let resolved = useResolvedPath(path);
|
|
52
52
|
let match = useMatch({ path: resolved.pathname, end: false });
|
|
53
53
|
return (
|
|
54
|
-
<StyledListItem
|
|
55
|
-
|
|
56
|
-
disablePadding
|
|
57
|
-
match={match}
|
|
58
|
-
className="listItem"
|
|
59
|
-
>
|
|
60
|
-
<StyledLinkButton to={path}>
|
|
54
|
+
<StyledListItem key={path} disablePadding className="listItem">
|
|
55
|
+
<StyledLinkButton to={path} match={match}>
|
|
61
56
|
{!collapsed && (
|
|
62
57
|
<StyledListItemButton collapsed={collapsed}>
|
|
63
58
|
<StyledListItemIcon collapsed={collapsed}>
|
|
@@ -44,36 +44,50 @@ export const createSidebarStyles = (collapsed: boolean) => {
|
|
|
44
44
|
backgroundColor: theme.palette.surface.paperBackground,
|
|
45
45
|
height: "60px",
|
|
46
46
|
}));
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
interface StyledLinkButtonProps {
|
|
48
49
|
match: any;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
+
|
|
52
|
+
const StyledListItem = styled(ListItem)(({ theme }) => ({
|
|
53
|
+
// width: collapsed ? "min-content" : "auto",
|
|
54
|
+
// backgroundColor: match ? theme.palette.secondary.main : "none",
|
|
55
|
+
display: "flex",
|
|
56
|
+
justifyContent: "center",
|
|
57
|
+
borderRadius: "4px",
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
const StyledLinkButton = styled(Link)<StyledLinkButtonProps>(
|
|
51
61
|
({ theme, match }) => ({
|
|
62
|
+
width: collapsed ? "auto" : "100%",
|
|
63
|
+
textDecoration: "none",
|
|
64
|
+
display: "flex",
|
|
65
|
+
margin: collapsed ? "5px 0px 0px 0px" : "5px 8px",
|
|
66
|
+
|
|
52
67
|
backgroundColor: match ? theme.palette.secondary.main : "none",
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
"&:hover": {
|
|
70
|
+
color: "unset",
|
|
71
|
+
},
|
|
55
72
|
borderRadius: "4px",
|
|
56
73
|
})
|
|
57
74
|
);
|
|
58
75
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"&:hover": {
|
|
63
|
-
color: "unset",
|
|
64
|
-
},
|
|
65
|
-
});
|
|
76
|
+
interface StyledListItemButtonProps {
|
|
77
|
+
collapsed: boolean;
|
|
78
|
+
}
|
|
66
79
|
|
|
67
|
-
const StyledListItemButton = styled(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
const StyledListItemButton = styled(
|
|
81
|
+
ListItemButton
|
|
82
|
+
)<StyledListItemButtonProps>(({ collapsed }) => ({
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
86
|
+
paddingBottom: "5px",
|
|
87
|
+
paddingTop: "5px",
|
|
88
|
+
width: "100%",
|
|
89
|
+
borderRadius: "5px",
|
|
90
|
+
}));
|
|
77
91
|
|
|
78
92
|
const StyledListItemIcon = styled(ListItemIcon)(
|
|
79
93
|
({ collapsed }: { collapsed: boolean }) => ({
|