mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-20 08:52:15 +00:00
Team member preview refactoring
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
<template>
|
||||
<div class="absolute -right-1 -bottom-1">
|
||||
<img
|
||||
v-if="item.data.relationships.user.data.attributes.avatar"
|
||||
class="w-5 h-5 rounded"
|
||||
style="outline: 2px solid white;"
|
||||
:src="item.data.relationships.user.data.attributes.avatar"
|
||||
:alt="item.data.relationships.user.data.attributes.name"
|
||||
>
|
||||
<TypedAvatar
|
||||
v-else
|
||||
:size="22"
|
||||
:letter="item.data.relationships.user.data.attributes.name.substr(0, 1)"
|
||||
:color="item.data.relationships.user.data.attributes.color"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TypedAvatar from "../Others/TypedAvatar"
|
||||
|
||||
export default {
|
||||
name: 'AuthorThumbnail',
|
||||
components: {
|
||||
TypedAvatar
|
||||
},
|
||||
props: [
|
||||
'item',
|
||||
]
|
||||
}
|
||||
</script>
|
||||
@@ -16,7 +16,13 @@
|
||||
<!--Thumbnail for item-->
|
||||
<div class="icon-item">
|
||||
|
||||
<AuthorThumbnail v-if="canShowAuthor" :item="item" />
|
||||
<MemberAvatar
|
||||
v-if="canShowAuthor"
|
||||
:size="28"
|
||||
:is-border="true"
|
||||
:member="item.data.relationships.user"
|
||||
class="absolute -right-2 -bottom-2"
|
||||
/>
|
||||
|
||||
<!--If is file or image, then link item-->
|
||||
<span v-if="isFile || isVideo || (isImage && !item.data.attributes.thumbnail)" class="file-icon-text text-theme dark-text-theme">
|
||||
@@ -69,7 +75,7 @@
|
||||
import {LinkIcon, MoreVerticalIcon} from 'vue-feather-icons'
|
||||
import FolderIcon from '/resources/js/components/FilesView/FolderIcon'
|
||||
import CheckBox from '/resources/js/components/FilesView/CheckBox'
|
||||
import AuthorThumbnail from "./AuthorThumbnail";
|
||||
import MemberAvatar from "./MemberAvatar";
|
||||
import {events} from '/resources/js/bus'
|
||||
import {debounce} from 'lodash'
|
||||
import {mapGetters} from 'vuex'
|
||||
@@ -82,7 +88,7 @@ export default {
|
||||
],
|
||||
components: {
|
||||
MoreVerticalIcon,
|
||||
AuthorThumbnail,
|
||||
MemberAvatar,
|
||||
FolderIcon,
|
||||
CheckBox,
|
||||
LinkIcon,
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
v-if="!emoji && item.data.attributes.isTeamFolder"
|
||||
:class="[{'is-deleted':isDeleted},{'default-color': ! color && ! isDeleted}, 'folder-icon' ]"
|
||||
:style="{fill: color}"
|
||||
style="width: 53px; height: 52px"
|
||||
/>
|
||||
<!-- <FontAwesomeIcon
|
||||
v-if="!emoji"
|
||||
|
||||
@@ -1,31 +1,44 @@
|
||||
<template>
|
||||
<div class="user-preview">
|
||||
<div>
|
||||
<img
|
||||
:style="{width: size + 'px', height: size + 'px'}"
|
||||
v-if="member.data.attributes.avatar"
|
||||
:src="member.data.attributes.avatar"
|
||||
:alt="member.data.attributes.name"
|
||||
class="rounded-xl border-4 border-white"
|
||||
:class="[borderRadius, {'border-3 border-white': isBorder}]"
|
||||
class=""
|
||||
>
|
||||
<TypedAvatar
|
||||
<div
|
||||
v-else
|
||||
:size="size"
|
||||
:letter="member.data.attributes.name.substr(0, 1)"
|
||||
:color="member.data.attributes.color"
|
||||
/>
|
||||
class="flex items-center justify-center"
|
||||
:class="[borderRadius, {'border-3 border-white': isBorder}]"
|
||||
:style="{width: size + 'px', height: size + 'px', background: member.data.attributes.color ? member.data.attributes.color : '#f4f5f6'}"
|
||||
>
|
||||
<span :class="fontSize" class="uppercase font-extrabold">
|
||||
{{ letter }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import TypedAvatar from "../Others/TypedAvatar"
|
||||
|
||||
export default {
|
||||
name: 'MemberAvatar',
|
||||
props: [
|
||||
'isBorder',
|
||||
'member',
|
||||
'size',
|
||||
],
|
||||
components: {
|
||||
TypedAvatar,
|
||||
},
|
||||
computed: {
|
||||
letter() {
|
||||
return this.member.data.attributes.name.substr(0, 1)
|
||||
},
|
||||
borderRadius() {
|
||||
return this.size > 32 ? 'rounded-xl' : 'rounded-lg'
|
||||
},
|
||||
fontSize() {
|
||||
return this.size > 32 ? 'text-base' : 'text-sm'
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user