Compare commits

...

9 commits

Author SHA1 Message Date
Michel EDIGHOFFER
6381bcfb4a feat: put search field on right for desktop 2023-01-18 12:48:57 +01:00
Michel EDIGHOFFER
e343b0a61a Merge remote-tracking branch 'origin/main' into feat/explore-as-search 2023-01-18 12:15:47 +01:00
Michel EDIGHOFFER
4832124659 Merge remote-tracking branch 'origin/main' into feat/explore-as-search 2023-01-17 23:09:56 +01:00
Michel EDIGHOFFER
4ee298d563 fix: show back button on correct viewport 2023-01-17 22:48:53 +01:00
Michel EDIGHOFFER
868c5f5d2b fix: full width + add no overflow hidden option 2023-01-17 22:40:21 +01:00
Michel EDIGHOFFER
72dc3617dd fix: mobile search 2023-01-17 22:39:57 +01:00
Michel EDIGHOFFER
4d30e80751 feat: optimize side nav 2023-01-17 21:36:05 +01:00
Michel EDIGHOFFER
07ea1a8152 feat: use search and explore in same nav item 2023-01-17 21:30:06 +01:00
Michel EDIGHOFFER
2bdbb4fdf4 fix: align all on the same vertical line 2023-01-17 20:21:00 +01:00
11 changed files with 23 additions and 43 deletions

View file

@ -4,6 +4,7 @@ defineProps<{
backOnSmallScreen?: boolean backOnSmallScreen?: boolean
/** Show the back button on both small and big screens */ /** Show the back button on both small and big screens */
back?: boolean back?: boolean
noOverflowHidden?: boolean
}>() }>()
</script> </script>
@ -15,7 +16,7 @@ defineProps<{
border="b base" bg="[rgba(var(--rbg-bg-base),0.7)]" border="b base" bg="[rgba(var(--rbg-bg-base),0.7)]"
> >
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" data-tauri-drag-region> <div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" data-tauri-drag-region>
<div flex gap-3 items-center overflow-hidden py2> <div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
<NuxtLink <NuxtLink
v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden
:aria-label="$t('nav.back')" :aria-label="$t('nav.back')"
@ -23,7 +24,7 @@ defineProps<{
> >
<div i-ri:arrow-left-line class="rtl-flip" /> <div i-ri:arrow-left-line class="rtl-flip" />
</NuxtLink> </NuxtLink>
<div truncate> <div :truncate="!noOverflowHidden ? '' : false" w-full>
<slot name="title" /> <slot name="title" />
</div> </div>
<div h-7 w-1px /> <div h-7 w-1px />

View file

@ -14,7 +14,7 @@ const moreMenuVisible = ref(false)
<NuxtLink to="/home" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop"> <NuxtLink to="/home" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop">
<div i-ri:home-5-line /> <div i-ri:home-5-line />
</NuxtLink> </NuxtLink>
<NuxtLink to="/search" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop"> <NuxtLink :to="isHydrated ? `/${currentServer}/explore` : '/explore'" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop">
<div i-ri:search-line /> <div i-ri:search-line />
</NuxtLink> </NuxtLink>
<NuxtLink to="/notifications" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop"> <NuxtLink to="/notifications" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 @click="$scrollToTop">

View file

@ -2,15 +2,12 @@
const { command } = defineProps<{ const { command } = defineProps<{
command?: boolean command?: boolean
}>() }>()
const { notifications } = useNotifications() const { notifications } = useNotifications()
</script> </script>
<template> <template>
<nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg> <nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg h-full>
<div shrink hidden sm:block mt-4 />
<SearchWidget lg:ms-1 lg:me-5 hidden xl:block />
<NavSideItem :text="$t('nav.search')" to="/search" icon="i-ri:search-line" xl:hidden :command="command" />
<div shrink hidden sm:block mt-4 /> <div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('nav.home')" to="/home" icon="i-ri:home-5-line" user-only :command="command" /> <NavSideItem :text="$t('nav.home')" to="/home" icon="i-ri:home-5-line" user-only :command="command" />
<NavSideItem :text="$t('nav.notifications')" to="/notifications" icon="i-ri:notification-4-line" user-only :command="command"> <NavSideItem :text="$t('nav.notifications')" to="/notifications" icon="i-ri:notification-4-line" user-only :command="command">

View file

@ -14,7 +14,7 @@ router.afterEach(() => {
<!-- Use external to force refresh page and jump to top of timeline --> <!-- Use external to force refresh page and jump to top of timeline -->
<div flex justify-between> <div flex justify-between>
<NuxtLink <NuxtLink
flex items-end gap-4 flex items-end gap-3
py2 px-5 py2 px-5
text-2xl text-2xl
select-none select-none

View file

@ -1,10 +1,15 @@
<script setup lang="ts"> <script setup lang="ts">
const { position } = defineProps<{
position?: 'top' | 'bottom'
}>()
const query = ref('') const query = ref('')
const { accounts, hashtags, loading, statuses } = useSearch(query) const { accounts, hashtags, loading, statuses } = useSearch(query)
const index = ref(0) const index = ref(0)
const { t } = useI18n() const { t } = useI18n()
const el = ref<HTMLElement>() const el = ref<HTMLElement>()
const input = ref<HTMLInputElement>()
const router = useRouter() const router = useRouter()
const { focused } = useFocusWithin(el) const { focused } = useFocusWithin(el)
@ -75,7 +80,7 @@ const activate = () => {
> >
</div> </div>
<!-- Results --> <!-- Results -->
<div left-0 top-12 absolute w-full z10 group-focus-within="pointer-events-auto visible" invisible pointer-events-none> <div top-12 left-0 absolute w-full z10 group-focus-within="pointer-events-auto visible" invisible pointer-events-none>
<div w-full bg-base border="~ base" rounded-3 max-h-100 overflow-auto py2> <div w-full bg-base border="~ base" rounded-3 max-h-100 overflow-auto py2>
<span v-if="query.trim().length === 0" block text-center text-sm text-secondary> <span v-if="query.trim().length === 0" block text-center text-sm text-secondary>
{{ t('search.search_desc') }} {{ t('search.search_desc') }}

View file

@ -4,3 +4,4 @@ export const breakpoints = useBreakpoints(breakpointsTailwind)
export const isSmallScreen = breakpoints.smallerOrEqual('md') export const isSmallScreen = breakpoints.smallerOrEqual('md')
export const isMediumScreen = breakpoints.smallerOrEqual('lg') export const isMediumScreen = breakpoints.smallerOrEqual('lg')
export const isExtraLargeScreen = breakpoints.smallerOrEqual('xl')

View file

@ -17,14 +17,13 @@ const isGrayscale = usePreferences('grayscaleMode')
<template> <template>
<div h-full :data-mode="isHydrated && isGrayscale ? 'grayscale' : ''"> <div h-full :data-mode="isHydrated && isGrayscale ? 'grayscale' : ''">
<main flex w-full mxa lg:max-w-80rem> <main flex w-full mxa lg:max-w-80rem>
<aside class="hidden sm:flex w-1/8 md:w-1/6 lg:w-1/5 xl:w-1/4 justify-end xl:me-4 zen-hide" relative> <aside class="justify-end hidden sm:flex w-1/8 md:w-1/6 lg:w-1/5 xl:w-1/4 xl:me-4 zen-hide" relative>
<div sticky top-0 w-20 xl:w-100 h-screen flex="~ col" lt-xl-items-center> <div sticky top-0 w-20 xl:w-100 h-screen flex="~ col" lt-xl-items-center>
<slot name="left"> <slot name="left">
<div flex="~ col" overflow-y-auto justify-between h-full max-w-full mt-5> <div flex="~ col" overflow-y-auto justify-between h-full max-w-full mt-5>
<NavTitle /> <NavTitle />
<NavSide command /> <NavSide command />
<div flex-auto /> <div v-if="isHydrated" flex flex-col sticky bottom-0 bg-base>
<div v-if="isHydrated" flex flex-col>
<div hidden xl:block> <div hidden xl:block>
<UserSignInEntry v-if="!currentUser" /> <UserSignInEntry v-if="!currentUser" />
</div> </div>
@ -59,9 +58,10 @@ const isGrayscale = usePreferences('grayscaleMode')
<NavBottom v-if="isHydrated" sm:hidden /> <NavBottom v-if="isHydrated" sm:hidden />
</div> </div>
</div> </div>
<aside v-if="isHydrated && !wideLayout" class="hidden sm:none lg:block w-1/4 zen-hide"> <aside v-if="isHydrated && !wideLayout" class="hidden w-1/4 sm:none lg:block zen-hide">
<div sticky top-0 h-screen flex="~ col" gap-2 py3 ms-2> <div sticky top-0 h-screen flex="~ col" gap-2 py3 ms-2>
<slot name="right"> <slot name="right">
<SearchWidget v-if="!isExtraLargeScreen" mt-6 ms-2 position="top" />
<div flex-auto /> <div flex-auto />
<PwaPrompt /> <PwaPrompt />
<NavFooter /> <NavFooter />

View file

@ -91,6 +91,7 @@
"toggle_zen_mode": "Toggle zen mode" "toggle_zen_mode": "Toggle zen mode"
}, },
"common": { "common": {
"and": "and",
"end_of_list": "End of the list", "end_of_list": "End of the list",
"error": "ERROR", "error": "ERROR",
"in": "in", "in": "in",

View file

@ -83,6 +83,7 @@
"toggle_zen_mode": "Passer en mode zen" "toggle_zen_mode": "Passer en mode zen"
}, },
"common": { "common": {
"and": "et",
"end_of_list": "Fin de liste", "end_of_list": "Fin de liste",
"error": "ERREUR", "error": "ERREUR",
"in": "sur", "in": "sur",
@ -173,7 +174,7 @@
"muted_users": "Utilisateur·ice·s masqué·e·s", "muted_users": "Utilisateur·ice·s masqué·e·s",
"notifications": "Notifications", "notifications": "Notifications",
"profile": "Profil", "profile": "Profil",
"search": "Rechercher", "search": "Recherche",
"select_feature_flags": "Activer/Désactiver Feature Flags", "select_feature_flags": "Activer/Désactiver Feature Flags",
"select_font_size": "Taille de la police", "select_font_size": "Taille de la police",
"select_language": "Sélectionner langue", "select_language": "Sélectionner langue",

View file

@ -24,12 +24,9 @@ const tabs = $computed(() => [
</script> </script>
<template> <template>
<MainContent> <MainContent no-overflow-hidden :back-on-small-screen="isExtraLargeScreen">
<template #title> <template #title>
<span timeline-title-style flex items-center gap-2 cursor-pointer @click="$scrollToTop"> <SearchWidget ref="search" class="m-1" />
<div i-ri:hashtag />
<span>{{ t('nav.explore') }}</span>
</span>
</template> </template>
<template #header> <template #header>

View file

@ -1,23 +0,0 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
useHeadFixed({
title: () => t('nav.search'),
})
</script>
<template>
<MainContent>
<template #title>
<NuxtLink to="/search" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
<div i-ri:search-line class="rtl-flip" />
<span>{{ $t('nav.search') }}</span>
</NuxtLink>
</template>
<div px2 mt3>
<SearchWidget v-if="isHydrated" />
</div>
</MainContent>
</template>