mirror of
https://github.com/zen-browser/www.git
synced 2025-07-08 17:30:01 +02:00
refactor(ModsList, ReleaseNoteListItem): update interface usage for better type safety
This commit is contained in:
parent
098e0eb9df
commit
1b7fafbb54
2 changed files with 5 additions and 3 deletions
|
@ -12,14 +12,14 @@ const defaultSortIcon = icon({ prefix: 'fas', iconName: 'sort' })
|
||||||
const ascSortIcon = icon({ prefix: 'fas', iconName: 'sort-up' })
|
const ascSortIcon = icon({ prefix: 'fas', iconName: 'sort-up' })
|
||||||
const descSortIcon = icon({ prefix: 'fas', iconName: 'sort-down' })
|
const descSortIcon = icon({ prefix: 'fas', iconName: 'sort-down' })
|
||||||
|
|
||||||
interface ModsListProps {
|
interface Props {
|
||||||
allMods: ZenTheme[]
|
allMods: ZenTheme[]
|
||||||
locale: Locale
|
locale: Locale
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
translations: any
|
translations: any
|
||||||
}
|
}
|
||||||
|
|
||||||
const { allMods, locale, translations } = Astro.props as ModsListProps
|
const { allMods, locale, translations } = Astro.props
|
||||||
|
|
||||||
const getLocalePath = getPath(locale)
|
const getLocalePath = getPath(locale)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
import { getLocale, getUI } from '~/utils/i18n'
|
import { getLocale, getUI } from '~/utils/i18n'
|
||||||
|
|
||||||
const { type, content, link } = Astro.props as {
|
interface Props {
|
||||||
type: 'security' | 'feature' | 'fix' | 'theme' | 'break' | 'known'
|
type: 'security' | 'feature' | 'fix' | 'theme' | 'break' | 'known'
|
||||||
content: string
|
content: string
|
||||||
link?: {
|
link?: {
|
||||||
|
@ -10,6 +10,8 @@ const { type, content, link } = Astro.props as {
|
||||||
} | null
|
} | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { type, content, link } = Astro.props as Props
|
||||||
|
|
||||||
const locale = getLocale(Astro)
|
const locale = getLocale(Astro)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue