diff --git a/src/components/molecules/WeaponCard.tsx b/src/components/molecules/WeaponCard.tsx new file mode 100644 index 00000000..12be0f5c --- /dev/null +++ b/src/components/molecules/WeaponCard.tsx @@ -0,0 +1,49 @@ +import { Box, Card, Text } from '@theme-ui/components' +import { WeaponData } from '../../lib/honkai3rd/weapons' +import PageLink from '../atoms/PageLink' +import SquareImageBox from '../atoms/SquareImageBox' + +interface WeaponCardProps { + weapon: Pick + hidden?: boolean +} + +const WeaponCard = ({ weapon, hidden }: WeaponCardProps) => { + return ( + + + + + {weapon.name} + + + {'⭐'.repeat(weapon.rarity)} + + + + ) +} + +export default WeaponCard diff --git a/src/pages/honkai3rd/weapons/index.tsx b/src/pages/honkai3rd/weapons/index.tsx index 58dbaf5a..d1d3ce63 100644 --- a/src/pages/honkai3rd/weapons/index.tsx +++ b/src/pages/honkai3rd/weapons/index.tsx @@ -1,15 +1,14 @@ /** @jsxImportSource theme-ui */ -import { Text, Box, Heading, Flex, Card } from '@theme-ui/components' +import { Box, Heading, Flex } from '@theme-ui/components' import Breadcrumb from '../../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' import { listWeapons } from '../../../server/data/honkai3rd/weapons' import { pick } from 'ramda' -import SquareImageBox from '../../../components/atoms/SquareImageBox' import { useMemo } from 'react' import FilterButton from '../../../components/atoms/FilterButton' import { useRouter } from 'next/router' import { WeaponData } from '../../../lib/honkai3rd/weapons' -import PageLink from '../../../components/atoms/PageLink' +import WeaponCard from '../../../components/molecules/WeaponCard' type WeaponListItemData = Pick< WeaponData, @@ -47,42 +46,7 @@ const WeaponListPage = ({ weaponDataList }: WeaponListPageProps) => { const weaponList = useMemo(() => { return weaponDataList.map((weapon) => { const hidden = isWeaponHidden(weapon, filter) - return ( - - - - - {weapon.name} - - - {'⭐'.repeat(weapon.rarity)} - - - - ) + return