2019-11-10 13:17:13 +01:00
|
|
|
import React from 'react'
|
2018-04-02 23:22:48 +02:00
|
|
|
import PropTypes from 'prop-types'
|
2018-05-12 22:58:16 +02:00
|
|
|
import Networks from '../molecules/Networks'
|
2018-04-21 13:39:18 +02:00
|
|
|
import Availability from '../molecules/Availability'
|
2018-05-10 16:06:17 +02:00
|
|
|
import ThemeSwitch from '../molecules/ThemeSwitch'
|
2018-09-15 19:51:10 +02:00
|
|
|
import LogoUnit from '../molecules/LogoUnit'
|
2018-06-11 19:48:38 +02:00
|
|
|
import styles from './Header.module.scss'
|
2019-11-11 21:46:14 +01:00
|
|
|
import { useMeta } from '../../hooks/use-meta'
|
2018-09-06 11:34:50 +02:00
|
|
|
|
2019-11-10 13:17:13 +01:00
|
|
|
Header.propTypes = {
|
2019-08-11 21:47:22 +02:00
|
|
|
minimal: PropTypes.bool,
|
2019-11-19 23:25:49 +01:00
|
|
|
hide: PropTypes.bool
|
2019-11-10 13:17:13 +01:00
|
|
|
}
|
2018-06-24 18:20:34 +02:00
|
|
|
|
2019-11-19 23:25:49 +01:00
|
|
|
export default function Header({ minimal, hide }) {
|
2019-11-11 21:46:14 +01:00
|
|
|
const { availability } = useMeta()
|
2019-06-10 23:06:55 +02:00
|
|
|
|
2019-11-10 13:17:13 +01:00
|
|
|
return (
|
|
|
|
<header className={minimal ? styles.minimal : styles.header}>
|
|
|
|
<ThemeSwitch />
|
2019-11-19 23:25:49 +01:00
|
|
|
{!hide && (
|
2019-11-08 23:00:47 +01:00
|
|
|
<>
|
2019-11-19 23:25:49 +01:00
|
|
|
<LogoUnit minimal={minimal} />
|
2019-11-08 23:00:47 +01:00
|
|
|
<Networks hide={minimal} />
|
|
|
|
<Availability hide={minimal && !availability.status} />
|
|
|
|
</>
|
|
|
|
)}
|
2019-11-10 13:17:13 +01:00
|
|
|
</header>
|
|
|
|
)
|
2018-06-24 18:20:34 +02:00
|
|
|
}
|