parent
956fe873f6
commit
d21370eabb
@ -0,0 +1,27 @@ |
||||
.p-avatar { |
||||
@apply rounded-md bg-gray-25; |
||||
|
||||
&.p-avatar-lg { |
||||
@apply h-12 w-12; |
||||
font-size: 1.5rem; |
||||
|
||||
.p-avatar-icon { |
||||
font-size: 1.5rem; |
||||
} |
||||
} |
||||
|
||||
&.p-avatar-xl { |
||||
@apply h-16 w-16; |
||||
font-size: 2rem; |
||||
|
||||
.p-avatar-icon { |
||||
font-size: 2rem; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.p-avatar-group { |
||||
.p-avatar { |
||||
@apply border border-solid border-white; |
||||
} |
||||
} |
||||
@ -1,47 +1,55 @@ |
||||
<template> |
||||
<v-card> |
||||
|
||||
<q-item> |
||||
<q-item-section side> |
||||
<q-avatar size="64px"> |
||||
<img :src="user.illustrationUrl + '?w=80&h=80&fit=crop'" /> |
||||
</q-avatar> |
||||
</q-item-section> |
||||
<q-item-section> |
||||
<q-item-label>{{ user.fullName }}</q-item-label> |
||||
<q-item-label caption>{{ user.username }}</q-item-label> |
||||
</q-item-section> |
||||
</q-item> |
||||
|
||||
<q-tabs align="left" dense inline-label no-caps> |
||||
<q-route-tab to="/resources/friends" label="My friends" /> |
||||
<q-route-tab to="/resources/personal_files" label="My files" /> |
||||
</q-tabs> |
||||
|
||||
<a href="/account/edit" class="btn btn--primary"> |
||||
Edit profile |
||||
</a> |
||||
</v-card> |
||||
<div id="account-home"> |
||||
<div class="flex mb-4"> |
||||
<Avatar |
||||
:image="user.illustrationUrl + '?w=80&h=80&fit=crop'" |
||||
shape="circle" |
||||
size="large" |
||||
class="flex-none mr-2" |
||||
/> |
||||
<div class="flex-1"> |
||||
<p class="text-body-1"> |
||||
{{ user.fullName }} |
||||
</p> |
||||
<p class="text-caption"> |
||||
{{ user.username }} |
||||
</p> |
||||
</div> |
||||
</div> |
||||
|
||||
<Button |
||||
class="p-button-sm mb-4" |
||||
label="Edit profile" |
||||
@click="btnEditProfileOnClick" |
||||
/> |
||||
|
||||
<p> |
||||
<router-link to="/resources/friends"> |
||||
{{ t('My friends') }} |
||||
</router-link> |
||||
</p> |
||||
<p> |
||||
<router-link to="/resources/personal_files"> |
||||
{{ t('My files') }} |
||||
</router-link> |
||||
</p> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { useRoute } from 'vue-router' |
||||
import axios from "axios"; |
||||
import { ENTRYPOINT } from '../../config/entrypoint'; |
||||
import {computed, reactive, ref, toRefs} from 'vue' |
||||
import {mapGetters, useStore} from "vuex"; |
||||
|
||||
export default { |
||||
name: 'Home', |
||||
components: { |
||||
}, |
||||
setup() { |
||||
const state = reactive({user: []}); |
||||
const store = useStore(); |
||||
state.user = computed(() => store.getters['security/getUser']); |
||||
state.isAuthenticated = computed(() => store.getters['security/isAuthenticated']); |
||||
|
||||
return toRefs(state); |
||||
}, |
||||
}; |
||||
<script setup> |
||||
import { computed } from 'vue'; |
||||
import { useStore } from 'vuex'; |
||||
|
||||
import Avatar from 'primevue/avatar'; |
||||
import { useI18n } from 'vue-i18n'; |
||||
|
||||
const store = useStore(); |
||||
|
||||
const { t } = useI18n(); |
||||
|
||||
const user = computed(() => store.getters['security/getUser']); |
||||
|
||||
function btnEditProfileOnClick () { |
||||
window.location = '/account/edit'; |
||||
} |
||||
</script> |
||||
|
||||
Loading…
Reference in new issue