2022-11-25 08:13:35 +00:00
|
|
|
<script setup lang="ts">
|
2022-12-04 14:17:02 +00:00
|
|
|
// only one icon can be lit up at the same time
|
2024-03-07 14:33:25 +00:00
|
|
|
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
2024-03-06 22:00:07 +00:00
|
|
|
|
2022-12-04 14:17:02 +00:00
|
|
|
const moreMenuVisible = ref(false)
|
2023-02-12 14:39:05 +00:00
|
|
|
|
|
|
|
const { notifications } = useNotifications()
|
2024-03-06 22:00:07 +00:00
|
|
|
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
2024-03-07 14:33:25 +00:00
|
|
|
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
|
2022-11-25 08:13:35 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-12-04 14:17:02 +00:00
|
|
|
<nav
|
|
|
|
h-14 border="t base" flex flex-row text-xl
|
2022-12-05 13:20:23 +00:00
|
|
|
of-y-scroll scrollbar-hide overscroll-none
|
|
|
|
class="after-content-empty after:(h-[calc(100%+0.5px)] w-0.1px pointer-events-none)"
|
2022-12-04 14:17:02 +00:00
|
|
|
>
|
|
|
|
<!-- These weird styles above are used for scroll locking, don't change it unless you know exactly what you're doing. -->
|
2023-01-15 08:38:02 +00:00
|
|
|
<template v-if="currentUser">
|
2023-03-08 13:07:02 +00:00
|
|
|
<NuxtLink to="/home" :aria-label="$t('nav.home')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2022-11-25 08:13:35 +00:00
|
|
|
<div i-ri:home-5-line />
|
|
|
|
</NuxtLink>
|
2023-05-07 15:41:18 +00:00
|
|
|
<NuxtLink to="/search" :aria-label="$t('nav.search')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2022-12-27 21:41:44 +00:00
|
|
|
<div i-ri:search-line />
|
|
|
|
</NuxtLink>
|
2024-03-06 22:00:07 +00:00
|
|
|
<NuxtLink :to="`/notifications/${lastAccessedNotificationRoute}`" :aria-label="$t('nav.notifications')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2023-02-12 14:39:05 +00:00
|
|
|
<div flex relative>
|
|
|
|
<div class="i-ri:notification-4-line" text-xl />
|
|
|
|
<div v-if="notifications" class="top-[-0.3rem] right-[-0.3rem]" absolute font-bold rounded-full h-4 w-4 text-xs bg-primary text-inverted flex items-center justify-center>
|
|
|
|
{{ notifications < 10 ? notifications : '•' }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-11-25 08:13:35 +00:00
|
|
|
</NuxtLink>
|
2023-03-08 13:07:02 +00:00
|
|
|
<NuxtLink to="/conversations" :aria-label="$t('nav.conversations')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2022-12-27 21:41:44 +00:00
|
|
|
<div i-ri:at-line />
|
|
|
|
</NuxtLink>
|
2022-11-25 08:13:35 +00:00
|
|
|
</template>
|
2023-01-15 08:38:02 +00:00
|
|
|
<template v-else>
|
2024-03-07 14:33:25 +00:00
|
|
|
<NuxtLink :to="`/${currentServer}/explore/${lastAccessedExploreRoute}`" :aria-label="$t('nav.explore')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2024-03-05 10:27:10 +00:00
|
|
|
<div i-ri:compass-3-line />
|
2022-12-27 21:41:44 +00:00
|
|
|
</NuxtLink>
|
2023-03-08 13:07:02 +00:00
|
|
|
<NuxtLink group :to="`/${currentServer}/public/local`" :aria-label="$t('nav.local')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2022-12-27 21:41:44 +00:00
|
|
|
<div i-ri:group-2-line />
|
|
|
|
</NuxtLink>
|
2023-03-08 13:07:02 +00:00
|
|
|
<NuxtLink :to="`/${currentServer}/public`" :aria-label="$t('nav.federated')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
|
2022-12-04 14:17:02 +00:00
|
|
|
<div i-ri:earth-line />
|
|
|
|
</NuxtLink>
|
|
|
|
</template>
|
2023-01-06 15:46:36 +00:00
|
|
|
<NavBottomMoreMenu v-slot="{ toggleVisible, show }" v-model="moreMenuVisible" flex flex-row items-center place-content-center h-full flex-1 cursor-pointer>
|
2023-07-21 10:17:32 +00:00
|
|
|
<button
|
2022-12-07 00:05:17 +00:00
|
|
|
flex items-center place-content-center h-full flex-1 class="select-none"
|
2022-12-04 14:17:02 +00:00
|
|
|
:class="show ? '!text-primary' : ''"
|
2023-07-21 10:17:32 +00:00
|
|
|
aria-label="More menu"
|
|
|
|
@click="toggleVisible"
|
2022-12-04 14:17:02 +00:00
|
|
|
>
|
2023-07-21 10:17:32 +00:00
|
|
|
<span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" />
|
|
|
|
</button>
|
2022-12-04 14:17:02 +00:00
|
|
|
</NavBottomMoreMenu>
|
2022-11-25 08:13:35 +00:00
|
|
|
</nav>
|
|
|
|
</template>
|