diff --git a/src/assets/defaultUserProfileImage.jpg b/src/assets/defaultUserProfileImage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..18c8cd70555d36af38f2bf164b0a22740b14cf6b Binary files /dev/null and b/src/assets/defaultUserProfileImage.jpg differ diff --git a/src/components/UserProfileComponents/RatingComponent.vue b/src/components/UserProfileComponents/RatingComponent.vue new file mode 100644 index 0000000000000000000000000000000000000000..218b35c8f5e1a6bd184dc6e331e460dc69e6257c --- /dev/null +++ b/src/components/UserProfileComponents/RatingComponent.vue @@ -0,0 +1,35 @@ +<template> + <v-row class="mb-6" justify="start" dense> + <v-col cols="5"> + <div>{{ ratingType }} rating:</div> + </v-col> + <v-col cols="2"> + <v-rating + v-model="compRating" + color="amber" + dense + half-increments + readonly + size="14" + ></v-rating> + </v-col> + <v-col cols="1"> + <div class="grey--text ms-4">{{ compRating }}</div> + </v-col> + </v-row> +</template> + +<script> +export default { + name: "RatingComponent", + data() { + return { + compRating: this.rating + 0, + }; + }, + props: { + rating: Number, + ratingType: String, + }, +}; +</script> diff --git a/src/components/UserProfileComponents/UserListItemCard.vue b/src/components/UserProfileComponents/UserListItemCard.vue new file mode 100644 index 0000000000000000000000000000000000000000..ec8b455cb967cb6dbf25c476eafb51efb957a85f --- /dev/null +++ b/src/components/UserProfileComponents/UserListItemCard.vue @@ -0,0 +1,64 @@ +<template> + <v-card class="pa-2" max-height="100" width="90%" outlined tile> + <v-row align="center" class="spacer" no-gutters> + <v-col cols="4" sm="2" md="1"> + <v-avatar size="60"> + <v-img src="@/assets/defaultUserProfileImage.jpg"></v-img> + </v-avatar> + </v-col> + + <v-col class="hidden-xs-only" sm="5" md="3"> + <v-card-title> {{ name }} </v-card-title> + </v-col> + + <v-col> + <v-card-text> + <div>{{ ratingType }} rating:</div> + + <v-rating + v-model="rating" + color="amber" + dense + half-increments + readonly + size="14" + ></v-rating> + </v-card-text> + </v-col> + + <v-col offset="4"> + <v-card-text> + <v-chip v-if="admin" class="ma-2" color="error" outlined pill> + Fjern bruker + <v-icon right> mdi-trash-can-outline </v-icon> + </v-chip> + <v-chip v-else class="ma-2" color="primary" outlined pill> + Ã…pne chat + <v-icon right> mdi-chat </v-icon> + </v-chip> + </v-card-text> + </v-col> + </v-row> + <v-col> </v-col> + </v-card> +</template> + +<script> +export default { + name: "UserListItem", + data() { + return { + name: "Navn Navnesen", + rating: 3, + admin: true, + }; + }, + computed: { + //user: getUser(userID), + }, + props: { + userID: Number, + ratingType: String, + }, +}; +</script> diff --git a/src/views/ProfileView.vue b/src/views/ProfileView.vue new file mode 100644 index 0000000000000000000000000000000000000000..09d32285494a15c8c09cce00b651fb71ef5c4e17 --- /dev/null +++ b/src/views/ProfileView.vue @@ -0,0 +1,30 @@ +<!-- View for looking at different profile display methods --> +<template> + <v-container> + <v-row align="center" class="pa-2"> + <large-profile-card :isCurrentUser="true" :userID="2" /> + </v-row> + <v-row align="center" class="pa-2"> + <large-profile-card :userID="1" :isCurrentUser="false" /> + </v-row> + <v-row align="center" class="pa-2"> + <user-list-item :userID="1" :ratingType="'Leietaker'" /> + </v-row> + </v-container> +</template> + +<script> +import { defineComponent } from "vue"; + +// Components +import LargeProfileCard from "@/components/UserProfileComponents/LargeProfileCard.vue"; +import UserListItem from "@/components/UserProfileComponents/UserListItemCard.vue"; + +export default defineComponent({ + name: "ProfileView", + components: { + LargeProfileCard, + UserListItem, + }, +}); +</script>