diff options
author | 2020-11-18 23:15:38 +0100 | |
---|---|---|
committer | 2020-11-18 23:15:38 +0100 | |
commit | 1870f3fdf43707a15fda0f609a021f516f45eb63 (patch) | |
tree | fbaf527a47cd89a171df18da4b41e8ce34668555 /client/src/admin/jsx/TopBar.jsx | |
parent | e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (diff) | |
download | website_creator-1870f3fdf43707a15fda0f609a021f516f45eb63.tar.gz website_creator-1870f3fdf43707a15fda0f609a021f516f45eb63.tar.bz2 website_creator-1870f3fdf43707a15fda0f609a021f516f45eb63.zip |
finish auth routes, create cookie token, fix folder structure, add context to FE
Diffstat (limited to 'client/src/admin/jsx/TopBar.jsx')
-rw-r--r-- | client/src/admin/jsx/TopBar.jsx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/src/admin/jsx/TopBar.jsx b/client/src/admin/jsx/TopBar.jsx new file mode 100644 index 0000000..e9be676 --- /dev/null +++ b/client/src/admin/jsx/TopBar.jsx @@ -0,0 +1,35 @@ +import React, {useState} from 'react'; +import LangSwitch from './LangSwitch.jsx'; +import User from './User.jsx'; + +const TopBar = ({ user, setUser, lang, setLang }) => { + const [opened, setOpened] = useState(false); + + return ( + <div className="top-bar"> + { opened !== false && ( + <div + className="top-bar__fog" + onClick={() => setOpened(false)} + /> + )} + <LangSwitch + lang={lang} + setLang={setLang} + opened={opened} + setOpened={setOpened} + /> + { user && ( + <User + user={user} + setUser={setUser} + opened={opened} + setOpened={setOpened} + /> + ) + } + </div> + ); +}; + +export default TopBar; |