diff --git a/src/assets/newCommunity.png b/src/assets/newCommunity.png new file mode 100644 index 0000000000000000000000000000000000000000..73bfba9f8000cecabb461394d7fe2f6b90c02b56 Binary files /dev/null and b/src/assets/newCommunity.png differ diff --git a/src/components/CommunityComponents/CommunityHome.vue b/src/components/CommunityComponents/CommunityHome.vue index 829c500e223de67baf7c2014fa09c82d2ce2277c..08a1468f9527895c878bf65e634ed4166362cd3a 100644 --- a/src/components/CommunityComponents/CommunityHome.vue +++ b/src/components/CommunityComponents/CommunityHome.vue @@ -2,7 +2,7 @@ <section class="relative w-full max-w-md px-5 py-4 mx-auto rounded-md"> <div> <img - class="cursor-pointer h-8 mr-4 mt-4 float-right" + class="cursor-pointer h-8 float-right" v-if="isLoggedIn" src="@/assets/members.png" alt="Medlemmer" diff --git a/src/views/CommunityViews/CommunityView.vue b/src/views/CommunityViews/CommunityView.vue index d608f4bb50feb03376484b7f79de4685868b7977..a2279054ac63749bd62f790783e9adefb23edaa7 100644 --- a/src/views/CommunityViews/CommunityView.vue +++ b/src/views/CommunityViews/CommunityView.vue @@ -1,14 +1,24 @@ <template> <div> - <div id="myGroups"> - <div>Mine grupper:</div> + <img + class="cursor-pointer h-8 mr-4 mt-4 float-right" + v-if="isLoggedIn" + src="@/assets/newCommunity.png" + alt="Legg til gruppe" + @click="$router.push('/createNewGroup')" + /> + </div> + <div> + <div id="myGroups" v-if="isLoggedIn"> + <div class="m-4" >Mine grupper:</div> <group-list :groupList="myGroups" /> </div> <div id="localGroups"> - <div>Offentlige grupper:</div> + <div class="m-4">Offentlige grupper:</div> <group-list :groupList="localGroups" /> </div> </div> + </template> <script> @@ -19,6 +29,7 @@ export default { name: "HomeView", data() { return { + isLoggedIn: false, myGroups: [], localGroups: [], }; @@ -37,6 +48,9 @@ export default { async created() { await this.getMyGroups(); await this.getPotentialGroups(); - }, + if(this.$store.state.user.token !== null){ + this.isLoggedIn = true + } + }, }; </script>