summaryrefslogtreecommitdiff
path: root/front/src/Emelents
diff options
context:
space:
mode:
Diffstat (limited to 'front/src/Emelents')
-rw-r--r--front/src/Emelents/Elements.css7
-rw-r--r--front/src/Emelents/Sidebar.tsx1
-rw-r--r--front/src/Emelents/Topbar.tsx12
3 files changed, 19 insertions, 1 deletions
diff --git a/front/src/Emelents/Elements.css b/front/src/Emelents/Elements.css
index 6f23c13..7c8c15f 100644
--- a/front/src/Emelents/Elements.css
+++ b/front/src/Emelents/Elements.css
@@ -21,9 +21,16 @@
}
.Topbar > h1 {
+ margin-top: 0px;
+ flex-direction: row;
margin-bottom: 0px;
}
+.Topbar > h1 > img {
+ height: 1em;
+ width: auto;
+}
+
.TopbarContents {
border-top: 2px solid var(--colorscheme-black);
display: flex;
diff --git a/front/src/Emelents/Sidebar.tsx b/front/src/Emelents/Sidebar.tsx
index c650145..ad565fa 100644
--- a/front/src/Emelents/Sidebar.tsx
+++ b/front/src/Emelents/Sidebar.tsx
@@ -19,6 +19,7 @@ function Sidebar({setLang}: SidebarProps) {
<SidebarListElement Href='/' Text='Home' />
<SidebarListElement Href='/classes' Text='Classes' />
<SidebarListElement Href='/weapons' Text='Weapons' />
+ <SidebarListElement Href='/login' Text='Login' />
</ul>
<button onClick={() => {
setLang("ru");
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>