Skip to content

Commit d124802

Browse files
committed
Update the examples
1 parent 8d2a0c2 commit d124802

File tree

6 files changed

+63
-63
lines changed

6 files changed

+63
-63
lines changed

src/examples/Navbars/DefaultNavbar/DefaultNavbarLink.js

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,33 @@ import MDTypography from "components/MDTypography";
2828

2929
function DefaultNavbarLink({ icon, name, route, light }) {
3030
return (
31-
<>
32-
<MDBox
33-
component={Link}
34-
to={route}
35-
mx={1}
36-
p={1}
37-
display="flex"
38-
alignItems="center"
39-
sx={{ cursor: "pointer", userSelect: "none" }}
31+
<MDBox
32+
component={Link}
33+
to={route}
34+
mx={1}
35+
p={1}
36+
display="flex"
37+
alignItems="center"
38+
sx={{ cursor: "pointer", userSelect: "none" }}
39+
>
40+
<Icon
41+
sx={{
42+
color: ({ palette: { white, secondary } }) => (light ? white.main : secondary.main),
43+
verticalAlign: "middle",
44+
}}
4045
>
41-
<Icon
42-
sx={{
43-
color: ({ palette: { white, secondary } }) => (light ? white.main : secondary.main),
44-
verticalAlign: "middle",
45-
}}
46-
>
47-
{icon}
48-
</Icon>
49-
<MDTypography
50-
variant="button"
51-
fontWeight="regular"
52-
color={light ? "white" : "dark"}
53-
textTransform="capitalize"
54-
sx={{ width: "100%", lineHeight: 0 }}
55-
>
56-
&nbsp;{name}
57-
</MDTypography>
58-
</MDBox>
59-
</>
46+
{icon}
47+
</Icon>
48+
<MDTypography
49+
variant="button"
50+
fontWeight="regular"
51+
color={light ? "white" : "dark"}
52+
textTransform="capitalize"
53+
sx={{ width: "100%", lineHeight: 0 }}
54+
>
55+
&nbsp;{name}
56+
</MDTypography>
57+
</MDBox>
6058
);
6159
}
6260

src/examples/Sidenav/SidenavCollapse.js

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,46 +41,44 @@ function SidenavCollapse({ icon, name, active, ...rest }) {
4141
const { miniSidenav, transparentSidenav, whiteSidenav, darkMode, sidenavColor } = controller;
4242

4343
return (
44-
<>
45-
<ListItem component="li">
46-
<MDBox
47-
{...rest}
44+
<ListItem component="li">
45+
<MDBox
46+
{...rest}
47+
sx={(theme) =>
48+
collapseItem(theme, {
49+
active,
50+
transparentSidenav,
51+
whiteSidenav,
52+
darkMode,
53+
sidenavColor,
54+
})
55+
}
56+
>
57+
<ListItemIcon
4858
sx={(theme) =>
49-
collapseItem(theme, {
50-
active,
59+
collapseIconBox(theme, { transparentSidenav, whiteSidenav, darkMode, active })
60+
}
61+
>
62+
{typeof icon === "string" ? (
63+
<Icon sx={(theme) => collapseIcon(theme, { active })}>{icon}</Icon>
64+
) : (
65+
icon
66+
)}
67+
</ListItemIcon>
68+
69+
<ListItemText
70+
primary={name}
71+
sx={(theme) =>
72+
collapseText(theme, {
73+
miniSidenav,
5174
transparentSidenav,
5275
whiteSidenav,
53-
darkMode,
54-
sidenavColor,
76+
active,
5577
})
5678
}
57-
>
58-
<ListItemIcon
59-
sx={(theme) =>
60-
collapseIconBox(theme, { transparentSidenav, whiteSidenav, darkMode, active })
61-
}
62-
>
63-
{typeof icon === "string" ? (
64-
<Icon sx={(theme) => collapseIcon(theme, { active })}>{icon}</Icon>
65-
) : (
66-
icon
67-
)}
68-
</ListItemIcon>
69-
70-
<ListItemText
71-
primary={name}
72-
sx={(theme) =>
73-
collapseText(theme, {
74-
miniSidenav,
75-
transparentSidenav,
76-
whiteSidenav,
77-
active,
78-
})
79-
}
80-
/>
81-
</MDBox>
82-
</ListItem>
83-
</>
79+
/>
80+
</MDBox>
81+
</ListItem>
8482
);
8583
}
8684

src/layouts/dashboard/components/Projects/data/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
/* eslint-disable react/function-component-definition */
23
/**
34
=========================================================
45
* Material Dashboard 2 React - v2.1.0

src/layouts/rtl/components/Projects/data/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
/* eslint-disable react/function-component-definition */
23
/**
34
=========================================================
45
* Material Dashboard 2 React - v2.1.0

src/layouts/tables/data/authorsTableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
/* eslint-disable react/function-component-definition */
23
/**
34
=========================================================
45
* Material Dashboard 2 React - v2.1.0

src/layouts/tables/data/projectsTableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable react/prop-types */
2+
/* eslint-disable react/function-component-definition */
23
/**
34
=========================================================
45
* Material Dashboard 2 React - v2.1.0

0 commit comments

Comments
 (0)