mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-24 02:06:12 +03:00
feat: add roles into account header and info (#2265)
This commit is contained in:
parent
0719ad0afd
commit
22a1388d50
3 changed files with 25 additions and 0 deletions
|
@ -167,6 +167,7 @@ const personalNoteMaxLength = 2000
|
|||
<div flex="~ col gap1" pt2>
|
||||
<div flex gap2 items-center>
|
||||
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
|
||||
<AccountRoleIndicator v-for="role in account.roles" :key="role.id" :role="role" />
|
||||
<AccountLockIndicator v-if="account.locked" show-label />
|
||||
<AccountBotIndicator v-if="account.bot" show-label />
|
||||
</div>
|
||||
|
|
|
@ -23,6 +23,7 @@ const { account, as = 'div' } = defineProps<{
|
|||
<div flex="~ col" shrink pt-1 h-full overflow-hidden justify-center leading-none select-none>
|
||||
<div flex="~" gap-2>
|
||||
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
|
||||
<AccountRoleIndicator v-for="role in account.roles" :key="role.id" :role="role" />
|
||||
<AccountLockIndicator v-if="account.locked" text-xs />
|
||||
<AccountBotIndicator v-if="account.bot" text-xs />
|
||||
</div>
|
||||
|
|
23
components/account/AccountRoleIndicator.vue
Normal file
23
components/account/AccountRoleIndicator.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
interface Role {
|
||||
name: string
|
||||
color: string
|
||||
}
|
||||
|
||||
defineProps<{
|
||||
role: Role
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
flex="~ gap1" items-center
|
||||
class="border border-base rounded-md px-1"
|
||||
text-secondary-light
|
||||
>
|
||||
<slot name="prepend" />
|
||||
<div :style="`color: ${role.color}; border-color: ${role.color}`">
|
||||
{{ role.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in a new issue