diff options
author | 2020-11-16 00:10:28 +0100 | |
---|---|---|
committer | 2020-11-16 00:10:28 +0100 | |
commit | e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch) | |
tree | 55713f725f77b44ebfec86e4eec3ce33e71458ca /client/src/admin/jsx/App.jsx | |
download | website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2 website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip |
api, login, auth
Diffstat (limited to 'client/src/admin/jsx/App.jsx')
-rw-r--r-- | client/src/admin/jsx/App.jsx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/client/src/admin/jsx/App.jsx b/client/src/admin/jsx/App.jsx new file mode 100644 index 0000000..c5be77c --- /dev/null +++ b/client/src/admin/jsx/App.jsx @@ -0,0 +1,36 @@ +import React, { useState, useEffect } from 'react'; +import ReactDOM from 'react-dom'; + +import "../scss/index.scss"; + +import texts from '../../common/data/texts.js'; +import TopBar from '../../common/jsx/TopBar.jsx'; +import Info from '../../common/jsx/Info.jsx'; +import MainScreen from './MainScreen.jsx'; + +const App = () => { + const [adminLang, setAdminLang] = useState('en'); + const [projects, setProjects] = useState([]); + const [info, setInfo] = useState(''); + const [hover, setHover] = useState(''); + const [view, setView] = useState('main'); + const [user, setUser] = useState(null); + const t = (key) => texts[adminLang][key] || texts['en'][key]; + + // useEffect(() => { + // setInfo('no-saved-websites') + // setHover(''); + // }, [user]); + + return ( + <div className="main"> + <TopBar lang={adminLang} setLang={setAdminLang} setHover={setHover} user={user} setUser={setUser} t={t} /> + <div className="main__content"> + { view === 'main' && <MainScreen projects={projects} t={t} setHover={setHover} /> } + </div> + <Info info={info} hover={hover} t={t} /> + </div> + ) +}; + +ReactDOM.render(<App />, document.getElementById('app')); |