Skip to content

Commit 84cc589

Browse files
committed
refactor(footer): move button click logic to data layer
1 parent 7af66f5 commit 84cc589

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

app/components/AppFooter.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const showModal = () => modalRef.value?.showModal?.()
1111
const closeModal = () => modalRef.value?.close?.()
1212
1313
type FooterLink =
14-
| { name: string; href: string; kbd?: never; type?: never }
15-
| { name: string; type: 'button'; href?: never; kbd?: never }
14+
| { name: string; href: string; type?: never }
15+
| { name: string; type: 'button'; onClick: () => void }
1616
1717
const socialLinks = computed(() => [
1818
{
@@ -71,6 +71,7 @@ const footerSections: Array<{ label: string; links: FooterLink[] }> = [
7171
{
7272
name: 'footer.keyboard_shortcuts',
7373
type: 'button',
74+
onClick: showModal,
7475
},
7576
],
7677
},
@@ -129,8 +130,9 @@ const footerSections: Array<{ label: string; links: FooterLink[] }> = [
129130
<button
130131
v-if="link.type === 'button'"
131132
type="button"
133+
aria-haspopup="dialog"
134+
@click="link.onClick"
132135
class="cursor-pointer text-start font-mono text-fg-subtle text-sm lowercase hover:text-accent transition-colors duration-200"
133-
@click.prevent="showModal"
134136
>
135137
{{ $t(link.name) }}
136138
</button>

0 commit comments

Comments
 (0)