♻️ 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">
|
||||
<MkAvatar :class="$style.titleAvatar" :user="pageMetadata.avatar" indicator/>
|
||||
</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">
|
||||
<MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/>
|
||||
|
|
|
@ -317,10 +317,10 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
|
|||
icon: 'ti ti-star',
|
||||
iconOnly: true,
|
||||
}))), ...availableBasicTimelines().map(tl => ({
|
||||
key: tl,
|
||||
title: i18n.ts._timelines[tl],
|
||||
icon: basicTimelineIconClass(tl),
|
||||
iconOnly: true,
|
||||
key: tl,
|
||||
title: tl === 'social' ? i18n.ts._timelines["home"] : i18n.ts._timelines[tl],
|
||||
icon: basicTimelineIconClass(tl),
|
||||
iconOnly: true,
|
||||
})), {
|
||||
icon: 'ph-user-check ph-bold ph-lg',
|
||||
title: i18n.ts.following,
|
||||
|
@ -331,17 +331,7 @@ const headerTabs = computed(() => [...(defaultStore.reactiveState.pinnedUserList
|
|||
title: i18n.ts.lists,
|
||||
iconOnly: true,
|
||||
onClick: chooseList,
|
||||
}, {
|
||||
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[]);
|
||||
}, ] as Tab[]);
|
||||
|
||||
const headerTabsWhenNotLogin = computed(() => [...availableBasicTimelines().map(tl => ({
|
||||
key: tl,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,50 +3,63 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { $i } from '@/account.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { $i } from "@/account.js";
|
||||
import { instance } from "@/instance.js";
|
||||
|
||||
export const basicTimelineTypes = [
|
||||
'home',
|
||||
'local',
|
||||
'social',
|
||||
'bubble',
|
||||
'global',
|
||||
"social",
|
||||
// "home",
|
||||
"local",
|
||||
// "bubble",
|
||||
"global",
|
||||
] 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);
|
||||
}
|
||||
|
||||
export function basicTimelineIconClass(timeline: BasicTimelineType): string {
|
||||
switch (timeline) {
|
||||
case 'home':
|
||||
return 'ti ti-home';
|
||||
case 'local':
|
||||
return 'ti ti-planet';
|
||||
case 'social':
|
||||
return 'ti ti-universe';
|
||||
case 'bubble':
|
||||
return 'ph-drop ph-bold ph-lg';
|
||||
case 'global':
|
||||
return 'ti ti-whirl';
|
||||
case "social":
|
||||
return "ti ti-home";
|
||||
case "local":
|
||||
return "ti ti-planet";
|
||||
// case "social":
|
||||
// return "ti ti-universe";
|
||||
// case "bubble":
|
||||
// return "ph-drop ph-bold ph-lg";
|
||||
case "global":
|
||||
return "ti ti-whirl";
|
||||
}
|
||||
}
|
||||
|
||||
export function isAvailableBasicTimeline(timeline: BasicTimelineType | undefined | null): boolean {
|
||||
export function isAvailableBasicTimeline(
|
||||
timeline: BasicTimelineType | undefined | null,
|
||||
): boolean {
|
||||
switch (timeline) {
|
||||
case 'home':
|
||||
return $i != null;
|
||||
case 'local':
|
||||
return ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable);
|
||||
case 'social':
|
||||
// case "home":
|
||||
// return $i != null;
|
||||
case "social":
|
||||
return $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);
|
||||
case "local":
|
||||
return (
|
||||
($i == null && instance.policies.ltlAvailable) ||
|
||||
($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:
|
||||
return false;
|
||||
}
|
||||
|
@ -56,6 +69,8 @@ export function availableBasicTimelines(): BasicTimelineType[] {
|
|||
return basicTimelineTypes.filter(isAvailableBasicTimeline);
|
||||
}
|
||||
|
||||
export function hasWithReplies(timeline: BasicTimelineType | undefined | null): boolean {
|
||||
return timeline === 'local' || timeline === 'social';
|
||||
export function hasWithReplies(
|
||||
timeline: BasicTimelineType | undefined | null,
|
||||
): boolean {
|
||||
return timeline === "local" || timeline === "social";
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue