aboutsummaryrefslogtreecommitdiffstats
path: root/components/Layout.js
diff options
context:
space:
mode:
Diffstat (limited to 'components/Layout.js')
-rw-r--r--components/Layout.js34
1 files changed, 20 insertions, 14 deletions
diff --git a/components/Layout.js b/components/Layout.js
index e915285..d5627e3 100644
--- a/components/Layout.js
+++ b/components/Layout.js
@@ -1,26 +1,32 @@
import styles from 'styles/Main.module.scss'
import React from 'react'
import Head from 'next/head'
-import {Header, Popup} from 'components'
+import {Header, Popup, Splash} from 'components'
+import useSettings from 'hooks/useSettings'
import PropTypes from 'prop-types'
const Layout = ({
children,
apps,
setApps,
- settings,
-}) => (
- <section className={styles.layout +' '+ (settings ? settings.theme : 'green')}>
- <Head>
- <title>My Apps</title>
- </Head>
- <main>
- <div className="container">{children}</div>
- </main>
- <Header apps={apps} setApps={setApps} />
- <Popup/>
- </section>
-)
+}) => {
+ const {settings} = useSettings()
+
+ if (!settings || !settings.theme || !settings.language) return <Splash fixed />
+
+ return (
+ <section className={styles.layout +' '+ settings.theme}>
+ <Head>
+ <title>My Apps</title>
+ </Head>
+ <main>
+ <div className="container">{children}</div>
+ </main>
+ <Header apps={apps} setApps={setApps} />
+ <Popup/>
+ </section>
+ )
+}
export default Layout