Make weapon category label into a link with the category filter

This commit is contained in:
Sakura Knoll
2022-01-17 09:00:17 +09:00 Unverified
parent a3dab70fc0
commit 0141a9fbec
+9 -1
View File
@@ -13,6 +13,7 @@ import {
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { useTranslation, translate } from '../../../lib/i18n' import { useTranslation, translate } from '../../../lib/i18n'
import Head from '../../../components/atoms/Head' import Head from '../../../components/atoms/Head'
import PageLink from '../../../components/atoms/PageLink'
interface WeaponShowPageProps { interface WeaponShowPageProps {
weapon: WeaponData weapon: WeaponData
@@ -61,7 +62,14 @@ const WeaponShowPage = ({ weapon }: WeaponShowPageProps) => {
<Card mb={3}> <Card mb={3}>
<Box p={2} sx={{ borderBottom: 'default' }}> <Box p={2} sx={{ borderBottom: 'default' }}>
{weaponCategory} <PageLink
href={{
pathname: '/honkai3rd/weapons',
query: { filter: weapon.category },
}}
>
{weaponCategory}
</PageLink>
</Box> </Box>
<Box p={2} sx={{ borderBottom: 'default' }}> <Box p={2} sx={{ borderBottom: 'default' }}>
{'⭐'.repeat(weapon.rarity)} {'⭐'.repeat(weapon.rarity)}