Skip to content

Commit

Permalink
refactor iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewakiv committed Oct 10, 2024
1 parent 7c44f5b commit ed497be
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions FrontEnd/src/pages/AdminPage/Menu/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ function Menu() {

return (
<div className={css['menu-section']}>
{MENU.map((element) => (
<Link className={css['menu-section-element']} key={element.id} to={element.link}>{element.title}</Link>
))}
{isSuperUser && SUPERUSER_MENU.map((element) => (
<Link className={css['menu-section-element']} key={element.id} to={element.link}>{element.title}</Link>
{[
...MENU,
...(isSuperUser ? SUPERUSER_MENU : [])
].map((element) => (
<Link className={css['menu-section-element']} key={element.id} to={element.link}>
{element.title}
</Link>
))}
<div className={css['menu-section-divider']}></div>
<button className={css['menu-section-logout']} onClick={handleLogout}>Вихід</button>
Expand Down

0 comments on commit ed497be

Please sign in to comment.