Skip to content

Commit 38cbfe0

Browse files
authored
chore: consistent back button across pages (#936)
1 parent 1e17569 commit 38cbfe0

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

app/pages/about.vue

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
const router = useRouter()
3+
24
interface GitHubContributor {
35
login: string
46
id: number
@@ -39,7 +41,19 @@ const { data: contributors, status: contributorsStatus } = useFetch<GitHubContri
3941
<main class="container flex-1 py-12 sm:py-16">
4042
<article class="max-w-2xl mx-auto">
4143
<header class="mb-12">
42-
<h1 class="font-mono text-3xl sm:text-4xl font-medium mb-4">{{ $t('about.heading') }}</h1>
44+
<div class="flex items-baseline justify-between gap-4 mb-4">
45+
<h1 class="font-mono text-3xl sm:text-4xl font-medium">
46+
{{ $t('about.heading') }}
47+
</h1>
48+
<button
49+
type="button"
50+
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
51+
@click="router.back()"
52+
>
53+
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
54+
<span class="hidden sm:inline">{{ $t('nav.back') }}</span>
55+
</button>
56+
</div>
4357
<p class="text-fg-muted text-lg">
4458
{{ $t('tagline') }}
4559
</p>
@@ -215,16 +229,6 @@ const { data: contributors, status: contributorsStatus } = useFetch<GitHubContri
215229

216230
<CallToAction />
217231
</section>
218-
219-
<footer class="mt-16 pt-8 border-t border-border">
220-
<NuxtLink
221-
to="/"
222-
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-[color] duration-200 rounded focus-visible:outline-accent/70"
223-
>
224-
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
225-
{{ $t('about.back_home') }}
226-
</NuxtLink>
227-
</footer>
228232
</article>
229233
</main>
230234
</template>

app/pages/compare.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script setup lang="ts">
22
import { useRouteQuery } from '@vueuse/router'
33
4+
const router = useRouter()
5+
46
definePageMeta({
57
name: 'compare',
68
})
@@ -61,9 +63,19 @@ useSeoMeta({
6163
<main class="container flex-1 py-12 sm:py-16 w-full">
6264
<div class="max-w-2xl mx-auto">
6365
<header class="mb-12">
64-
<h1 class="font-mono text-3xl sm:text-4xl font-medium mb-4">
65-
{{ $t('compare.packages.title') }}
66-
</h1>
66+
<div class="flex items-baseline justify-between gap-4 mb-4">
67+
<h1 class="font-mono text-3xl sm:text-4xl font-medium">
68+
{{ $t('compare.packages.title') }}
69+
</h1>
70+
<button
71+
type="button"
72+
class="inline-flex items-center gap-2 font-mono text-sm text-fg-muted hover:text-fg transition-colors duration-200 rounded focus-visible:outline-accent/70 shrink-0"
73+
@click="router.back()"
74+
>
75+
<span class="i-carbon:arrow-left rtl-flip w-4 h-4" aria-hidden="true" />
76+
<span class="hidden sm:inline">{{ $t('nav.back') }}</span>
77+
</button>
78+
</div>
6779
<p class="text-fg-muted text-lg">
6880
{{ $t('compare.packages.tagline') }}
6981
</p>

0 commit comments

Comments
 (0)