From 533c04d9558bd0a575671c157ca42236f59a2c5a Mon Sep 17 00:00:00 2001 From: physcik 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

View from the edge

; + } else { + return

{ `${GetLocalizedString("Welcome", language)}, ${user.Username}` }

; + } + } + return (
-

View from the edge

+ { getTopText() }

{GetLocalizedString(path, language)}

-- cgit v1.3