mirror of
https://github.com/elk-zone/elk.git
synced 2024-09-06 12:19:08 +01:00
feat: improve explore loading
This commit is contained in:
parent
4d8b402b04
commit
84ea17e0cf
3 changed files with 24 additions and 20 deletions
2
app.vue
2
app.vue
|
@ -13,7 +13,7 @@ const { params } = useRoute()
|
||||||
<NuxtLoadingIndicator color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
|
<NuxtLoadingIndicator color="repeating-linear-gradient(to right,var(--c-primary) 0%,var(--c-primary-active) 100%)" />
|
||||||
<NuxtLayout :key="key">
|
<NuxtLayout :key="key">
|
||||||
<!-- TODO: rework the /[account] routes to remove conditional loading -->
|
<!-- TODO: rework the /[account] routes to remove conditional loading -->
|
||||||
<NuxtPage v-if="!params.server || isMastoInitialised" />
|
<NuxtPage v-if="!params.account || isMastoInitialised" />
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
<PWAPrompt />
|
<PWAPrompt />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -5,6 +5,7 @@ const { options, command, replace, preventScrollTop = false } = $defineProps<{
|
||||||
options: {
|
options: {
|
||||||
to: RouteLocationRaw
|
to: RouteLocationRaw
|
||||||
display: string
|
display: string
|
||||||
|
disabled?: boolean
|
||||||
name?: string
|
name?: string
|
||||||
icon?: string
|
icon?: string
|
||||||
}[]
|
}[]
|
||||||
|
@ -28,18 +29,25 @@ useCommands(() => command
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div flex w-full items-center lg:text-lg of-x-auto scrollbar-hide>
|
<div flex w-full items-center lg:text-lg of-x-auto scrollbar-hide>
|
||||||
<NuxtLink
|
<template
|
||||||
v-for="(option, index) in options"
|
v-for="(option, index) in options"
|
||||||
:key="option?.name || index"
|
:key="option?.name || index"
|
||||||
|
>
|
||||||
|
<NuxtLink
|
||||||
|
v-if="!option.disabled"
|
||||||
:to="option.to"
|
:to="option.to"
|
||||||
:replace="replace"
|
:replace="replace"
|
||||||
relative flex flex-auto cursor-pointer sm:px6 px2 rounded transition-all
|
relative flex flex-auto cursor-pointer sm:px6 px2 rounded transition-all
|
||||||
tabindex="1"
|
tabindex="1"
|
||||||
hover:bg-active transition-100
|
hover:bg-active transition-100
|
||||||
exact-active-class="children:(font-bold !border-primary !op100)"
|
exact-active-class="children:(text-secondary !border-primary !op100)"
|
||||||
@click="!preventScrollTop && $scrollToTop()"
|
@click="!preventScrollTop && $scrollToTop()"
|
||||||
>
|
>
|
||||||
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center border-b-3 op50 hover:op70 border-transparent>{{ option.display }}</span>
|
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center border-b-3 text-secondary-light hover:text-secondary border-transparent>{{ option.display }}</span>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
<div v-else flex flex-auto sm:px6 px2>
|
||||||
|
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center text-secondary-light op50>{{ option.display }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -17,15 +17,11 @@ const tabs = $computed(() => [
|
||||||
display: t('tab.news'),
|
display: t('tab.news'),
|
||||||
},
|
},
|
||||||
// This section can only be accessed after logging in
|
// This section can only be accessed after logging in
|
||||||
...invoke(() => currentUser.value
|
|
||||||
? [
|
|
||||||
{
|
{
|
||||||
to: `/${currentServer.value}/explore/users`,
|
to: `/${currentServer.value}/explore/users`,
|
||||||
display: t('tab.for_you'),
|
display: t('tab.for_you'),
|
||||||
|
disabled: !isMastoInitialised.value || !currentUser.value,
|
||||||
},
|
},
|
||||||
]
|
|
||||||
: [],
|
|
||||||
),
|
|
||||||
] as const)
|
] as const)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue