From 533c04d9558bd0a575671c157ca42236f59a2c5a Mon Sep 17 00:00:00 2001
From: physcik <mynameisgennadiy@vk.com>
Date: Tue, 28 Apr 2026 23:33:59 +0500
Subject: frontend auth

---
 front/src/Emelents/Topbar.tsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'front/src/Emelents/Topbar.tsx')

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>
-- 
cgit v1.3

