mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
use SkTransitionGroup for all dynamic TransitionGroup components
This commit is contained in:
parent
197d9db8e6
commit
7a003dec73
5 changed files with 15 additions and 15 deletions
|
@ -16,6 +16,7 @@ import { instance } from '@/instance.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { getDateText } from '@/utility/timeline-date-separate.js';
|
import { getDateText } from '@/utility/timeline-date-separate.js';
|
||||||
import { $i } from '@/i.js';
|
import { $i } from '@/i.js';
|
||||||
|
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
@ -146,14 +147,12 @@ export default defineComponent({
|
||||||
[$style['direction-up']]: props.direction === 'up',
|
[$style['direction-up']]: props.direction === 'up',
|
||||||
};
|
};
|
||||||
|
|
||||||
return () => prefer.s.animation ? h(TransitionGroup, {
|
return () => h(SkTransitionGroup, {
|
||||||
class: classes,
|
class: classes,
|
||||||
name: 'list',
|
name: 'list',
|
||||||
tag: 'div',
|
tag: 'div',
|
||||||
onBeforeLeave,
|
onBeforeLeave,
|
||||||
onLeaveCancelled,
|
onLeaveCancelled,
|
||||||
}, { default: renderChildren }) : h('div', {
|
|
||||||
class: classes,
|
|
||||||
}, { default: renderChildren });
|
}, { default: renderChildren });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -14,8 +14,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #default="{ items: notifications }">
|
<template #default="{ items: notifications }">
|
||||||
<component
|
<SkTransitionGroup
|
||||||
:is="prefer.s.animation ? TransitionGroup : 'div'" :class="[$style.notifications]"
|
:class="[$style.notifications]"
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
:enterFromClass="$style.transition_x_enterFrom"
|
:enterFromClass="$style.transition_x_enterFrom"
|
||||||
|
@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<DynamicNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :class="$style.item" :note="notification.note" :withHardMute="true" :data-scroll-anchor="notification.id"/>
|
<DynamicNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :class="$style.item" :note="notification.note" :withHardMute="true" :data-scroll-anchor="notification.id"/>
|
||||||
<XNotification v-else :class="$style.item" :notification="notification" :withTime="true" :full="true" :data-scroll-anchor="notification.id"/>
|
<XNotification v-else :class="$style.item" :notification="notification" :withTime="true" :full="true" :data-scroll-anchor="notification.id"/>
|
||||||
</div>
|
</div>
|
||||||
</component>
|
</SkTransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</MkPullToRefresh>
|
</MkPullToRefresh>
|
||||||
|
@ -45,6 +45,7 @@ import { i18n } from '@/i18n.js';
|
||||||
import { infoImageUrl } from '@/instance.js';
|
import { infoImageUrl } from '@/instance.js';
|
||||||
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
|
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
excludeTypes?: typeof notificationTypes[number][];
|
excludeTypes?: typeof notificationTypes[number][];
|
||||||
|
|
|
@ -4,8 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component
|
<SkTransitionGroup
|
||||||
:is="prefer.s.animation ? TransitionGroup : 'div'"
|
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
:enterFromClass="$style.transition_x_enterFrom"
|
:enterFromClass="$style.transition_x_enterFrom"
|
||||||
|
@ -15,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
>
|
>
|
||||||
<XReaction v-for="[reaction, count] in reactions" :key="reaction" :reaction="reaction" :count="count" :isInitial="initialReactions.has(reaction)" :note="note" @reactionToggled="onMockToggleReaction"/>
|
<XReaction v-for="[reaction, count] in reactions" :key="reaction" :reaction="reaction" :count="count" :isInitial="initialReactions.has(reaction)" :note="note" @reactionToggled="onMockToggleReaction"/>
|
||||||
<slot v-if="hasMoreReactions" :key="'$more'" name="more"/>
|
<slot v-if="hasMoreReactions" :key="'$more'" name="more"/>
|
||||||
</component>
|
</SkTransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -25,6 +24,7 @@ import { TransitionGroup } from 'vue';
|
||||||
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
|
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { DI } from '@/di.js';
|
import { DI } from '@/di.js';
|
||||||
|
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
note: Misskey.entities.Note;
|
note: Misskey.entities.Note;
|
||||||
|
|
|
@ -14,8 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #default="{ items: notes }">
|
<template #default="{ items: notes }">
|
||||||
<component
|
<SkTransitionGroup
|
||||||
:is="prefer.s.animation ? TransitionGroup : 'div'"
|
|
||||||
:class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap, [$style.reverse]: paginationQuery.reversed }]"
|
:class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap, [$style.reverse]: paginationQuery.reversed }]"
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
|
@ -33,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<DynamicNote v-else :class="$style.note" :note="note" :withHardMute="true" :data-scroll-anchor="note.id"/>
|
<DynamicNote v-else :class="$style.note" :note="note" :withHardMute="true" :data-scroll-anchor="note.id"/>
|
||||||
</div>
|
</div>
|
||||||
</component>
|
</SkTransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
</MkPullToRefresh>
|
</MkPullToRefresh>
|
||||||
|
@ -54,6 +53,7 @@ import DynamicNote from '@/components/DynamicNote.vue';
|
||||||
import MkPagination from '@/components/MkPagination.vue';
|
import MkPagination from '@/components/MkPagination.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { infoImageUrl } from '@/instance.js';
|
import { infoImageUrl } from '@/instance.js';
|
||||||
|
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role';
|
src: BasicTimelineType | 'mentions' | 'directs' | 'list' | 'antenna' | 'channel' | 'role';
|
||||||
|
|
|
@ -67,8 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<XUpload v-if="uploads.length > 0"/>
|
<XUpload v-if="uploads.length > 0"/>
|
||||||
|
|
||||||
<component
|
<SkTransitionGroup
|
||||||
:is="prefer.s.animation ? TransitionGroup : 'div'"
|
|
||||||
tag="div"
|
tag="div"
|
||||||
:class="[$style.notifications, {
|
:class="[$style.notifications, {
|
||||||
[$style.notificationsPosition_leftTop]: prefer.s.notificationPosition === 'leftTop',
|
[$style.notificationsPosition_leftTop]: prefer.s.notificationPosition === 'leftTop',
|
||||||
|
@ -87,7 +86,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div v-for="notification in notifications" :key="notification.id" :class="$style.notification" :style="{ pointerEvents: getPointerEvents() }">
|
<div v-for="notification in notifications" :key="notification.id" :class="$style.notification" :style="{ pointerEvents: getPointerEvents() }">
|
||||||
<XNotification :notification="notification"/>
|
<XNotification :notification="notification"/>
|
||||||
</div>
|
</div>
|
||||||
</component>
|
</SkTransitionGroup>
|
||||||
|
|
||||||
<XStreamIndicator/>
|
<XStreamIndicator/>
|
||||||
|
|
||||||
|
@ -115,6 +114,7 @@ import { i18n } from '@/i18n.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { globalEvents } from '@/events.js';
|
import { globalEvents } from '@/events.js';
|
||||||
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
|
import XDrawerMenu from '@/ui/_common_/navbar-for-mobile.vue';
|
||||||
|
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
||||||
|
|
||||||
const XStreamIndicator = defineAsyncComponent(() => import('./stream-indicator.vue'));
|
const XStreamIndicator = defineAsyncComponent(() => import('./stream-indicator.vue'));
|
||||||
const XUpload = defineAsyncComponent(() => import('./upload.vue'));
|
const XUpload = defineAsyncComponent(() => import('./upload.vue'));
|
||||||
|
|
Loading…
Add table
Reference in a new issue