mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Implement redux.
This commit is contained in:
parent
9d8a2406e1
commit
5d4ff5cfa4
31 changed files with 341 additions and 85 deletions
|
|
@ -1,14 +1,30 @@
|
|||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { useSelector } from 'react-redux';
|
||||
import classNames from 'classnames';
|
||||
import Link from 'components/Link';
|
||||
import styles from './Header.module.css';
|
||||
|
||||
export default function Header() {
|
||||
const user = useSelector(state => state.user);
|
||||
|
||||
return (
|
||||
<header className="container">
|
||||
<h1>
|
||||
<Link href="/">
|
||||
<a>umami</a>
|
||||
</Link>
|
||||
</h1>
|
||||
<header className={classNames(styles.header, 'container')}>
|
||||
<div className="row align-items-center">
|
||||
<div className="col">
|
||||
<Link href="/" className={styles.title}>
|
||||
umami
|
||||
</Link>
|
||||
</div>
|
||||
{user && (
|
||||
<div className="col">
|
||||
<div className={styles.nav}>
|
||||
<Link href="/">Dashboard</Link>
|
||||
<Link href="/settings">Settings</Link>
|
||||
<Link href="/logout">Logout</Link>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue