mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 01:35:17 +01:00
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import { useSelector } from 'react-redux';
|
|
import classNames from 'classnames';
|
|
import Link from 'components/interface/Link';
|
|
import UserButton from '../interface/UserButton';
|
|
import Icon from '../interface/Icon';
|
|
import Logo from 'assets/logo.svg';
|
|
import styles from './Header.module.css';
|
|
|
|
export default function Header() {
|
|
const user = useSelector(state => state.user);
|
|
|
|
return (
|
|
<header className={classNames(styles.header, 'container')}>
|
|
<div className="row align-items-center">
|
|
<div className="col">
|
|
<div className={styles.title}>
|
|
<Icon icon={<Logo />} size="L" className={styles.logo} />
|
|
{user ? <Link href="/">umami</Link> : 'umami'}
|
|
</div>
|
|
</div>
|
|
{user && (
|
|
<div className="col">
|
|
<div className={styles.nav}>
|
|
<Link href="/dashboard">Dashboard</Link>
|
|
<Link href="/settings">Settings</Link>
|
|
<UserButton />
|
|
</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|