Skip to content

Commit

Permalink
enhance(frontend): 自分のクリップ一覧ではアバターを表示しないように (#14256)
Browse files Browse the repository at this point in the history
* enhance(frontend): 自分のクリップ一覧ではアバターを表示しないように

* Update Changelog

* rename

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
  • Loading branch information
kakkokari-gtyih and syuilo authored Jul 30, 2024
1 parent f965f65 commit 3548ffb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const Default = {
},
args: {
clip: clip(),
noUserInfo: false,
},
parameters: {
layout: 'fullscreen',
Expand Down
17 changes: 11 additions & 6 deletions packages/frontend/src/components/MkClipPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="clip.lastClippedAt">{{ i18n.ts.updatedAt }}: <MkTime :time="clip.lastClippedAt" mode="detail"/></div>
<div v-if="clip.notesCount != null">{{ i18n.ts.notesCount }}: {{ number(clip.notesCount) }} / {{ $i?.policies.noteEachClipsLimit }} ({{ i18n.tsx.remainingN({ n: remaining }) }})</div>
</div>
<div :class="$style.divider"></div>
<div>
<MkAvatar :user="clip.user" :class="$style.userAvatar" indicator link preview/> <MkUserName :user="clip.user" :nowrap="false"/>
</div>
<template v-if="!props.noUserInfo">
<div :class="$style.divider"></div>
<div>
<MkAvatar :user="clip.user" :class="$style.userAvatar" indicator link preview/> <MkUserName :user="clip.user" :nowrap="false"/>
</div>
</template>
</div>
</MkA>
</template>
Expand All @@ -27,9 +29,12 @@ import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
import number from '@/filters/number.js';

const props = defineProps<{
const props = withDefaults(defineProps<{
clip: Misskey.entities.Clip;
}>();
noUserInfo?: boolean;
}>(), {
noUserInfo: false,
});

const remaining = computed(() => {
return ($i?.policies && props.clip.notesCount != null) ? ($i.policies.noteEachClipsLimit - props.clip.notesCount) : i18n.ts.unknown;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/my-clips/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton primary rounded class="add" @click="create"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>

<MkPagination v-slot="{ items }" ref="pagingComponent" :pagination="pagination" class="_gaps">
<MkClipPreview v-for="item in items" :key="item.id" :clip="item"/>
<MkClipPreview v-for="item in items" :key="item.id" :clip="item" :noUserInfo="true"/>
</MkPagination>
</div>
<div v-else-if="tab === 'favorites'" key="favorites" class="_gaps">
Expand Down

0 comments on commit 3548ffb

Please sign in to comment.