From 2bedc084a35b4e62c032522baa4538c6cc0b936a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 14 Jan 2023 11:14:14 +0900 Subject: [PATCH] tweak MkRolePreview --- .../src/core/entities/RoleEntityService.ts | 1 + .../frontend/src/components/MkRolePreview.vue | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/entities/RoleEntityService.ts b/packages/backend/src/core/entities/RoleEntityService.ts index 27e34a649..7db7ed669 100644 --- a/packages/backend/src/core/entities/RoleEntityService.ts +++ b/packages/backend/src/core/entities/RoleEntityService.ts @@ -62,6 +62,7 @@ export class RoleEntityService { isModerator: role.isModerator, canEditMembersByModerator: role.canEditMembersByModerator, options: roleOptions, + usersCount: assigns.length, ...(opts.detail ? { users: this.userEntityService.packMany(assigns.map(x => x.userId), me), } : {}), diff --git a/packages/frontend/src/components/MkRolePreview.vue b/packages/frontend/src/components/MkRolePreview.vue index ddd7dbb25..da3963025 100644 --- a/packages/frontend/src/components/MkRolePreview.vue +++ b/packages/frontend/src/components/MkRolePreview.vue @@ -1,6 +1,10 @@ @@ -9,6 +13,7 @@ import { } from 'vue'; import * as misskey from 'misskey-js'; import * as os from '@/os'; +import { i18n } from '@/i18n'; const props = defineProps<{ role: any; @@ -23,9 +28,18 @@ const props = defineProps<{ } .title { + display: flex; +} + +.name { font-weight: bold; } +.users { + margin-left: auto; + opacity: 0.7; +} + .description { opacity: 0.7; }