Skip to content

Commit c0b71b4

Browse files
fzaninottoAijeyomah
authored andcommitted
[demo] Fix submenu collapsed padding in bw theme
1 parent 7131aa8 commit c0b71b4

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

examples/demo/src/layout/SubMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const SubMenu = (props: Props) => {
5151
dense={dense}
5252
component="div"
5353
disablePadding
54+
className="SubMenu"
5455
sx={{
5556
'& .MuiMenuItem-root': {
5657
transition:

examples/demo/src/themes/themes.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,39 @@ export interface Theme {
3030
dark?: RaThemeOptions;
3131
}
3232

33+
const BW_SIDEBAR_OVERRIDE = {
34+
styleOverrides: {
35+
root: {
36+
'& .SubMenu .MuiMenuItem-root': {
37+
paddingLeft: 24,
38+
},
39+
'& .RaMenu-closed .SubMenu .MuiMenuItem-root': {
40+
paddingLeft: 8,
41+
},
42+
},
43+
},
44+
};
45+
3346
export const themes: Theme[] = [
3447
{ name: 'soft', light: softLightTheme, dark: softDarkTheme },
3548
{ name: 'default', light: defaultLightTheme, dark: defaultDarkTheme },
36-
{ name: 'B&W', light: bwLightTheme, dark: bwDarkTheme },
49+
{
50+
name: 'B&W',
51+
light: {
52+
...bwLightTheme,
53+
components: {
54+
...bwLightTheme.components,
55+
RaSidebar: BW_SIDEBAR_OVERRIDE,
56+
},
57+
},
58+
dark: {
59+
...bwDarkTheme,
60+
components: {
61+
...bwDarkTheme.components,
62+
RaSidebar: BW_SIDEBAR_OVERRIDE,
63+
},
64+
},
65+
},
3766
{ name: 'nano', light: nanoLightTheme, dark: nanoDarkTheme },
3867
{ name: 'radiant', light: radiantLightTheme, dark: radiantDarkTheme },
3968
{ name: 'house', light: houseLightTheme, dark: houseDarkTheme },

0 commit comments

Comments
 (0)