From 6e016f9fdf7bdf2c6205f3fdbab053c84228a2cd Mon Sep 17 00:00:00 2001 From: Sakura Knoll Date: Sun, 2 Jan 2022 11:49:24 +0900 Subject: [PATCH] Extract StigmataCard --- src/components/molecules/StigmataCard.tsx | 44 ++++++++++++++++ src/pages/honkai3rd/stigmata/index.tsx | 64 ++--------------------- 2 files changed, 47 insertions(+), 61 deletions(-) create mode 100644 src/components/molecules/StigmataCard.tsx diff --git a/src/components/molecules/StigmataCard.tsx b/src/components/molecules/StigmataCard.tsx new file mode 100644 index 00000000..aceeed92 --- /dev/null +++ b/src/components/molecules/StigmataCard.tsx @@ -0,0 +1,44 @@ +import { Box, Card, Text } from '@theme-ui/components' +import { StigmataData } from '../../lib/honkai3rd/stigmata' +import PageLink from '../atoms/PageLink' +import SquareImageBox from '../atoms/SquareImageBox' + +interface StigmataCardProps { + stigmata: Pick +} + +const StigmataCard = ({ stigmata }: StigmataCardProps) => { + return ( + + + + + {stigmata.name} + + + {'⭐'.repeat(stigmata.rarity)} + + + + ) +} + +export default StigmataCard diff --git a/src/pages/honkai3rd/stigmata/index.tsx b/src/pages/honkai3rd/stigmata/index.tsx index ca61c94e..538dd96f 100644 --- a/src/pages/honkai3rd/stigmata/index.tsx +++ b/src/pages/honkai3rd/stigmata/index.tsx @@ -1,8 +1,7 @@ /** @jsxImportSource theme-ui */ -import { Text, Box, Heading, Flex, Link } from '@theme-ui/components' -import Image from 'next/image' -import NextLink from 'next/link' +import { Box, Heading, Flex } from '@theme-ui/components' import { pick } from 'ramda' +import StigmataCard from '../../../components/molecules/StigmataCard' import Breadcrumb from '../../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' import { StigmataData } from '../../../lib/honkai3rd/stigmata' @@ -34,64 +33,7 @@ const StigmataListPage = ({ stigmataDataList }: StigmataListPageProps) => { }} > {stigmataDataList.map((stigmata) => { - return ( - - - - - {stigmata.name} - - - {stigmata.name} - - - {'⭐'.repeat(stigmata.rarity)} - - - - - ) + return })}