You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB
JavaScript

5 years ago
import React from 'react'
5 years ago
import useIsAdminPage from '~/hooks/useIsAdminPage'
5 years ago
5 years ago
import NavItem from './navItem'
5 years ago
5 years ago
import styles from './adminNav.module.css'
5 years ago
5 years ago
export default function AdminNav({children}){
const isAdminPage = useIsAdminPage()
5 years ago
5 years ago
if(!isAdminPage)
5 years ago
return (
<main>
{children}
</main>
)
5 years ago
return (
5 years ago
<div className={styles.navContainer}>
<div className={styles.nav}>
<NavItem icon="apps" href="/admin">Dashboard</NavItem>
<NavItem icon="local_offer" href="/admin/items">Items</NavItem>
<NavItem icon="category" href="/admin/categories">Categories</NavItem>
<NavItem icon="shopping_cart" href="/admin/orders">Orders</NavItem>
<NavItem icon="supervisor_account" href="/admin/users">Users</NavItem>
<NavItem icon="local_shipping" href="/admin/shipments">Shipments</NavItem>
<NavItem icon="payment" href="/admin/coupons">Coupons</NavItem>
</div>
5 years ago
<main className={styles.notNav}>
5 years ago
{children}
5 years ago
</main>
5 years ago
</div>
)
}