aboutsummaryrefslogtreecommitdiffstats
path: root/components/Layout.js
blob: ac9534f0e9fb9c8c5fa89e028c690f7d7703b02a (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
30
31
32
33
34
35
36
37
import styles from 'styles/Main.module.scss'
import React from 'react'
import Head from 'next/head'
import {Header, Popup, Splash} from 'components'
import useSettings from 'hooks/useSettings'
import PropTypes from 'prop-types'

const Layout = ({
  children,
  apps,
  setApps,
}) => {
  const {settings} = useSettings()

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

  return (
    <section className={styles.layout +' '+ settings.theme}>
      <Head>
        <title>My Apps</title>
        <meta name="viewport" 
      content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
      </Head>
      <main>
        <div className="container">{children}</div>
      </main>
      <Header apps={apps} setApps={setApps} />
      <Popup/>
    </section>
  )
}

export default Layout

Layout.propTypes = {
  children: PropTypes.node,
}