diff --git a/src/assets/messages.png b/src/assets/messages.png new file mode 100644 index 0000000000000000000000000000000000000000..b8c15889efc747b700220ca819b2c12caa09e780 Binary files /dev/null and b/src/assets/messages.png differ diff --git a/src/assets/notifications.png b/src/assets/notifications.png new file mode 100644 index 0000000000000000000000000000000000000000..a612605af4bc91be42f5989632fb3287aac7bbfd Binary files /dev/null and b/src/assets/notifications.png differ diff --git a/src/assets/profile.png b/src/assets/profile.png new file mode 100644 index 0000000000000000000000000000000000000000..79b3e5f3624b8db0593ca77997f52633c34f7de9 Binary files /dev/null and b/src/assets/profile.png differ diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index e4b0c39207cd58cdc20c68281aee6c505519b012..2e055ef04cf72854ac6e8bf53a0c5e7f0eb91195 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -1,14 +1,9 @@ <template> <div class="App"> - <div id="logoField" class="flex justify-center m-6"> - <img src="../assets/logo3.svg" alt="BoCo logo" /> - </div> - <div id="emailField" class="m-6" - :class="{ error: v$.user.email.$errors.length }" - > + :class="{ error: v$.user.email.$errors.length }"> <div class="mb-6"> <label for="email" @@ -102,7 +97,6 @@ import useVuelidate from "@vuelidate/core"; import { required, email, helpers } from "@vuelidate/validators"; import { doLogin } from "@/utils/apiutil"; -import { parseUserFromToken } from "@/utils/token-utils"; export default { name: "LoginForm.vue", @@ -160,12 +154,7 @@ export default { this.$store.commit("logout"); } else if (loginResponse.isLoggedIn === true) { this.$store.commit("saveToken", loginResponse.token); - - let user = parseUserFromToken(loginResponse.token); - console.log(user); - let id = user.accountId; - console.log(id); - await this.$router.push("/profile/" + id); + await this.$router.push('/'); } else { console.log("Something went wrong"); } diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 978e645fefa885e1dfe8fe775303d6ce7ce98983..35b12181b7278c063b3dbd35154190075a92e208 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -1,17 +1,17 @@ <template> <nav class="flex items-center justify-between bg-white h-20 shadow-2xl"> <div class="logo"> - <img class="ml-4 cursor-pointer h-16 " src="../assets/logo3.svg" alt="BoCo logo" @click="$router.push('/')"/> + <img class="m-2 cursor-pointer h-16 " src="../assets/logo3.svg" alt="BoCo logo" @click="$router.push('/')"/> </div> <ul class="flex"> <li> - <div class="text-black mr-4 bg-gray-100 p-1 hover:bg-gray-600 transition-all rounded" @click="loadMessages">Meldinger</div> + <img class="m-6 cursor-pointer h-8 " src="../assets/messages.png" alt="Meldinger" @click="$router.push('/messages')"/> </li> <li> - <div class="text-black mr-4 bg-gray-100 p-1 hover:bg-gray-600 transition-all rounded" @click="loadNotifications">Varsler</div> + <img class="m-6 cursor-pointer h-8 " src="../assets/notifications.png" alt="Varlser" @click="$router.push('/notifications')"/> </li> <li> - <div class="text-black mr-4 bg-gray-100 p-1 hover:bg-gray-600 transition-all rounded" @click="loadProfile">Profil</div> + <img class="m-6 cursor-pointer h-8 " src="../assets/profile.png" alt="Profil" @click="loadProfile"/> </li> </ul> </nav> @@ -24,24 +24,6 @@ export default { name: "NavBar.vue", methods: { - async loadMessages(){ - if(this.$store.state.user.token !== null){ - await this.$router.push("/messages") - } - else { - await this.$router.push("/login"); - } - - }, - async loadNotifications(){ - if(this.$store.state.user.token !== null){ - await this.$router.push("/notifications") - } - else { - await this.$router.push("/login"); - } - - }, async loadProfile() { if(this.$store.state.user.token !== null){ let user = parseUserFromToken(this.$store.state.user.token);