From a0d5b8d1a3b25f8b0d600c86cd44841fad9fef74 Mon Sep 17 00:00:00 2001 From: Sakura Knoll Date: Sun, 2 Jan 2022 19:52:47 +0900 Subject: [PATCH] Refactor elf list page --- src/components/molecules/ElfCard.tsx | 47 +++++++++++++++++++++ src/pages/honkai3rd/elfs/index.tsx | 61 ++-------------------------- 2 files changed, 50 insertions(+), 58 deletions(-) create mode 100644 src/components/molecules/ElfCard.tsx diff --git a/src/components/molecules/ElfCard.tsx b/src/components/molecules/ElfCard.tsx new file mode 100644 index 00000000..4b4f9fcd --- /dev/null +++ b/src/components/molecules/ElfCard.tsx @@ -0,0 +1,47 @@ +/** @jsxImportSource theme-ui */ + +import { Box, Card, Text } from '@theme-ui/components' +import { ElfData } from '../../lib/honkai3rd/elfs' +import PageLink from '../atoms/PageLink' +import SquareImageBox from '../atoms/SquareImageBox' + +interface ElfCardProps { + elf: Pick + hidden?: boolean +} + +const ElfCard = ({ elf }: ElfCardProps) => { + return ( + + + + + {elf.name} + + + + ) +} + +export default ElfCard diff --git a/src/pages/honkai3rd/elfs/index.tsx b/src/pages/honkai3rd/elfs/index.tsx index cc5244ed..5a20499c 100644 --- a/src/pages/honkai3rd/elfs/index.tsx +++ b/src/pages/honkai3rd/elfs/index.tsx @@ -1,8 +1,7 @@ /** @jsxImportSource theme-ui */ -import { Box, Heading, Flex, Text, 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 ElfCard from '../../../components/molecules/ElfCard' import Breadcrumb from '../../../components/organisms/Breadcrumb' import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' import { ElfData } from '../../../lib/honkai3rd/elfs' @@ -34,61 +33,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => { }} > {elfs.map((elf) => { - return ( - - - - - {elf.name} - - - {elf.name} - - - - - ) + return })}