feat: responsive sidebar, aim for a 600px timeline always (#482)

This commit is contained in:
patak 2022-12-21 01:02:01 +01:00 committed by GitHub
parent 3907199a54
commit 44cf8aa89c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 39 deletions

View file

@ -3,7 +3,7 @@ const { notifications } = useNotifications()
</script>
<template>
<nav md:px3 md:py4 flex="~ col gap2" text-size-base leading-normal md:text-lg>
<nav sm:px3 sm:py4 flex="~ col gap2" text-size-base leading-normal md:text-lg>
<template v-if="isMastoInitialised && currentUser">
<NavSideItem :text="$t('nav_side.home')" to="/home" icon="i-ri:home-5-line" />
<NavSideItem :text="$t('nav_side.notifications')" to="/notifications" icon="i-ri:notification-4-line">
@ -24,20 +24,6 @@ const { notifications } = useNotifications()
<NavSideItem :text="$t('nav_side.conversations')" to="/conversations" icon="i-ri:at-line" />
<NavSideItem :text="$t('nav_side.favourites')" to="/favourites" icon="i-ri:heart-3-line" />
<NavSideItem :text="$t('nav_side.bookmarks')" to="/bookmarks" icon="i-ri:bookmark-line " />
<NavSideItem
v-if="isHydrated && isMediumScreen"
:text="currentUser.account.displayName"
:to="getAccountRoute(currentUser.account)"
icon="i-ri:account-circle-line"
>
<template #icon>
<AccountAvatar :account="currentUser.account" h="1.2em" md:text-size-inherit text-xl />
</template>
<ContentRich
:content="getDisplayName(currentUser.account, { rich: true }) || $t('nav_side.profile')"
:emojis="currentUser.account.emojis"
/>
</NavSideItem>
</template>
</nav>
</template>

View file

@ -26,13 +26,15 @@ useCommand({
<template>
<NuxtLink :to="to" :active-class="isMastoInitialised ? 'text-primary' : ''" group focus:outline-none @click="$scrollToTop">
<div flex w-fit px5 py2 md:gap2 gap4 items-center transition-100 rounded-full group-hover:bg-active group-focus-visible:ring="2 current">
<slot name="icon">
<div :class="icon" md:text-size-inherit text-xl />
</slot>
<slot>
<span>{{ text }}</span>
</slot>
</div>
<CommonTooltip :disabled="!isMediumScreen" :content="text" placement="right">
<div flex w-fit px2 mx3 lg:mx0 lg:px5 py2 gap4 items-center transition-100 rounded-full group-hover:bg-active group-focus-visible:ring="2 current">
<slot name="icon">
<div :class="icon" text-xl />
</slot>
<slot>
<span hidden lg:block>{{ text }}</span>
</slot>
</div>
</CommonTooltip>
</NuxtLink>
</template>

View file

@ -7,7 +7,7 @@ const sub = env === 'local' ? 'dev' : env === 'staging' ? 'preview' : 'alpha'
<!-- Use external to force refresh page and jump to top of timeline -->
<NuxtLink flex px3 py2 items-center text-2xl gap-2 hover:bg-active focus-visible:ring="2 current" rounded-full to="/" external>
<img :alt="$t('app_logo')" src="/logo.svg" w-10 h-10 height="40" width="40">
<div>
<div hidden lg:block>
{{ $t('app_name') }} <sup text-sm italic text-secondary mt-1>{{ sub }}</sup>
</div>
</NuxtLink>