+ {{ t(`${role}`) }} +
+diff --git a/frontend/src/components/MenuBar.vue b/frontend/src/components/MenuBar.vue
index 5ff76f0d..ed80d7c2 100644
--- a/frontend/src/components/MenuBar.vue
+++ b/frontend/src/components/MenuBar.vue
@@ -9,15 +9,10 @@
const { t, locale } = useI18n();
- // Instantiate variables to use in html to render right
- // Links and content dependent on the role (student or teacher)
- const path = "/user";
-
const role = auth.authState.activeRole;
- //TODO: use authState form services map to get user token
- const name = "Kurt Cobain";
- const initials = name
+ const name: string = auth.authState.user!.profile.name!;
+ const initials: string = name
.split(" ")
.map((n) => n[0])
.join("");
@@ -34,18 +29,139 @@
const changeLanguage = (langCode: string) => {
locale.value = langCode;
localStorage.setItem("user-lang", langCode);
- console.log(langCode);
+ };
+
+ // contains functionality to let the collapsed menu appear and disappear
+ // when the screen size varies
+ const drawer = ref(false);
+
+ // when the user wants to logout, a popup is shown to verify this
+ // if verified, the user should be logged out
+ const performLogout = () => {
+ auth.logout();
};
+ {{ t(`${role}`) }}
+
+