aboutsummaryrefslogtreecommitdiffstats
path: root/components/Layout.js
blob: 572e961673a0277dcb3b3ea2818f95417e0d5f9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import styles from 'styles/Main.module.scss'
import React from 'react'
import { Header, Popup, Splash } from 'components'
import useSettings from 'hooks/useSettings'
import PropTypes from 'prop-types'

const Layout = ({
  children
}) => {
  const { settings } = useSettings()

  if (!settings || !settings.theme || !settings.language) return <Splash fixed />

  return (
    <section className={styles.layout + ' ' + settings.theme}>
      <main>
        <div className='container'>{children}</div>
      </main>
      <Header />
      <Popup />
    </section>
  )
}

export default Layout

Layout.propTypes = {
  children: PropTypes.node
}