1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-28 14:58:15 +09:00

refactor clinet

This commit is contained in:
syuilo 2021-10-24 04:03:07 +09:00
parent 4d1c723496
commit 4f04421cb3
33 changed files with 745 additions and 843 deletions

View File

@ -2,8 +2,8 @@
<div class="fdidabkb" :class="{ slim: narrow, thin: thin_ }" :style="{ background: bg }" @click="onClick" ref="el">
<template v-if="info">
<div class="titleContainer" @click="showTabsPopup" v-if="!hideTitle">
<i v-if="info.icon" class="icon" :class="info.icon"></i>
<MkAvatar v-else-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true" :show-indicator="true"/>
<MkAvatar v-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true" :show-indicator="true"/>
<i v-else-if="info.icon" class="icon" :class="info.icon"></i>
<div class="title">
<MkUserName v-if="info.userName" :user="info.userName" :nowrap="false" class="title"/>
@ -162,11 +162,6 @@ export default defineComponent({
onUnmounted(() => {
ro.disconnect();
});
setTimeout(() => {
const currentStickyTop = getComputedStyle(el.value.parentElement).getPropertyValue('--stickyTop') || '0px';
el.value.style.setProperty('--stickyTop', currentStickyTop);
el.value.parentElement.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${el.value.offsetHeight}px)`);
}, 100); // stickyTop
}
});

View File

@ -0,0 +1,74 @@
<template>
<div ref="rootEl">
<slot name="header"></slot>
<div ref="bodyEl">
<slot></slot>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
export default defineComponent({
props: {
autoSticky: {
type: Boolean,
required: false,
default: false,
},
},
setup(props, context) {
const rootEl = ref<HTMLElement>(null);
const bodyEl = ref<HTMLElement>(null);
const calc = () => {
const currentStickyTop = getComputedStyle(rootEl.value).getPropertyValue('--stickyTop') || '0px';
const header = rootEl.value.children[0];
if (header === bodyEl.value) {
bodyEl.value.style.setProperty('--stickyTop', currentStickyTop);
} else {
bodyEl.value.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${header.offsetHeight}px)`);
if (props.autoSticky) {
header.style.setProperty('--stickyTop', currentStickyTop);
header.style.position = 'sticky';
header.style.top = 'var(--stickyTop)';
header.style.zIndex = '1';
}
}
};
onMounted(() => {
calc();
const observer = new MutationObserver(() => {
setTimeout(() => {
calc();
}, 100);
});
observer.observe(rootEl.value, {
attributes: false,
childList: true,
subtree: false,
});
onUnmounted(() => {
observer.disconnect();
});
});
return {
rootEl,
bodyEl,
};
},
});
</script>
<style lang="scss" module>
</style>

View File

@ -15,6 +15,7 @@ import error from './global/error.vue';
import ad from './global/ad.vue';
import header from './global/header.vue';
import spacer from './global/spacer.vue';
import stickyContainer from './global/sticky-container.vue';
export default function(app: App) {
app.component('I18n', i18n);
@ -32,4 +33,5 @@ export default function(app: App) {
app.component('MkAd', ad);
app.component('MkHeader', header);
app.component('MkSpacer', spacer);
app.component('MkStickyContainer', stickyContainer);
}

View File

@ -11,9 +11,12 @@
<button class="_button" @click="$refs.modal.close()"><i class="fas fa-times"></i></button>
</div>
<div class="body">
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<keep-alive>
<component :is="component" v-bind="props" :ref="changePage"/>
</keep-alive>
</MkStickyContainer>
</div>
</div>
</MkModal>

View File

@ -17,7 +17,10 @@
<button v-if="history.length > 0" class="_button" @click="back()" v-tooltip="$ts.goBack"><i class="fas fa-arrow-left"></i></button>
</template>
<div class="yrolvcoq">
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<component :is="component" v-bind="props" :ref="changePage"/>
</MkStickyContainer>
</div>
</XWindow>
</template>

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="uqshojas">
<div class="uqshojas">
<section class="_card _gap ads" v-for="ad in ads">
<div class="_content ad">
<MkAd v-if="ad.url" :specify="ad"/>
@ -39,7 +37,6 @@
</div>
</div>
</section>
</div>
</div>
</template>
@ -68,11 +65,6 @@ export default defineComponent({
title: this.$ts.ads,
icon: 'fas fa-audio-description',
bg: 'var(--bg)',
},
header: {
title: this.$ts.ads,
icon: 'fas fa-audio-description',
bg: 'var(--bg)',
actions: [{
asFullButton: true,
icon: 'fas fa-plus',

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="ztgjmzrw">
<div class="ztgjmzrw">
<section class="_card _gap announcements" v-for="announcement in announcements">
<div class="_content announcement">
<MkInput v-model="announcement.title">
@ -21,7 +18,6 @@
</div>
</div>
</section>
</div>
</div>
</template>
@ -48,11 +44,6 @@ export default defineComponent({
title: this.$ts.announcements,
icon: 'fas fa-broadcast-tower',
bg: 'var(--bg)',
},
header: {
title: this.$ts.announcements,
icon: 'fas fa-broadcast-tower',
bg: 'var(--bg)',
actions: [{
asFullButton: true,
icon: 'fas fa-plus',

View File

@ -1,7 +1,5 @@
<template>
<div class="ogwlenmc">
<MkHeader :info="header"/>
<div class="local" v-if="tab === 'local'">
<MkInput v-model="query" :debounce="true" type="search" style="margin: var(--margin);">
<template #prefix><i class="fas fa-search"></i></template>
@ -71,12 +69,7 @@ export default defineComponent({
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.customEmojis,
icon: 'fas fa-laugh',
bg: 'var(--bg)',
},
header: computed(() => ({
[symbols.PAGE_INFO]: computed(() => ({
title: this.$ts.customEmojis,
icon: 'fas fa-laugh',
bg: 'var(--bg)',

View File

@ -13,7 +13,10 @@
<MkSuperMenu :def="menuDef" :grid="page == null"></MkSuperMenu>
</div>
<div class="main">
<MkStickyContainer>
<template #header><MkHeader v-if="childInfo && !childInfo.hideHeader" :info="childInfo"/></template>
<component :is="component" :key="page" @info="onInfo" v-bind="pageProps"/>
</MkStickyContainer>
</div>
</div>
</template>
@ -41,6 +44,10 @@ export default defineComponent({
MkInfo,
},
provide: {
shouldOmitHeaderTitle: false,
},
props: {
initialPage: {
type: String,
@ -50,17 +57,19 @@ export default defineComponent({
setup(props, context) {
const indexInfo = {
title: i18n.locale.instance,
title: i18n.locale.controlPanel,
icon: 'fas fa-cog',
bg: 'var(--bg)',
hideHeader: true,
};
const INFO = ref(indexInfo);
const childInfo = ref(null);
const page = ref(props.initialPage);
const narrow = ref(false);
const view = ref(null);
const el = ref(null);
const onInfo = (viewInfo) => {
INFO.value = viewInfo;
childInfo.value = viewInfo;
};
const pageProps = ref({});
@ -315,6 +324,7 @@ export default defineComponent({
view,
el,
onInfo,
childInfo,
pageProps,
component,
invite,

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="edbbcaef" v-size="{ max: [740] }">
<div class="edbbcaef" v-size="{ max: [740] }">
<div v-if="stats" class="cfcdecdf" style="margin: var(--margin)">
<div class="number _panel">
<div class="label">Users</div>
@ -65,7 +62,6 @@
</div>
</div>
</MkFolder>
</div>
</div>
</template>
@ -107,10 +103,6 @@ export default defineComponent({
icon: 'fas fa-tachometer-alt',
bg: 'var(--bg)',
},
header: {
title: this.$ts.dashboard,
icon: 'fas fa-tachometer-alt',
},
version,
vueVersion,
url,

View File

@ -1,7 +1,5 @@
<template>
<div class="lknzcolw">
<MkHeader :info="header"/>
<div class="users">
<div class="inputs">
<MkSelect v-model="sort" style="flex: 1;">
@ -90,11 +88,6 @@ export default defineComponent({
title: this.$ts.users,
icon: 'fas fa-users',
bg: 'var(--bg)',
},
header: {
title: this.$ts.users,
icon: 'fas fa-users',
bg: 'var(--bg)',
actions: [{
icon: 'fas fa-search',
text: this.$ts.search,
@ -109,7 +102,7 @@ export default defineComponent({
icon: 'fas fa-search',
text: this.$ts.lookup,
handler: this.lookupUser
}]
}],
},
sort: '+createdAt',
state: 'all',

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_section">
<div class="_section">
<MkPagination :pagination="pagination" #default="{items}" class="ruryvtyk _content">
<section class="_card announcement _gap" v-for="(announcement, i) in items" :key="announcement.id">
<div class="_title"><span v-if="$i && !announcement.isRead">🆕 </span>{{ announcement.title }}</div>
@ -14,7 +12,6 @@
</div>
</section>
</MkPagination>
</div>
</div>
</template>
@ -38,11 +35,6 @@ export default defineComponent({
icon: 'fas fa-broadcast-tower',
bg: 'var(--bg)',
},
header: {
title: this.$ts.announcements,
icon: 'fas fa-broadcast-tower',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'announcements',
limit: 10,

View File

@ -1,9 +1,6 @@
<template>
<div>
<MkHeader :info="header"/>
<div :class="$style.root">
<div :class="$style.root">
<XCategory v-if="tab === 'category'"/>
</div>
</div>
</template>
@ -25,11 +22,6 @@ export default defineComponent({
icon: 'fas fa-laugh',
bg: 'var(--bg)',
})),
header: computed(() => ({
title: this.$ts.customEmojis,
icon: 'fas fa-laugh',
bg: 'var(--bg)',
})),
tab: 'category',
}
},

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<MkSpacer :content-max="1200">
<div class="lznhrdub">
<div v-if="tab === 'local'">
@ -110,13 +108,7 @@ export default defineComponent({
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.explore,
icon: 'fas fa-hashtag',
bg: 'var(--bg)',
},
tab: 'local',
header: computed(() => ({
[symbols.PAGE_INFO]: computed(() => ({
title: this.$ts.explore,
icon: 'fas fa-hashtag',
bg: 'var(--bg)',
@ -134,6 +126,7 @@ export default defineComponent({
onClick: () => { this.tab = 'search'; },
},]
})),
tab: 'local',
pinnedUsers: { endpoint: 'pinned-users' },
popularUsers: { endpoint: 'users', limit: 10, noPaging: true, params: {
state: 'alive',

View File

@ -1,11 +1,8 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="jmelgwjh">
<div class="jmelgwjh">
<div class="body">
<XNotes class="notes" :pagination="pagination" :detail="true" :prop="'note'" @before="before()" @after="after()"/>
</div>
</div>
</div>
</template>
@ -28,11 +25,6 @@ export default defineComponent({
icon: 'fas fa-star',
bg: 'var(--bg)',
},
header: {
title: this.$ts.favorites,
icon: 'fas fa-star',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'i/favorites',
limit: 10,

View File

@ -1,9 +1,6 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_section">
<div class="_section">
<XNotes class="_content" ref="notes" :pagination="pagination" @before="before" @after="after"/>
</div>
</div>
</template>
@ -25,11 +22,6 @@ export default defineComponent({
icon: 'fas fa-fire-alt',
bg: 'var(--bg)',
},
header: {
title: this.$ts.featured,
icon: 'fas fa-fire-alt',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/featured',
limit: 10,

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="taeiyria">
<div class="taeiyria">
<div class="query">
<MkInput v-model="host" :debounce="true" class="">
<template #prefix><i class="fas fa-search"></i></template>
@ -92,7 +90,6 @@
</MkA>
</div>
</MkPagination>
</div>
</div>
</template>
@ -122,11 +119,6 @@ export default defineComponent({
icon: 'fas fa-globe',
bg: 'var(--bg)',
},
header: {
title: this.$ts.federation,
icon: 'fas fa-globe',
bg: 'var(--bg)',
},
host: '',
state: 'federating',
sort: '+pubSub',

View File

@ -1,9 +1,6 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_section">
<div class="_section">
<XNotes class="_content" :pagination="pagination" @before="before()" @after="after()"/>
</div>
</div>
</template>
@ -25,11 +22,6 @@ export default defineComponent({
icon: 'fas fa-at',
bg: 'var(--bg)',
},
header: {
title: this.$ts.mentions,
icon: 'fas fa-at',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/mentions',
limit: 10,

View File

@ -1,9 +1,6 @@
<template>
<div>
<MkHeader :info="header"/>
<div>
<XNotes :pagination="pagination" @before="before()" @after="after()"/>
</div>
</div>
</template>
@ -25,11 +22,6 @@ export default defineComponent({
icon: 'fas fa-envelope',
bg: 'var(--bg)',
},
header: {
title: this.$ts.directNotes,
icon: 'fas fa-envelope',
bg: 'var(--bg)',
},
pagination: {
endpoint: 'notes/mentions',
limit: 10,

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<MkSpacer :content-max="800">
<MkSpacer :content-max="800">
<div class="yweeujhr" v-size="{ max: [400] }">
<MkButton @click="start" primary class="start"><i class="fas fa-plus"></i> {{ $ts.startMessaging }}</MkButton>
@ -38,8 +35,7 @@
</div>
<MkLoading v-if="fetching"/>
</div>
</MkSpacer>
</div>
</MkSpacer>
</template>
<script lang="ts">
@ -62,11 +58,6 @@ export default defineComponent({
icon: 'fas fa-comments',
bg: 'var(--bg)',
},
header: {
title: this.$ts.messaging,
icon: 'fas fa-comments',
bg: 'var(--bg)',
},
fetching: true,
moreFetching: false,
messages: [],

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="qkcjvfiv">
<div class="qkcjvfiv">
<MkButton @click="create" primary class="add"><i class="fas fa-plus"></i> {{ $ts.createList }}</MkButton>
<MkPagination :pagination="pagination" #default="{items}" class="lists _content" ref="list">
@ -10,7 +8,6 @@
<MkAvatars :user-ids="list.userIds"/>
</MkA>
</MkPagination>
</div>
</div>
</template>
@ -35,15 +32,10 @@ export default defineComponent({
title: this.$ts.manageLists,
icon: 'fas fa-list-ul',
bg: 'var(--bg)',
},
header: {
title: this.$ts.manageLists,
icon: 'fas fa-list-ul',
bg: 'var(--bg)',
action: {
icon: 'fas fa-plus',
handler: this.create
}
},
},
pagination: {
endpoint: 'users/lists/list',

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader v-if="header" :info="header"/>
<div class="mk-list-page">
<div class="mk-list-page">
<transition name="zoom" mode="out-in">
<div v-if="list" class="_section">
<div class="_content">
@ -31,7 +29,6 @@
</div>
</div>
</transition>
</div>
</div>
</template>
@ -53,10 +50,6 @@ export default defineComponent({
title: this.list.name,
icon: 'fas fa-list-ul',
} : null),
header: computed(() => this.list ? {
title: this.list.name,
icon: 'fas fa-list-ul',
} : null),
list: null,
users: [],
};

View File

@ -1,12 +1,9 @@
<template>
<div>
<MkHeader :info="header"/>
<MkSpacer :content-max="800">
<MkSpacer :content-max="800">
<div class="clupoqwt">
<XNotifications class="notifications" @before="before" @after="after" :include-types="includeTypes" :unread-only="tab === 'unread'"/>
</div>
</MkSpacer>
</div>
</MkSpacer>
</template>
<script lang="ts">
@ -24,14 +21,7 @@ export default defineComponent({
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.notifications,
icon: 'fas fa-bell',
bg: 'var(--bg)',
},
tab: 'all',
includeTypes: null,
header: computed(() => ({
[symbols.PAGE_INFO]: computed(() => ({
title: this.$ts.notifications,
icon: 'fas fa-bell',
bg: 'var(--bg)',
@ -57,6 +47,8 @@ export default defineComponent({
onClick: () => { this.tab = 'unread'; },
},]
})),
tab: 'all',
includeTypes: null,
};
},

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_root">
<div class="jqqmcavi" style="margin: 16px;">
<MkButton v-if="pageId" class="button" inline link :to="`/@${ author.username }/pages/${ currentName }`"><i class="fas fa-external-link-square-alt"></i> {{ $ts._pages.viewPage }}</MkButton>
<MkButton inline @click="save" primary class="button" v-if="!readonly"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
@ -78,7 +75,6 @@
<MkTextarea class="_code" v-model="script"/>
</div>
</div>
</div>
</div>
</template>
@ -131,21 +127,6 @@ export default defineComponent({
data() {
return {
[symbols.PAGE_INFO]: computed(() => {
let title = this.$ts._pages.newPage;
if (this.initPageId) {
title = this.$ts._pages.editPage;
}
else if (this.initPageName && this.initUser) {
title = this.$ts._pages.readPage;
}
return {
title: title,
icon: 'fas fa-pencil-alt',
bg: 'var(--bg)',
};
}),
tab: 'settings',
header: computed(() => {
let title = this.$ts._pages.newPage;
if (this.initPageId) {
title = this.$ts._pages.editPage;
@ -177,9 +158,10 @@ export default defineComponent({
title: this.$ts.script,
icon: 'fas fa-code',
onClick: () => { this.tab = 'script'; },
}]
}],
};
}),
tab: 'settings',
author: this.$i,
readonly: false,
page: null,

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_root">
<transition name="fade" mode="out-in">
<div v-if="page" class="xcukqgmh" :key="page.id" v-size="{ max: [450] }">
<div class="_block main">
@ -59,7 +56,6 @@
<MkError v-else-if="error" @retry="fetch()"/>
<MkLoading v-else/>
</transition>
</div>
</div>
</template>
@ -101,10 +97,6 @@ export default defineComponent({
[symbols.PAGE_INFO]: computed(() => this.page ? {
title: computed(() => this.page.title || this.page.name),
avatar: this.page.user,
} : null),
header: computed(() => this.page ? {
title: computed(() => this.page.title || this.page.name),
avatar: this.page.user,
path: `/@${this.page.user.username}/pages/${this.page.name}`,
share: {
title: this.page.title || this.page.name,

View File

@ -1,8 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<MkSpacer>
<MkSpacer>
<!-- TODO: MkHeaderに統合 -->
<MkTab v-model="tab" v-if="$i">
<option value="featured"><i class="fas fa-fire-alt"></i> {{ $ts._pages.featured }}</option>
@ -30,8 +27,7 @@
</MkPagination>
</div>
</div>
</MkSpacer>
</div>
</MkSpacer>
</template>
<script lang="ts">
@ -52,11 +48,6 @@ export default defineComponent({
title: this.$ts.pages,
icon: 'fas fa-sticky-note',
bg: 'var(--bg)',
},
header: {
title: this.$ts.pages,
icon: 'fas fa-sticky-note',
bg: 'var(--bg)',
actions: [{
icon: 'fas fa-plus',
text: this.$ts.create,

View File

@ -1,11 +1,8 @@
<template>
<div>
<MkHeader :info="header"/>
<div class="_section">
<div class="_section">
<div class="_content">
<XNotes ref="notes" :pagination="pagination" @before="before" @after="after"/>
</div>
</div>
</div>
</template>
@ -26,10 +23,6 @@ export default defineComponent({
title: computed(() => this.$t('searchWith', { q: this.$route.query.q })),
icon: 'fas fa-search',
},
header: {
title: computed(() => this.$t('searchWith', { q: this.$route.query.q })),
icon: 'fas fa-search',
},
pagination: {
endpoint: 'notes/search',
limit: 10,

View File

@ -41,6 +41,7 @@ export default defineComponent({
title: i18n.locale.settings,
icon: 'fas fa-cog',
bg: 'var(--bg)',
hideHeader: true,
};
const INFO = ref(indexInfo);
const page = ref(props.initialPage);

View File

@ -1,7 +1,5 @@
<template>
<div v-hotkey.global="keymap">
<MkHeader :info="header"/>
<div class="cmuxhskf" v-size="{ min: [800] }">
<div class="cmuxhskf" v-size="{ min: [800] }" v-hotkey.global="keymap">
<XTutorial v-if="$store.reactiveState.tutorial.value != -1" class="tutorial _block"/>
<XPostForm v-if="$store.reactiveState.showFixedPostForm.value" class="post-form _block" fixed/>
@ -16,7 +14,6 @@
@queue="queueUpdated"
/>
</div>
</div>
</div>
</template>
@ -46,11 +43,6 @@ export default defineComponent({
title: this.$ts.timeline,
icon: this.src === 'local' ? 'fas fa-comments' : this.src === 'social' ? 'fas fa-share-alt' : this.src === 'global' ? 'fas fa-globe' : 'fas fa-home',
bg: 'var(--bg)',
})),
header: computed(() => ({
title: this.$ts.timeline,
icon: this.src === 'local' ? 'fas fa-comments' : this.src === 'social' ? 'fas fa-share-alt' : this.src === 'global' ? 'fas fa-globe' : 'fas fa-home',
bg: 'var(--bg)',
actions: [{
icon: 'fas fa-list-ul',
text: this.$ts.lists,
@ -92,7 +84,7 @@ export default defineComponent({
icon: 'fas fa-globe',
iconOnly: true,
onClick: () => { this.src = 'global'; this.saveSrc(); },
}]
}],
})),
};
},

View File

@ -1,7 +1,5 @@
<template>
<div>
<MkHeader :info="header"/>
<transition name="fade" mode="out-in">
<transition name="fade" mode="out-in">
<div class="ftskorzw wide" v-if="user && narrow === false">
<MkRemoteCaution v-if="user.host != null" :href="user.url"/>
@ -191,8 +189,7 @@
</MkSpacer>
<MkError v-else-if="error" @retry="fetch()"/>
<MkLoading v-else/>
</transition>
</div>
</transition>
</template>
<script lang="ts">
@ -250,14 +247,6 @@ export default defineComponent({
return {
[symbols.PAGE_INFO]: computed(() => this.user ? {
icon: 'fas fa-user',
title: this.user.name ? `${this.user.name} (@${this.user.username})` : `@${this.user.username}`,
path: `/@${this.user.username}`,
share: {
title: this.user.name,
},
bg: 'var(--bg)',
} : null),
header: computed(() => this.user ? {
title: this.user.name ? `${this.user.name} (@${this.user.username})` : `@${this.user.username}`,
subtitle: `@${getAcct(this.user)}`,
userName: this.user,
@ -292,7 +281,7 @@ export default defineComponent({
title: this.$ts.gallery,
icon: 'fas fa-icons',
onClick: () => { this.$router.push('/@' + getAcct(this.user) + '/gallery'); },
}]
}],
} : null),
user: null,
error: null,

View File

@ -7,6 +7,8 @@
</template>
</template>
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<router-view v-slot="{ Component }">
<transition>
<keep-alive :include="['timeline']">
@ -14,6 +16,7 @@
</keep-alive>
</transition>
</router-view>
</MkStickyContainer>
</XColumn>
</template>

View File

@ -14,6 +14,8 @@
<main class="main" @contextmenu.stop="onContextmenu" :style="{ background: pageInfo?.bg }">
<div class="content">
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<router-view v-slot="{ Component }">
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
<keep-alive :include="['timeline']">
@ -21,6 +23,7 @@
</keep-alive>
</transition>
</router-view>
</MkStickyContainer>
</div>
</main>

View File

@ -5,6 +5,8 @@
<div class="contents" ref="contents" @contextmenu.stop="onContextmenu" :style="{ background: pageInfo?.bg }">
<main ref="main">
<div class="content">
<MkStickyContainer>
<template #header><MkHeader v-if="pageInfo && !pageInfo.hideHeader" :info="pageInfo"/></template>
<router-view v-slot="{ Component }">
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
<keep-alive :include="['timeline']">
@ -12,6 +14,7 @@
</keep-alive>
</transition>
</router-view>
</MkStickyContainer>
</div>
<div class="spacer"></div>
</main>