mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-28 21:28:19 +01:00
merge: Add "pinned" section to notes tab on user profiles (!689)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/689 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Tess K <me@thvxl.se>
This commit is contained in:
commit
0a05841f33
2 changed files with 23 additions and 9 deletions
|
@ -141,8 +141,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkLazy>
|
||||
<XActivity :key="user.id" :user="user" :collapsed="true"/>
|
||||
</MkLazy>
|
||||
<MkLazy>
|
||||
<XListenBrainz v-if="user.listenbrainz && listenbrainzdata" :key="user.id" :user="user" :collapsed="true"/>
|
||||
<MkLazy v-if="user.listenbrainz && listenbrainzdata">
|
||||
<XListenBrainz :key="user.id" :user="user" :collapsed="true"/>
|
||||
</MkLazy>
|
||||
</template>
|
||||
<!-- <div v-if="!disableNotes">
|
||||
|
@ -303,7 +303,7 @@ const pagination = {
|
|||
endpoint: 'users/featured-notes' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id,
|
||||
userId: props.user.id
|
||||
})),
|
||||
};
|
||||
|
||||
|
@ -820,10 +820,6 @@ onUnmounted(() => {
|
|||
color: var(--success);
|
||||
}
|
||||
|
||||
.pinnedNote:not(:last-child) {
|
||||
border-bottom: solid 0.5px var(--divider);
|
||||
}
|
||||
|
||||
.infoBadges {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
|
|
|
@ -7,22 +7,40 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkStickyContainer>
|
||||
<template #header>
|
||||
<MkTab v-model="tab" :class="$style.tab">
|
||||
<option value="pinned">{{ i18n.ts.pinnedOnly }}</option>
|
||||
<option value="featured">{{ i18n.ts.featured }}</option>
|
||||
<option :value="null">{{ i18n.ts.notes }}</option>
|
||||
<option value="all">{{ i18n.ts.all }}</option>
|
||||
<option value="files">{{ i18n.ts.withFiles }}</option>
|
||||
</MkTab>
|
||||
</template>
|
||||
<MkNotes :noGap="true" :pagination="pagination" :class="$style.tl"/>
|
||||
<div v-if="tab === 'pinned'" class="_gaps">
|
||||
<div v-if="user.pinnedNotes.length < 1" class="_fullinfo">
|
||||
<img :src="infoImageUrl" class="_ghost" aria-hidden="true" :alt="i18n.ts.noNotes"/>
|
||||
<div>{{ i18n.ts.noNotes }}</div>
|
||||
</div>
|
||||
<div v-else class="_panel">
|
||||
<MkNote v-for="note of user.pinnedNotes" :key="note.id" class="note" :class="$style.pinnedNote" :note="note" :pinned="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<MkNotes v-else :noGap="true" :pagination="pagination" :class="$style.tl"/>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, defineAsyncComponent } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkNotes from '@/components/MkNotes.vue';
|
||||
import MkTab from '@/components/MkTab.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const MkNote = defineAsyncComponent(() =>
|
||||
defaultStore.state.noteDesign === 'sharkey'
|
||||
? import('@/components/SkNote.vue')
|
||||
: import('@/components/MkNote.vue'),
|
||||
);
|
||||
|
||||
const props = defineProps<{
|
||||
user: Misskey.entities.UserDetailed;
|
||||
|
|
Loading…
Reference in a new issue