From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001
From: Piotr Russ <mail@pruss.it>
Date: Mon, 16 Nov 2020 00:10:28 +0100
Subject: api, login, auth

---
 client/src/common/jsx/TopBar.jsx | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 client/src/common/jsx/TopBar.jsx

(limited to 'client/src/common/jsx/TopBar.jsx')

diff --git a/client/src/common/jsx/TopBar.jsx b/client/src/common/jsx/TopBar.jsx
new file mode 100644
index 0000000..6e5ad6a
--- /dev/null
+++ b/client/src/common/jsx/TopBar.jsx
@@ -0,0 +1,38 @@
+import React, {useState} from 'react';
+import LangSwitch from './LangSwitch.jsx';
+import User from './User.jsx';
+
+const TopBar = ({user, setUser, setHover, lang, setLang, t={t}}) => {
+  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}
+        setHover={setHover}
+        opened={opened}
+        setOpened={setOpened}
+      />
+        { user && (
+          <User
+            user={user}
+            setUser={setUser}
+            setHover={setHover}
+            t={t}
+            opened={opened}
+            setOpened={setOpened}
+          />
+        )
+      }
+    </div>
+  );
+};
+
+export default TopBar;
-- 
cgit v1.2.3

