Skip to content

Commit

Permalink
fix: migrate as per recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
raisedadead committed Sep 18, 2024
1 parent 56e5bc3 commit 2ee4a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/components/FCCMobileMenuToggle.astro
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
import type { Props } from '@astrojs/starlight/props';
import { Icon } from '@astrojs/starlight/components';
const { labels } = Astro.props;
---

<starlight-menu-button>
<button
aria-expanded='false'
aria-label={labels['menuButton.accessibleLabel']}
aria-label={Astro.locals.t('menuButton.accessibleLabel')}
aria-controls='starlight__sidebar'
class='sl-flex md:sl-hidden'
>
Expand Down
11 changes: 3 additions & 8 deletions src/components/FCCPagination.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ interface Pagination {
next?: { label: keyof CollectionEntry<'i18n'>['data']; href: string };
}
interface Label {
[key: string]: string;
}
interface Props {
dir: string;
labels: Label;
pagination: Pagination;
}
const { dir, labels, pagination } = Astro.props;
const { dir, pagination } = Astro.props;
const { prev, next } = pagination;
const isRtl = dir === 'rtl';
Expand All @@ -35,7 +30,7 @@ const prefix = Astro.currentLocale == 'en' ? '' : Astro.currentLocale;
<a href={`${prefix}${prev.href}`} rel='prev'>
<Icon name={isRtl ? 'right-arrow' : 'left-arrow'} size='1.5rem' />
<span>
{labels['page.previousLink']}
{Astro.locals.t('page.previousLink')}
<br />
<span class='link-title'>{entry?.data[prev.label]}</span>
</span>
Expand All @@ -47,7 +42,7 @@ const prefix = Astro.currentLocale == 'en' ? '' : Astro.currentLocale;
<a href={`${prefix}${next.href}`} rel='next'>
<Icon name={isRtl ? 'left-arrow' : 'right-arrow'} size='1.5rem' />
<span>
{labels['page.nextLink']}
{Astro.locals.t('page.nextLink')}
<br />
<span class='link-title'>{entry?.data[next.label]}</span>
</span>
Expand Down

0 comments on commit 2ee4a25

Please sign in to comment.