-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds the hover functionality for the collapsed menu. --------- Co-authored-by: Ricky James Smith <jamesricky@me.com> Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
- Loading branch information
1 parent
c702cc5
commit dc8bb6a
Showing
16 changed files
with
434 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@comet/admin": minor | ||
--- | ||
|
||
Add hover effect for collapsed menu icons. This ensures that navigation is also possible in collapsed state. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/admin": major | ||
--- | ||
|
||
Change type of props `openedIcon` and `closedIcon` of `MenuCollapsibleItem` to `React.JSXElementConstructor<SvgIconProps>` | ||
|
||
Reason being, the icons need to be called as JSX element to be able to dynamically add classes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ lang/ | |
.pnp.* | ||
junit.xml | ||
.env.local | ||
/.idea/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/admin/admin/src/mui/menu/CollapsibleItem.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Theme } from "@mui/material"; | ||
import { createStyles } from "@mui/styles"; | ||
|
||
import { MenuCollapsibleItemProps } from "./CollapsibleItem"; | ||
|
||
export type MenuCollapsibleItemClassKey = | ||
| "root" | ||
| "childSelected" | ||
| "listItem" | ||
| "open" | ||
| "itemTitle" | ||
| "collapsibleIcon" | ||
| "collapsibleIconColorGrey" | ||
| "collapsibleIconColorWhite"; | ||
|
||
export const styles = (theme: Theme) => | ||
createStyles<MenuCollapsibleItemClassKey, MenuCollapsibleItemProps>({ | ||
root: {}, | ||
childSelected: { | ||
color: theme.palette.primary.main, | ||
fontWeight: theme.typography.fontWeightMedium, | ||
"& $listItem": { | ||
"& [class*='MuiListItemText-root']": { | ||
color: theme.palette.primary.main, | ||
"& [class*='MuiListItemText-primary']": { | ||
fontWeight: ({ level }) => (level === 2 || level === 3) && 600, | ||
}, | ||
}, | ||
"& [class*='MuiListItemIcon-root']": { | ||
color: theme.palette.primary.main, | ||
}, | ||
}, | ||
"& [class*='MuiListItemIcon-root']": { | ||
color: theme.palette.primary.main, | ||
}, | ||
}, | ||
itemTitle: { | ||
fontWeight: 600, | ||
fontSize: 12, | ||
padding: "20px 15px 20px 15px", | ||
lineHeight: "16px", | ||
color: theme.palette.grey[500], | ||
}, | ||
collapsibleIcon: { | ||
fontSize: ({ isMenuOpen, level }) => (isMenuOpen || level === 2 || level === 3 ? 16 : 12), | ||
}, | ||
collapsibleIconColorWhite: { | ||
color: theme.palette.common.white, | ||
}, | ||
collapsibleIconColorGrey: { | ||
color: ({ isMenuOpen, level }) => (isMenuOpen || level === 2 || level === 3 ? theme.palette.grey[900] : theme.palette.grey[200]), | ||
}, | ||
listItem: {}, | ||
open: {}, | ||
}); |
Oops, something went wrong.