Guide generator (#231)
* Replace sw, sns battlesuit images * Add gen guide page * Make supports configurable * Extract DifficultySelect & Improve Ex Signet Ordering style * Extract BattlesuitSelect * Use BattlesuitSelect for support valk * Swap support if duplicated * Add sigil selector * Set initial ex signets * Change layout * Add sigil icon to single value * Add equipment select * Fix difficulty box label * Implement SignetBox * Add Signet form control * Improve rendering perf of stigma and weapon select * Implement image converter * Fix signet select * Remove FontHead * Remove wrong new line * Fix warnings * Add custom style configurator * Make labels of DiffucltyBox and ValkBox configurable * Add background and improve layout * Improve ex signet fontsize * Style boundaries of left bottom boxes * Apply fonts directly * Style signet box * Add Signet group label * Style ValkBox * Add support valk label * Style layout of SignetBox * Add shadow to difficulty box * Add sigil label * Adjust signet group label * Add equipment label * Configure colors of left bottom boxes * Add tag, rank, signature * Add icon to current value of battlesuit select * Adjust form styles * Add signet group select * Implement import/export data * Fix dashed border of difficulty box * Add gen link to elysian realm home * Prefix types
This commit is contained in:
@@ -4,7 +4,6 @@ import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||
import { getBattlesuitMapByIds } from '../../../server/data/honkai3rd/battlesuits'
|
||||
import { BattlesuitData } from '../../../lib/honkai3rd/battlesuits'
|
||||
import BattlesuitCard from '../../../components/molecules/BattlesuitCard'
|
||||
|
||||
import { NextPageContext } from 'next'
|
||||
import { getI18NProps } from '../../../server/i18n'
|
||||
import { useTranslation } from '../../../lib/i18n'
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
getRemembranceSigils as getRemembranceSigils,
|
||||
getSupportBattlesuits,
|
||||
} from '../../../server/data/honkai3rd/elysianRealm'
|
||||
import Link from 'next/link'
|
||||
|
||||
type BattlesuitListItemData = Pick<
|
||||
BattlesuitData,
|
||||
@@ -152,6 +152,11 @@ const ElysianRealmIndexPage = ({
|
||||
})}
|
||||
</Flex>
|
||||
</Box>
|
||||
<Box>
|
||||
<Link href='/honkai3rd/elysian-realm/utils/gen-guide'>
|
||||
Guide Generator (KR Only)
|
||||
</Link>
|
||||
</Box>
|
||||
</Box>
|
||||
</Honkai3rdLayout>
|
||||
)
|
||||
@@ -180,6 +185,7 @@ export async function getStaticProps({ locale }: NextPageContext) {
|
||||
name,
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
props: {
|
||||
battlesuitMap: getBattlesuitMapByIds(erBattlesuitIds, locale),
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/* eslint-disable @next/next/no-page-custom-font */
|
||||
import { NextPageContext } from 'next'
|
||||
import { useRouter } from 'next/router'
|
||||
import { pick } from 'ramda'
|
||||
import { Box, Button, Flex, Heading } from 'theme-ui'
|
||||
import ERGuideGenerator from '../../../../components/organisms/ERGuideGenerator/ERGuideGenerator'
|
||||
import { BattlesuitData } from '../../../../lib/honkai3rd/battlesuits'
|
||||
import {
|
||||
PopulatedSignetGroup,
|
||||
RemembranceSigil,
|
||||
} from '../../../../lib/honkai3rd/elysianRealm'
|
||||
import { WeaponData } from '../../../../lib/honkai3rd/weapons'
|
||||
import { StigmataData } from '../../../../lib/honkai3rd/stigmata'
|
||||
import { listBattlesuits } from '../../../../server/data/honkai3rd/battlesuits'
|
||||
import {
|
||||
getRemembranceSigils,
|
||||
getSignetGroupById,
|
||||
} from '../../../../server/data/honkai3rd/elysianRealm'
|
||||
import { listStigmata } from '../../../../server/data/honkai3rd/stigmata'
|
||||
import { listWeapons } from '../../../../server/data/honkai3rd/weapons'
|
||||
import { getI18NProps } from '../../../../server/i18n'
|
||||
|
||||
interface GenerateGuidePageProps {
|
||||
weapons: WeaponData[]
|
||||
stigmata: StigmataData[]
|
||||
battlesuits: BattlesuitData[]
|
||||
exSignetGroup: PopulatedSignetGroup
|
||||
sigils: RemembranceSigil[]
|
||||
}
|
||||
|
||||
const GenerateGuidePage = ({
|
||||
weapons,
|
||||
stigmata,
|
||||
battlesuits,
|
||||
exSignetGroup,
|
||||
sigils,
|
||||
}: GenerateGuidePageProps) => {
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Flex m={2} sx={{ alignItems: 'center' }}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
router.push('/honkai3rd')
|
||||
}}
|
||||
mr={2}
|
||||
>
|
||||
Back
|
||||
</Button>
|
||||
<Heading>ER Guide Generator</Heading>
|
||||
</Flex>
|
||||
<ERGuideGenerator
|
||||
weapons={weapons}
|
||||
stigmata={stigmata}
|
||||
battlesuits={battlesuits}
|
||||
exSignetGroup={exSignetGroup}
|
||||
sigils={sigils}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
export default GenerateGuidePage
|
||||
|
||||
export async function getStaticProps({ locale }: NextPageContext) {
|
||||
return {
|
||||
props: {
|
||||
weapons: listWeapons('ko-KR').map((weapon) => {
|
||||
return pick(['name', 'id', 'rarity', 'category'], weapon)
|
||||
}),
|
||||
stigmata: listStigmata('ko-KR').map((stigmata) => {
|
||||
return pick(['name', 'id', 'type'], stigmata)
|
||||
}),
|
||||
battlesuits: listBattlesuits('ko-KR').map((battlesuit) => {
|
||||
return {
|
||||
id: battlesuit.id,
|
||||
name: battlesuit.name,
|
||||
type: battlesuit.type,
|
||||
valkyrie: battlesuit.valkyrie,
|
||||
}
|
||||
}),
|
||||
exSignetGroup: getSignetGroupById('elysia', 'ko-KR'),
|
||||
sigils: getRemembranceSigils('ko-KR'),
|
||||
...(await getI18NProps('ko-KR')),
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user