Fix compiler errors

This commit is contained in:
Sakura Knoll
2021-12-20 06:34:52 +09:00 Unverified
parent 740c210f93
commit 9d92beaeca
5 changed files with 2 additions and 106 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/** @jsxImportSource theme-ui */ /** @jsxImportSource theme-ui */
import { mdiChevronRight, mdiHome } from '@mdi/js' import { mdiChevronRight, mdiHome } from '@mdi/js'
import Icon from '@mdi/react' import Icon from '@mdi/react'
import { NavLink, Text, Flex } from '@theme-ui/components' import { NavLink, Flex } from '@theme-ui/components'
import NextLink from 'next/link' import NextLink from 'next/link'
import React from 'react' import React from 'react'
+1 -2
View File
@@ -1,5 +1,4 @@
import fs from 'fs' import { readdirSync, readJsonFileSync } from '../../lib/data'
import { readdirSync, readJsonFileSync, resolvePathname } from '../../lib/data'
export interface StigmataSkill { export interface StigmataSkill {
name: string name: string
-41
View File
@@ -1,41 +0,0 @@
import React, { useMemo } from 'react'
import { Badge } from 'react-bootstrap'
interface CharacterBadgeProps {
character: Character
}
const CharacterBadge = ({ character }: CharacterBadgeProps) => {
const name = useMemo(() => {
switch (character) {
case 'kiana':
return 'Kiana Kaslana'
case 'bronya':
return 'Bronya Zaychik'
case 'mei':
return 'Raiden Mei'
case 'himeko':
return 'Murata Himeko'
case 'hua':
return 'Fu Hua'
case 'kallen':
return 'Kallen Kaslana'
case 'theresa':
return 'Theresa Apocalypse'
case 'rita':
return 'Rita Rossweisse'
case 'olenyevas':
return 'Olenyevas'
case 'seele':
return 'Seele Vollerei'
case 'yae':
return 'Yae Sakura'
default:
return 'Undefined'
}
}, [])
return <Badge>{name}</Badge>
}
export default CharacterBadge
-52
View File
@@ -1,52 +0,0 @@
import React, { useMemo } from 'react'
import { Badge } from 'react-bootstrap'
import { BattlesuitType } from '../../data/honkai3rd/battlesuits'
interface TypeBadgeProps {
type: BattlesuitType
}
const TypeBadge = ({ type }: TypeBadgeProps) => {
const { name, backgroundColor } = useMemo(() => {
switch (type) {
case 'psychic':
return {
name: 'Psychic',
backgroundColor: 'pink',
}
case 'mecha':
return {
name: 'Mechanic',
backgroundColor: 'blue',
}
case 'biologic':
return {
name: 'Biologic',
backgroundColor: 'orange',
}
case 'quantum':
return {
name: 'Quantum',
backgroundColor: 'purple',
}
case 'imginary':
return {
name: 'Imaginery',
backgroundColor: 'yellow',
}
default:
return {
name: 'Unknown',
backgroundColor: 'gray',
}
}
}, [type])
return (
<Badge bg='' style={{ backgroundColor }}>
{name}
</Badge>
)
}
export default TypeBadge
@@ -8,8 +8,6 @@ import {
getBattlesuitById, getBattlesuitById,
listBattlesuits, listBattlesuits,
} from '../../../data/honkai3rd/battlesuits' } from '../../../data/honkai3rd/battlesuits'
import CharacterBadge from '../../atoms/CharacterBadge'
import TypeBadge from '../../atoms/TypeBadge'
interface BattlesuitShowPageProps { interface BattlesuitShowPageProps {
battlesuit: BattlesuitData battlesuit: BattlesuitData
@@ -35,14 +33,6 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
<Heading as='h1'>{battlesuit.name}</Heading> <Heading as='h1'>{battlesuit.name}</Heading>
<Box className='mb-4'> <Box className='mb-4'>
<Box>
<Box>
<CharacterBadge character={battlesuit.valkyrie} />
</Box>
<Box>
<TypeBadge type={battlesuit.type} />
</Box>
</Box>
<Box> <Box>
<img src={`/assets/honkai3rd/battlesuits/${battlesuit.id}.png`} /> <img src={`/assets/honkai3rd/battlesuits/${battlesuit.id}.png`} />
</Box> </Box>