diff --git a/src/pages/honkai3rd/elfs/[elfId].tsx b/src/pages/honkai3rd/elfs/[elfId].tsx new file mode 100644 index 00000000..6c4156eb --- /dev/null +++ b/src/pages/honkai3rd/elfs/[elfId].tsx @@ -0,0 +1,93 @@ +import { Box, Flex, Heading, Paragraph } from '@theme-ui/components' +import { NextPageContext } from 'next' +import Image from 'next/image' +import React from 'react' +import Breadcrumb from '../../../components/organisms/Breadcrumb' +import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' +import { ElfData, getElfById, listElfs } from '../../../data/honkai3rd/elfs' + +interface ElfShowPageProps { + elf: ElfData +} + +const ElfShowPage = ({ elf }: ElfShowPageProps) => { + return ( + + + + + + + {elf.name} + + + + {elf.name} + + + {'⭐'.repeat(elf.baseRank)} + + {elf.skillRows.map((row, rowIndex) => { + return ( + + {row.map((item, columnIndex) => { + return ( + + {item.name} + {item.description} + + ) + })} +
+
+ ) + })} +
+
+
+ ) +} + +export default ElfShowPage + +export function getStaticProps( + context: NextPageContext & { params: { elfId: string } } +) { + const elf = getElfById(context.params.elfId) + return { + props: { elf }, + } +} + +export async function getStaticPaths() { + return { + paths: listElfs().map((elf) => { + return { + params: { elfId: elf.id }, + } + }), + fallback: false, + } +} diff --git a/src/pages/honkai3rd/elfs/index.tsx b/src/pages/honkai3rd/elfs/index.tsx new file mode 100644 index 00000000..aff8c9da --- /dev/null +++ b/src/pages/honkai3rd/elfs/index.tsx @@ -0,0 +1,106 @@ +import { Box, Heading, Flex, Text, Link } from '@theme-ui/components' +import Image from 'next/image' +import NextLink from 'next/link' +import { pick } from 'ramda' +import React from 'react' +import Breadcrumb from '../../../components/organisms/Breadcrumb' +import Honkai3rdNavigator from '../../../components/organisms/Honkai3rdNavigator' +import { ElfData, listElfs } from '../../../data/honkai3rd/elfs' + +interface ElfListPageProps { + elfs: Pick[] +} + +const ElfListPage = ({ elfs }: ElfListPageProps) => { + return ( + + + + + + + ELFs + + + {elfs.map((elf) => { + return ( + + + + + {elf.name} + + + {elf.name} + + + + + ) + })} + + + + ) +} + +export default ElfListPage + +export async function getStaticProps() { + return { + props: { + elfs: listElfs().map((elf) => pick(['id', 'name'], elf)), + }, + } +}