Skip to content

Commit

Permalink
feat: floating back button for xl
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jan 5, 2023
1 parent b440842 commit f177ea1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/main/MainContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defineProps<{
pt="[env(safe-area-inset-top,0)]"
border="b base" bg="[rgba(var(--c-bg-base-rgb),0.7)]"
>
<div :class="{ 'xl:hidden': !back }" flex justify-between px5 py2>
<div xl:hidden flex justify-between px5 py2>
<div flex gap-3 items-center overflow-hidden py2>
<NuxtLink
v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0
Expand Down
33 changes: 21 additions & 12 deletions components/nav/NavTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ const { env } = buildInfo

<template>
<!-- Use external to force refresh page and jump to top of timeline -->
<NuxtLink
flex items-end gap-4
py2 px-5
text-2xl
focus-visible:ring="2 current"
to="/"
external
>
<img :alt="$t('app_logo')" src="/logo.svg" shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip">
<div hidden xl:block>
{{ $t('app_name') }} <sup text-sm italic text-secondary mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
<div flex justify-between>
<NuxtLink
flex items-end gap-4
py2 px-5
text-2xl
focus-visible:ring="2 current"
to="/"
external
>
<img :alt="$t('app_logo')" src="/logo.svg" shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip">
<div hidden xl:block>
{{ $t('app_name') }} <sup text-sm italic text-secondary mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
</div>
</NuxtLink>
<div hidden xl:flex items-center me-8 mt-2>
<NuxtLink
@click="$router.go(-1)"
>
<div i-ri:arrow-left-line class="rtl-flip" btn-text />
</NuxtLink>
</div>
</NuxtLink>
</div>
</template>
2 changes: 1 addition & 1 deletion pages/[[server]]/@[account]/[status].vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ onReactivated(() => {
<template>
<MainContent back>
<template v-if="!pending">
<div v-if="status" mt--1px border="b base" mb="50vh">
<div v-if="status" xl:mt-4 border="b base" mb="50vh">
<template v-for="comment of context?.ancestors" :key="comment.id">
<StatusCard
:status="comment" :actions="comment.visibility !== 'direct'" context="account"
Expand Down

0 comments on commit f177ea1

Please sign in to comment.