mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Added SideNav component.
This commit is contained in:
parent
1666e5e3af
commit
c2789d70bc
14 changed files with 115 additions and 39 deletions
|
|
@ -9,8 +9,10 @@ import ProfileButton from 'components/input/ProfileButton';
|
|||
import styles from './NavBar.module.css';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function NavBar() {
|
||||
const { pathname } = useRouter();
|
||||
const { cloudMode } = useConfig();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const [minimized, setMinimized] = useState(false);
|
||||
|
|
@ -34,8 +36,11 @@ export default function NavBar() {
|
|||
<div className={styles.links}>
|
||||
{links.map(({ url, icon, label }) => {
|
||||
return (
|
||||
<Link key={url} href={url}>
|
||||
<Icon>{icon}</Icon>
|
||||
<Link
|
||||
key={url}
|
||||
href={url}
|
||||
className={classNames({ [styles.selected]: pathname.startsWith(url) })}
|
||||
>
|
||||
<Text>{label}</Text>
|
||||
</Link>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue