summaryrefslogtreecommitdiff
path: root/front/src/Emelents/Topbar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'front/src/Emelents/Topbar.tsx')
-rw-r--r--front/src/Emelents/Topbar.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/front/src/Emelents/Topbar.tsx b/front/src/Emelents/Topbar.tsx
index 73e0e38..284cbb9 100644
--- a/front/src/Emelents/Topbar.tsx
+++ b/front/src/Emelents/Topbar.tsx
@@ -1,4 +1,5 @@
import { useContext } from "react";
+import { AuthContext } from "../Authentication/ContextProvider";
import { LanguageContext } from "../Locales/Context";
import { GetLocalizedString } from "../Locales/Locales";
@@ -6,11 +7,20 @@ const defaultPathName = 'index';
function Topbar() {
var language = useContext(LanguageContext);
+ var user = useContext(AuthContext);
let path = getTopbarElement(window.location.pathname);
+ function getTopText() {
+ if (user == null) {
+ return <h1> View from the edge </h1>;
+ } else {
+ return <h1> <img src={"/EBM.webp"} /> { `${GetLocalizedString("Welcome", language)}, ${user.Username}` } </h1>;
+ }
+ }
+
return (
<div className="Topbar">
- <h1> View from the edge </h1>
+ { getTopText() }
<div className="TopbarContents">
<h2> {GetLocalizedString(path, language)} </h2>
</div>