♻️ Merge branch 'feature/remove-timelines'
This commit is contained in:
commit
c6a5fbb882
4 changed files with 631 additions and 598 deletions
|
@ -25,7 +25,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div v-if="pageMetadata.avatar" :class="$style.titleAvatarContainer">
|
<div v-if="pageMetadata.avatar" :class="$style.titleAvatarContainer">
|
||||||
<MkAvatar :class="$style.titleAvatar" :user="pageMetadata.avatar" indicator/>
|
<MkAvatar :class="$style.titleAvatar" :user="pageMetadata.avatar" indicator/>
|
||||||
</div>
|
</div>
|
||||||
<i v-else-if="pageMetadata.icon" :class="[$style.titleIcon, pageMetadata.icon]"></i>
|
<i v-else-if="pageMetadata.icon" class="icon ph-house ph-lg ph-lg ph-bold"></i>
|
||||||
|
|
||||||
<div :class="$style.title">
|
<div :class="$style.title">
|
||||||
<MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/>
|
<MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/>
|
||||||
|
|
|
@ -317,10 +317,10 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
|
||||||
icon: 'ti ti-star',
|
icon: 'ti ti-star',
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
}))), ...availableBasicTimelines().map(tl => ({
|
}))), ...availableBasicTimelines().map(tl => ({
|
||||||
key: tl,
|
key: tl,
|
||||||
title: i18n.ts._timelines[tl],
|
title: tl === 'social' ? i18n.ts._timelines["home"] : i18n.ts._timelines[tl],
|
||||||
icon: basicTimelineIconClass(tl),
|
icon: basicTimelineIconClass(tl),
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
})), {
|
})), {
|
||||||
icon: 'ph-user-check ph-bold ph-lg',
|
icon: 'ph-user-check ph-bold ph-lg',
|
||||||
title: i18n.ts.following,
|
title: i18n.ts.following,
|
||||||
|
@ -331,17 +331,7 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
|
||||||
title: i18n.ts.lists,
|
title: i18n.ts.lists,
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
onClick: chooseList,
|
onClick: chooseList,
|
||||||
}, {
|
}, ] as Tab[]);
|
||||||
icon: 'ti ti-antenna',
|
|
||||||
title: i18n.ts.antennas,
|
|
||||||
iconOnly: true,
|
|
||||||
onClick: chooseAntenna,
|
|
||||||
}, {
|
|
||||||
icon: 'ti ti-device-tv',
|
|
||||||
title: i18n.ts.channel,
|
|
||||||
iconOnly: true,
|
|
||||||
onClick: chooseChannel,
|
|
||||||
}] as Tab[]);
|
|
||||||
|
|
||||||
const headerTabsWhenNotLogin = computed(() => [...availableBasicTimelines().map(tl => ({
|
const headerTabsWhenNotLogin = computed(() => [...availableBasicTimelines().map(tl => ({
|
||||||
key: tl,
|
key: tl,
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,50 +3,63 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { $i } from '@/account.js';
|
import { $i } from "@/account.js";
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from "@/instance.js";
|
||||||
|
|
||||||
export const basicTimelineTypes = [
|
export const basicTimelineTypes = [
|
||||||
'home',
|
"social",
|
||||||
'local',
|
// "home",
|
||||||
'social',
|
"local",
|
||||||
'bubble',
|
// "bubble",
|
||||||
'global',
|
"global",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type BasicTimelineType = typeof basicTimelineTypes[number];
|
export type BasicTimelineType = (typeof basicTimelineTypes)[number];
|
||||||
|
|
||||||
export function isBasicTimeline(timeline: string): timeline is BasicTimelineType {
|
export function isBasicTimeline(
|
||||||
|
timeline: string,
|
||||||
|
): timeline is BasicTimelineType {
|
||||||
return basicTimelineTypes.includes(timeline as BasicTimelineType);
|
return basicTimelineTypes.includes(timeline as BasicTimelineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function basicTimelineIconClass(timeline: BasicTimelineType): string {
|
export function basicTimelineIconClass(timeline: BasicTimelineType): string {
|
||||||
switch (timeline) {
|
switch (timeline) {
|
||||||
case 'home':
|
case "social":
|
||||||
return 'ti ti-home';
|
return "ti ti-home";
|
||||||
case 'local':
|
case "local":
|
||||||
return 'ti ti-planet';
|
return "ti ti-planet";
|
||||||
case 'social':
|
// case "social":
|
||||||
return 'ti ti-universe';
|
// return "ti ti-universe";
|
||||||
case 'bubble':
|
// case "bubble":
|
||||||
return 'ph-drop ph-bold ph-lg';
|
// return "ph-drop ph-bold ph-lg";
|
||||||
case 'global':
|
case "global":
|
||||||
return 'ti ti-whirl';
|
return "ti ti-whirl";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAvailableBasicTimeline(timeline: BasicTimelineType | undefined | null): boolean {
|
export function isAvailableBasicTimeline(
|
||||||
|
timeline: BasicTimelineType | undefined | null,
|
||||||
|
): boolean {
|
||||||
switch (timeline) {
|
switch (timeline) {
|
||||||
case 'home':
|
// case "home":
|
||||||
return $i != null;
|
// return $i != null;
|
||||||
case 'local':
|
case "social":
|
||||||
return ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable);
|
|
||||||
case 'social':
|
|
||||||
return $i != null && $i.policies.ltlAvailable;
|
return $i != null && $i.policies.ltlAvailable;
|
||||||
case 'bubble':
|
case "local":
|
||||||
return ($i == null && instance.policies.btlAvailable) || ($i != null && $i.policies.btlAvailable);
|
return (
|
||||||
case 'global':
|
($i == null && instance.policies.ltlAvailable) ||
|
||||||
return ($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable);
|
($i != null && $i.policies.ltlAvailable)
|
||||||
|
);
|
||||||
|
// case "bubble":
|
||||||
|
// return (
|
||||||
|
// ($i == null && instance.policies.btlAvailable) ||
|
||||||
|
// ($i != null && $i.policies.btlAvailable)
|
||||||
|
// );
|
||||||
|
case "global":
|
||||||
|
return (
|
||||||
|
($i == null && instance.policies.gtlAvailable) ||
|
||||||
|
($i != null && $i.policies.gtlAvailable)
|
||||||
|
);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +69,8 @@ export function availableBasicTimelines(): BasicTimelineType[] {
|
||||||
return basicTimelineTypes.filter(isAvailableBasicTimeline);
|
return basicTimelineTypes.filter(isAvailableBasicTimeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hasWithReplies(timeline: BasicTimelineType | undefined | null): boolean {
|
export function hasWithReplies(
|
||||||
return timeline === 'local' || timeline === 'social';
|
timeline: BasicTimelineType | undefined | null,
|
||||||
|
): boolean {
|
||||||
|
return timeline === "local" || timeline === "social";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue