Refactor locale
This commit is contained in:
@@ -11,9 +11,15 @@ interface BattlesuitCardProps {
|
||||
battlesuit: Pick<BattlesuitData, 'id' | 'name' | 'krName'>
|
||||
hidden?: boolean
|
||||
size?: 'sm' | 'default'
|
||||
href?: string
|
||||
}
|
||||
|
||||
const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
|
||||
const BattlesuitCard = ({
|
||||
battlesuit,
|
||||
hidden,
|
||||
size,
|
||||
href,
|
||||
}: BattlesuitCardProps) => {
|
||||
const { locale } = useRouter()
|
||||
|
||||
const battlesuitName = translate(
|
||||
@@ -22,6 +28,10 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
|
||||
battlesuit.name
|
||||
)
|
||||
|
||||
if (href == null) {
|
||||
href = `/honkai3rd/battlesuits/${battlesuit.id}`
|
||||
}
|
||||
|
||||
if (size === 'sm') {
|
||||
return (
|
||||
<Card
|
||||
@@ -35,7 +45,7 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<PageLink href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
|
||||
<PageLink href={href}>
|
||||
<Flex>
|
||||
<SquareImageBox
|
||||
mr={2}
|
||||
@@ -72,10 +82,7 @@ const BattlesuitCard = ({ battlesuit, hidden, size }: BattlesuitCardProps) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<PageLink
|
||||
href={`/honkai3rd/battlesuits/${battlesuit.id}`}
|
||||
key={battlesuit.id}
|
||||
>
|
||||
<PageLink href={href}>
|
||||
<SquareImageBox
|
||||
alt={battlesuitName}
|
||||
src={`${assetsBucketBaseUrl}/honkai3rd/battlesuits/portrait-${battlesuit.id}.png`}
|
||||
|
||||
@@ -50,12 +50,10 @@ const SingleStigmataPage = ({
|
||||
return (
|
||||
<Honkai3rdLayout>
|
||||
<Head
|
||||
title={`${t('breadcrumb.honkai-3rd')}: ${stigmataName} - ${t(
|
||||
'nav.abyss-lab'
|
||||
title={`${t('common.honkai-3rd')}: ${stigmataName} - ${t(
|
||||
'common.abyss-lab'
|
||||
)}`}
|
||||
description={`${t('breadcrumb.honkai-3rd')} ${t(
|
||||
'stigmata-show.stigmata'
|
||||
)} /
|
||||
description={`${t('common.honkai-3rd')} ${t('stigmata-show.stigmata')} /
|
||||
${'⭐'.repeat(stigmataData.rarity)} / ${t(
|
||||
`stigmata-show.${stigmataData.type}`
|
||||
)} / HP : ${stigmataData.hp} / ATK : ${stigmataData.atk} / DEF : ${
|
||||
@@ -65,8 +63,8 @@ const SingleStigmataPage = ({
|
||||
<Box p={3}>
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
|
||||
{ href: '/honkai3rd/stigmata', label: t('breadcrumb.stigmata') },
|
||||
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
|
||||
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') },
|
||||
{
|
||||
href: `/honkai3rd/stigmata/${stigmataData.id}`,
|
||||
label: stigmataName,
|
||||
|
||||
@@ -38,10 +38,10 @@ const StigmataSetPage = ({
|
||||
return (
|
||||
<Honkai3rdLayout>
|
||||
<Head
|
||||
title={`${t('breadcrumb.honkai-3rd')}: ${stigmataSetName} ${t(
|
||||
title={`${t('common.honkai-3rd')}: ${stigmataSetName} ${t(
|
||||
'stigmata-show.stigmata-set'
|
||||
)} - ${t('nav.abyss-lab')}`}
|
||||
description={`${t('breadcrumb.honkai-3rd')} ${t(
|
||||
)} - ${t('common.abyss-lab')}`}
|
||||
description={`${t('common.honkai-3rd')} ${t(
|
||||
'stigmata-show.stigmata-set'
|
||||
)} / ${'⭐'.repeat(stigmataSet.rarity)} / ${stigmataSetAltName}`}
|
||||
/>
|
||||
@@ -49,13 +49,13 @@ const StigmataSetPage = ({
|
||||
<Box p={3}>
|
||||
<Breadcrumb
|
||||
items={[
|
||||
{ href: '/honkai3rd', label: t('breadcrumb.honkai-3rd') },
|
||||
{ href: '/honkai3rd', label: t('common.honkai-3rd') },
|
||||
{
|
||||
href: {
|
||||
pathname: `/honkai3rd/stigmata`,
|
||||
query: { list: 'set' },
|
||||
},
|
||||
label: t('breadcrumb.stigmata'),
|
||||
label: t('common.stigmata'),
|
||||
},
|
||||
{
|
||||
href: `/honkai3rd/stigmata/${stigmataSet.id}-set`,
|
||||
|
||||
Reference in New Issue
Block a user