fix: menu index typo
This commit is contained in:
parent
d6a3e94ea7
commit
8d8da91696
1 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,9 @@
|
||||||
import SectionSeparator from "./SectionSeparator";
|
import SectionSeparator from "./SectionSeparator";
|
||||||
import menuItem from "./menuItem";
|
import menuItem from "./menuItem";
|
||||||
|
|
||||||
|
const index1 = 5;
|
||||||
|
const index2 = 9;
|
||||||
|
|
||||||
export default function DrawerItemList(props) {
|
export default function DrawerItemList(props) {
|
||||||
const { state } = props;
|
const { state } = props;
|
||||||
const { index } = state;
|
const { index } = state;
|
||||||
|
@ -17,18 +20,18 @@ export default function DrawerItemList(props) {
|
||||||
|
|
||||||
const { routes } = state;
|
const { routes } = state;
|
||||||
|
|
||||||
const section1 = routes.slice(0, 5);
|
const section1 = routes.slice(0, index1);
|
||||||
const section2 = routes.slice(5, 9);
|
const section2 = routes.slice(index1, index2);
|
||||||
const section3 = routes.slice(9, routes.length);
|
const section3 = routes.slice(index2, routes.length);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SectionSeparator label="Mon compte" />
|
<SectionSeparator label="Mon compte" />
|
||||||
{section2.map((props, i) => routeMenuItem(props, i + 5))}
|
{section2.map((props, i) => routeMenuItem(props, i + index1))}
|
||||||
<SectionSeparator label="Alerter" />
|
<SectionSeparator label="Alerter" />
|
||||||
{section1.map((props, i) => routeMenuItem(props, i + 0))}
|
{section1.map((props, i) => routeMenuItem(props, i + 0))}
|
||||||
<SectionSeparator label="Infos pratiques" />
|
<SectionSeparator label="Infos pratiques" />
|
||||||
{section3.map((props, i) => routeMenuItem(props, i + 8))}
|
{section3.map((props, i) => routeMenuItem(props, i + index2))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue