Fix all locales
This commit is contained in:
@@ -144,10 +144,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"elysian-realm": {
|
"elysian-realm": {
|
||||||
|
"elysian-realm": "Elysian Realm",
|
||||||
|
"battlesuits": "Battlesuits",
|
||||||
"signets": "Signets",
|
"signets": "Signets",
|
||||||
"remembrance-sigil": "Remembrance Sigil",
|
"remembrance-sigil": "Remembrance Sigil",
|
||||||
"supports": "Supports",
|
"supports": "Supports",
|
||||||
"no-upgrades": "No Upgrades Available",
|
|
||||||
"nexus-signets": "Nexus Signets",
|
"nexus-signets": "Nexus Signets",
|
||||||
"normal-signets": "Normal Signets",
|
"normal-signets": "Normal Signets",
|
||||||
"exclusive-signets": "Exclusive Signets"
|
"exclusive-signets": "Exclusive Signets"
|
||||||
|
|||||||
@@ -38,13 +38,13 @@
|
|||||||
"description": "붕괴 3rd 성흔 목록",
|
"description": "붕괴 3rd 성흔 목록",
|
||||||
"stigmata-single": "성흔 (단일)",
|
"stigmata-single": "성흔 (단일)",
|
||||||
"set-list": "세트 일람",
|
"set-list": "세트 일람",
|
||||||
"show-set-list": "단일 성흔 목록"
|
"show-set-list": "세트 성흔 목록으로 보기"
|
||||||
},
|
},
|
||||||
"stigmata-set-list": {
|
"stigmata-set-list": {
|
||||||
"description": "붕괴 3rd 성흔 세트 목록",
|
"description": "붕괴 3rd 성흔 세트 목록",
|
||||||
"stigmata-set": "성흔 (세트)",
|
"stigmata-set": "성흔 (세트)",
|
||||||
"set-list": "세트 일람",
|
"set-list": "세트 일람",
|
||||||
"show-signle-list": "단일 성흔 목록"
|
"show-signle-list": "단일 성흔 목록으로 보기"
|
||||||
},
|
},
|
||||||
"stigmata-show": {
|
"stigmata-show": {
|
||||||
"stigmata": "성흔",
|
"stigmata": "성흔",
|
||||||
@@ -86,58 +86,12 @@
|
|||||||
"ultimate": "필살기",
|
"ultimate": "필살기",
|
||||||
"team": "팀"
|
"team": "팀"
|
||||||
},
|
},
|
||||||
"versions": {
|
|
||||||
"version": "업데이트",
|
|
||||||
"list-page-description": "붕괴 3rd 업데이트 정보 목록",
|
|
||||||
"all-versions": "모든 업데이트",
|
|
||||||
"versions": "업데이트",
|
|
||||||
"previous": "이전 버전",
|
|
||||||
"next": "다음 버전",
|
|
||||||
"current": "현재 버전",
|
|
||||||
"new-battlesuits": "신규 발키리",
|
|
||||||
"new-weapons": "신규 무기",
|
|
||||||
"new-stigmata-sets": "신규 성흔 세트",
|
|
||||||
"weekly-bosses": "주간 보스",
|
|
||||||
"super-string": "초끈 공간",
|
|
||||||
"memorial-arena": "기억 전장",
|
|
||||||
"supply-events": "보급 이벤트",
|
|
||||||
"supply-events-disclaimer": "주의: 보급 일정은 글로벌 아메리카 서버 기준으로 작성되어 있습니다. 수작업으로 갱신하기에 정확하지 않은 부분이 있을 수도 있습니다. 보급 가차를 돌리기 전에 게임 내 정보를 꼭 다시 한번 확인해주세요."
|
|
||||||
},
|
|
||||||
"sources": {
|
|
||||||
"sprit-weapon-foundry": {
|
|
||||||
"label": "진영 무기 단조",
|
|
||||||
"description": "150 x 네겐트로피 허수 코어, 300 x 플로지스톤 에테르, 1 x 50 레벨 진영 무기(190 x G1 결정, 80 x 붕괴의 파편, 400 x 플로지스톤 에테르)로 단조."
|
|
||||||
},
|
|
||||||
"dorm-equipment-supply": {
|
|
||||||
"label": "본부 장비 보급",
|
|
||||||
"description": "보급마다 200 x 수정을 소모. 뽑지 않기를 추천함. 대부분의 아이템들은 치환 공간에서 구할 수 있음."
|
|
||||||
},
|
|
||||||
"focused-supply": {
|
|
||||||
"label": "집중 보급",
|
|
||||||
"description": "보급마다 280 x 수정을 소모."
|
|
||||||
},
|
|
||||||
"pri-weapon-foundry": {
|
|
||||||
"label": "초월 무기 단조",
|
|
||||||
"description": "원형 무기 획득 후, 100 x 아인슈타인 토러스, 15 x 나노 세라믹, 50 x 초전도 금속성 수소, 1 x 같은 종류의 50레벨 5성 보급 무기로 단조."
|
|
||||||
},
|
|
||||||
"weapon-exchange": {
|
|
||||||
"label": "치환 공간",
|
|
||||||
"description": "4000 x 무장 공명으로 교환."
|
|
||||||
},
|
|
||||||
"stigmata-exchange": {
|
|
||||||
"label": "치환 공간",
|
|
||||||
"description": "6000 x 성흔 공명으로 교환."
|
|
||||||
},
|
|
||||||
"special-divine-key-supply": {
|
|
||||||
"label": "신의 열쇠 보급",
|
|
||||||
"description": "천명 무기고나 화력 보급등 특수 보급 이벤트에서만 획득 가능. 보급마다 280 x 수정을 소모."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"elysian-realm": {
|
"elysian-realm": {
|
||||||
|
"elysian-realm": "과거의 낙원",
|
||||||
|
"battlesuits": "발키리",
|
||||||
"signets": "각인",
|
"signets": "각인",
|
||||||
"remembrance-sigil": "회상의 증명",
|
"remembrance-sigil": "회상의 증명",
|
||||||
"supports": "지원 발키리",
|
"supports": "지원 발키리",
|
||||||
"no-upgrades": "레벨업 불가능",
|
|
||||||
"nexus-signets": "증폭 각인",
|
"nexus-signets": "증폭 각인",
|
||||||
"normal-signets": "일반 각인",
|
"normal-signets": "일반 각인",
|
||||||
"exclusive-signets": "전용 각인"
|
"exclusive-signets": "전용 각인"
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
|
||||||
import { Flex, Text } from '@theme-ui/components'
|
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
|
||||||
import { battlesuitFeatures } from '../../lib/honkai3rd/battlesuits'
|
|
||||||
import { translate } from '../../lib/i18n'
|
|
||||||
import SquareImageBox from './SquareImageBox'
|
|
||||||
|
|
||||||
interface BattlesuitFeatureLabelProps {
|
|
||||||
feature: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const BattlesuitFeatureLabel = ({ feature }: BattlesuitFeatureLabelProps) => {
|
|
||||||
const { locale } = useRouter()
|
|
||||||
const featureData = battlesuitFeatures.find(
|
|
||||||
(aFeature) => aFeature.value === feature
|
|
||||||
)
|
|
||||||
if (featureData == null) {
|
|
||||||
return <Text>{feature}</Text>
|
|
||||||
}
|
|
||||||
|
|
||||||
const { label, icon, krLabel } = featureData
|
|
||||||
|
|
||||||
const translatedLabel = translate(locale, { 'ko-KR': krLabel }, label)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
|
||||||
{featureData != null && (
|
|
||||||
<SquareImageBox
|
|
||||||
size={30}
|
|
||||||
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
|
|
||||||
alt={translatedLabel}
|
|
||||||
mr={1}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Text>{translatedLabel}</Text>
|
|
||||||
</Flex>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BattlesuitFeatureLabel
|
|
||||||
@@ -8,9 +8,10 @@ import SquareImageBox from '../atoms/SquareImageBox'
|
|||||||
type NavItemTarget = 'battlesuits' | 'stigmata' | 'weapons' | 'elfs' | 'elysian-realm' | 'media'
|
type NavItemTarget = 'battlesuits' | 'stigmata' | 'weapons' | 'elfs' | 'elysian-realm' | 'media'
|
||||||
interface NavItemProps {
|
interface NavItemProps {
|
||||||
target: NavItemTarget
|
target: NavItemTarget
|
||||||
|
size?: 'md' | 'lg'
|
||||||
}
|
}
|
||||||
|
|
||||||
const NavItem = ({ target }: NavItemProps) => {
|
const NavItem = ({ target, size = 'md' }: NavItemProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<NextLink href={getHref(target)} passHref>
|
<NextLink href={getHref(target)} passHref>
|
||||||
@@ -23,12 +24,13 @@ const NavItem = ({ target }: NavItemProps) => {
|
|||||||
p: 1
|
p: 1
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SquareImageBox size={30} mr={1} src={getIconByTarget(target)} />
|
<SquareImageBox size={size === 'lg' ? 50 : 30} mr={size === 'lg' ? 2 : 1} src={getIconByTarget(target)} />
|
||||||
<Text
|
<Text
|
||||||
sx={{
|
sx={{
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
textOverflow: 'ellipsis',
|
textOverflow: 'ellipsis',
|
||||||
whiteSpace: 'nowrap'
|
whiteSpace: 'nowrap',
|
||||||
|
fontSize: size === 'lg' ? 3 : undefined
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t(`common.${target}`)}
|
{t(`common.${target}`)}
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
|
||||||
import { Flex, Text } from '@theme-ui/components'
|
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
|
||||||
import { battlesuitTypes } from '../../lib/honkai3rd/battlesuits'
|
|
||||||
import { translate } from '../../lib/i18n'
|
|
||||||
import { capitalize } from '../../lib/string'
|
|
||||||
import SquareImageBox from './SquareImageBox'
|
|
||||||
|
|
||||||
interface TypeLabelProps {
|
|
||||||
type: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const TypeLabel = ({ type }: TypeLabelProps) => {
|
|
||||||
const battlesuitType = battlesuitTypes.find((aType) => aType.value === type)
|
|
||||||
|
|
||||||
const { locale } = useRouter()
|
|
||||||
const label =
|
|
||||||
battlesuitType != null
|
|
||||||
? translate(
|
|
||||||
locale,
|
|
||||||
{ 'ko-KR': battlesuitType.krLabel },
|
|
||||||
battlesuitType.label
|
|
||||||
)
|
|
||||||
: capitalize(type)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
|
||||||
{isValidType(type) && (
|
|
||||||
<SquareImageBox
|
|
||||||
size={30}
|
|
||||||
src={`${assetsBucketBaseUrl}/honkai3rd/type-icons/${type}.png`}
|
|
||||||
alt={label}
|
|
||||||
mr={1}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Text>{label}</Text>
|
|
||||||
</Flex>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TypeLabel
|
|
||||||
|
|
||||||
function isValidType(type: string): boolean {
|
|
||||||
switch (type) {
|
|
||||||
case 'mecha':
|
|
||||||
case 'biologic':
|
|
||||||
case 'psychic':
|
|
||||||
case 'quantum':
|
|
||||||
case 'imaginary':
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
|
||||||
import { Flex, Text } from '@theme-ui/components'
|
|
||||||
import { useRouter } from 'next/router'
|
|
||||||
import { assetsBucketBaseUrl } from '../../lib/consts'
|
|
||||||
import { valkyries } from '../../lib/honkai3rd/battlesuits'
|
|
||||||
import { translate } from '../../lib/i18n'
|
|
||||||
import SquareImageBox from './SquareImageBox'
|
|
||||||
|
|
||||||
interface ValkyrieLabelProps {
|
|
||||||
valkyrie: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const ValkyrieLabel = ({ valkyrie }: ValkyrieLabelProps) => {
|
|
||||||
const { icon, label, krLabel } = valkyries.find(
|
|
||||||
(aValkyrie) => aValkyrie.value === valkyrie
|
|
||||||
) || { label: valkyrie, krLabel: valkyrie }
|
|
||||||
const { locale } = useRouter()
|
|
||||||
|
|
||||||
const translatedLabel = translate(locale, { 'ko-KR': krLabel }, label)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
|
||||||
{icon && (
|
|
||||||
<SquareImageBox
|
|
||||||
size={30}
|
|
||||||
src={`${assetsBucketBaseUrl}/honkai3rd/${icon}.png`}
|
|
||||||
alt={translatedLabel}
|
|
||||||
mr={1}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Text>{translatedLabel}</Text>
|
|
||||||
</Flex>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ValkyrieLabel
|
|
||||||
@@ -20,7 +20,6 @@ const BattlesuitCatalogItemCard = ({ battlesuit, label = false }: BattlesuitCata
|
|||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
width: 110,
|
width: 110,
|
||||||
marginLeft: -10,
|
|
||||||
textOverflow: 'ellipsis',
|
textOverflow: 'ellipsis',
|
||||||
whiteSpace: 'nowrap'
|
whiteSpace: 'nowrap'
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
|
import { useRouter } from 'next/router'
|
||||||
|
|
||||||
export function translate(
|
export function translate(
|
||||||
targetLocale: string = 'en_US',
|
targetLocale: string = 'en_US',
|
||||||
@@ -9,3 +10,8 @@ export function translate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export { useTranslation }
|
export { useTranslation }
|
||||||
|
|
||||||
|
export function useLocale() {
|
||||||
|
const { locale } = useRouter()
|
||||||
|
return locale || 'en-US'
|
||||||
|
}
|
||||||
|
|||||||
+14
-14
@@ -1,16 +1,16 @@
|
|||||||
export const signetGroups = [
|
export const signetGroups = [
|
||||||
{ id: '1', name: '[구원]의 각인', icon: 'Kevin' },
|
{ id: '1', icon: 'Kevin' },
|
||||||
{ id: '2', name: '[황금]의 각인', icon: 'Eden' },
|
{ id: '2', icon: 'Eden' },
|
||||||
{ id: '3', name: '[오멸]의 각인', icon: 'Kalpas' },
|
{ id: '3', icon: 'Kalpas' },
|
||||||
{ id: '4', name: '[천혜]의 각인', icon: 'Su' },
|
{ id: '4', icon: 'Su' },
|
||||||
{ id: '5', name: '[찰나]의 각인', icon: 'Sakura' },
|
{ id: '5', icon: 'Sakura' },
|
||||||
{ id: '6', name: '[무한]의 각인', icon: 'Mobius' },
|
{ id: '6', icon: 'Mobius' },
|
||||||
{ id: '7', name: '[부생]의 각인', icon: 'Hua' },
|
{ id: '7', icon: 'Hua' },
|
||||||
// { id: '8', name: '[■■]의 각인', icon: 'Elysia' },
|
// { id: '8', icon: 'Elysia' },
|
||||||
// { id: '9', name: '[■■]의 각인', icon: 'Elysia' },
|
// { id: '9', icon: 'Elysia' },
|
||||||
{ id: '10', name: '[계율]의 각인', icon: 'Aponia' },
|
{ id: '10', icon: 'Aponia' },
|
||||||
{ id: '11', name: '[나선]의 각인', icon: 'Verve' },
|
{ id: '11', icon: 'Verve' },
|
||||||
{ id: '12', name: '[욱광]의 각인', icon: 'Kosma' },
|
{ id: '12', icon: 'Kosma' },
|
||||||
{ id: '13', name: '[번성]의 각인', icon: 'Griseo' },
|
{ id: '13', icon: 'Griseo' },
|
||||||
{ id: '14', name: '[환몽]의 각인', icon: 'Pardofelis' }
|
{ id: '14', icon: 'Pardofelis' }
|
||||||
]
|
]
|
||||||
|
|||||||
+173
-10
@@ -1,6 +1,24 @@
|
|||||||
import { AttributeType, CharacterType, SkillType, StigmaType, TagType, WeaponType } from './types'
|
import { AttributeType, CharacterType, SkillType, StigmaType, TagType, WeaponType } from './types'
|
||||||
|
|
||||||
export function getAttributeLabel(type: AttributeType) {
|
export function getAttributeLabel(type: AttributeType, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (type) {
|
||||||
|
case 'bio':
|
||||||
|
return 'Biologic'
|
||||||
|
case 'psy':
|
||||||
|
return 'Psychic'
|
||||||
|
case 'mech':
|
||||||
|
return 'Mecha'
|
||||||
|
case 'qua':
|
||||||
|
return 'Quantum'
|
||||||
|
case 'img':
|
||||||
|
return 'IMG'
|
||||||
|
case 'none':
|
||||||
|
return 'None'
|
||||||
|
default:
|
||||||
|
return `Unknown Attribute Type (${type})`
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'bio':
|
case 'bio':
|
||||||
return '생물'
|
return '생물'
|
||||||
@@ -19,7 +37,35 @@ export function getAttributeLabel(type: AttributeType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getWeaponTypeLabel(type: WeaponType) {
|
export function getWeaponTypeLabel(type: WeaponType, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (type) {
|
||||||
|
case 'pistols':
|
||||||
|
return 'Pistols'
|
||||||
|
case 'katana':
|
||||||
|
return 'Blade'
|
||||||
|
case 'cannon':
|
||||||
|
return 'Heavy'
|
||||||
|
case 'cross':
|
||||||
|
return 'Cross'
|
||||||
|
case '2-handed':
|
||||||
|
return '2-Handed'
|
||||||
|
case 'scythe':
|
||||||
|
return 'Scythe'
|
||||||
|
case 'lance':
|
||||||
|
return 'Lance'
|
||||||
|
case 'fists':
|
||||||
|
return 'Fists'
|
||||||
|
case 'bow':
|
||||||
|
return 'Bow'
|
||||||
|
case 'chakram':
|
||||||
|
return 'Chakram'
|
||||||
|
case 'javelin':
|
||||||
|
return 'Javelin'
|
||||||
|
default:
|
||||||
|
return `Unknown Weapon Type (${type})`
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'pistols':
|
case 'pistols':
|
||||||
return '쌍권총'
|
return '쌍권총'
|
||||||
@@ -48,7 +94,19 @@ export function getWeaponTypeLabel(type: WeaponType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getStigmaTypeLabel(type: StigmaType) {
|
export function getStigmaTypeLabel(type: StigmaType, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (type) {
|
||||||
|
case 'top':
|
||||||
|
return 'Top'
|
||||||
|
case 'mid':
|
||||||
|
return 'Mid'
|
||||||
|
case 'bot':
|
||||||
|
return 'Bot'
|
||||||
|
default:
|
||||||
|
return `Unknown Stigma Type (${type})`
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'top':
|
case 'top':
|
||||||
return '상단'
|
return '상단'
|
||||||
@@ -61,7 +119,29 @@ export function getStigmaTypeLabel(type: StigmaType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSkillTypeLabel(type: SkillType) {
|
export function getSkillTypeLabel(type: SkillType, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (type) {
|
||||||
|
case 'leader':
|
||||||
|
return 'Leader Skill'
|
||||||
|
case 'passive':
|
||||||
|
return 'Passive'
|
||||||
|
case 'evasion':
|
||||||
|
return 'Evade'
|
||||||
|
case 'special':
|
||||||
|
return 'Special Attack'
|
||||||
|
case 'ultimate':
|
||||||
|
return 'Ultimate'
|
||||||
|
case 'basic':
|
||||||
|
return 'Basic Skill'
|
||||||
|
case 'sp':
|
||||||
|
return 'SP Skill'
|
||||||
|
case 'none':
|
||||||
|
return 'None'
|
||||||
|
default:
|
||||||
|
return `Unknown Skill Type (${type})`
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'leader':
|
case 'leader':
|
||||||
return '리더 스킬'
|
return '리더 스킬'
|
||||||
@@ -70,7 +150,7 @@ export function getSkillTypeLabel(type: SkillType) {
|
|||||||
case 'evasion':
|
case 'evasion':
|
||||||
return '회피'
|
return '회피'
|
||||||
case 'special':
|
case 'special':
|
||||||
return '기본 공격'
|
return '특수 공격'
|
||||||
case 'ultimate':
|
case 'ultimate':
|
||||||
return '필살기'
|
return '필살기'
|
||||||
case 'basic':
|
case 'basic':
|
||||||
@@ -84,7 +164,7 @@ export function getSkillTypeLabel(type: SkillType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCharacterTypeLabel(type: CharacterType, locale: string = 'en-US') {
|
export function getCharacterTypeLabel(type: CharacterType, locale: string) {
|
||||||
if (locale === 'en-US') {
|
if (locale === 'en-US') {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'kiana':
|
case 'kiana':
|
||||||
@@ -249,8 +329,8 @@ export function getCharacterTypeLabel(type: CharacterType, locale: string = 'en-
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTagTypeLabel(type: TagType, locale: string = 'en-US') {
|
export function getTagTypeLabel(type: TagType, locale: string) {
|
||||||
if (type) {
|
if (locale === 'en-US') {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'branch':
|
case 'branch':
|
||||||
return 'Branch'
|
return 'Branch'
|
||||||
@@ -362,7 +442,21 @@ export function getTagTypeLabel(type: TagType, locale: string = 'en-US') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getErSignetTypeLabel(quality: number) {
|
export function getErSignetTypeLabel(quality: number, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (quality) {
|
||||||
|
case 1:
|
||||||
|
return 'Normal Signet'
|
||||||
|
case 2:
|
||||||
|
return 'Enhanced Signet'
|
||||||
|
case 3:
|
||||||
|
return 'Core Signet'
|
||||||
|
case 4:
|
||||||
|
return 'Exclusive Signet'
|
||||||
|
default:
|
||||||
|
return `Unknown (${quality})`
|
||||||
|
}
|
||||||
|
}
|
||||||
switch (quality) {
|
switch (quality) {
|
||||||
case 1:
|
case 1:
|
||||||
return '일반 각인'
|
return '일반 각인'
|
||||||
@@ -373,6 +467,75 @@ export function getErSignetTypeLabel(quality: number) {
|
|||||||
case 4:
|
case 4:
|
||||||
return '전용 각인'
|
return '전용 각인'
|
||||||
default:
|
default:
|
||||||
return `Unknown (${quality})`
|
return `Unknown Signet Type(${quality})`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSignetGroupLabel(id: string, locale: string) {
|
||||||
|
if (locale === 'en-US') {
|
||||||
|
switch (id) {
|
||||||
|
case '1':
|
||||||
|
return 'Deliverance'
|
||||||
|
case '2':
|
||||||
|
return 'Gold'
|
||||||
|
case '3':
|
||||||
|
return 'Decimation'
|
||||||
|
case '4':
|
||||||
|
return 'Bodhi'
|
||||||
|
case '5':
|
||||||
|
return 'Setsuna'
|
||||||
|
case '6':
|
||||||
|
return 'Infinity'
|
||||||
|
case '7':
|
||||||
|
return 'Vicissitude'
|
||||||
|
case '8':
|
||||||
|
return '■■'
|
||||||
|
case '9':
|
||||||
|
return '■■'
|
||||||
|
case '10':
|
||||||
|
return 'Discipline'
|
||||||
|
case '11':
|
||||||
|
return 'Helix'
|
||||||
|
case '12':
|
||||||
|
return 'Daybreak'
|
||||||
|
case '13':
|
||||||
|
return 'Stars'
|
||||||
|
case '14':
|
||||||
|
return 'Reverie'
|
||||||
|
default:
|
||||||
|
return `Unknown Signet Group (${id})`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch (id) {
|
||||||
|
case '1':
|
||||||
|
return '[구원]의 각인'
|
||||||
|
case '2':
|
||||||
|
return '[황금]의 각인'
|
||||||
|
case '3':
|
||||||
|
return '[오멸]의 각인'
|
||||||
|
case '4':
|
||||||
|
return '[천혜]의 각인'
|
||||||
|
case '5':
|
||||||
|
return '[찰나]의 각인'
|
||||||
|
case '6':
|
||||||
|
return '[무한]의 각인'
|
||||||
|
case '7':
|
||||||
|
return '[부생]의 각인'
|
||||||
|
case '8':
|
||||||
|
return '[■■]의 각인'
|
||||||
|
case '9':
|
||||||
|
return '[■■]의 각인'
|
||||||
|
case '10':
|
||||||
|
return '[계율]의 각인'
|
||||||
|
case '11':
|
||||||
|
return '[나선]의 각인'
|
||||||
|
case '12':
|
||||||
|
return '[욱광]의 각인'
|
||||||
|
case '13':
|
||||||
|
return '[번성]의 각인'
|
||||||
|
case '14':
|
||||||
|
return '[환몽]의 각인'
|
||||||
|
default:
|
||||||
|
return `Unknown Signet Group (${id})`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { BattlesuitSkill, CharacterType, TagType } from './types'
|
import { AttributeType, BattlesuitSkill, CharacterType, TagType } from './types'
|
||||||
|
|
||||||
export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) {
|
export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) {
|
||||||
return reversedSkillTypeOrder.indexOf(b.skillType) - reversedSkillTypeOrder.indexOf(a.skillType)
|
return reversedSkillTypeOrder.indexOf(b.skillType) - reversedSkillTypeOrder.indexOf(a.skillType)
|
||||||
@@ -6,6 +6,8 @@ export function sortBattlesuitSkill(a: BattlesuitSkill, b: BattlesuitSkill) {
|
|||||||
|
|
||||||
const reversedSkillTypeOrder = ['leader', 'passive', 'evasion', 'special', 'ultimate', 'basic', 'sp', 'none'].reverse()
|
const reversedSkillTypeOrder = ['leader', 'passive', 'evasion', 'special', 'ultimate', 'basic', 'sp', 'none'].reverse()
|
||||||
|
|
||||||
|
export const attributeTypes: AttributeType[] = ['bio', 'psy', 'mech', 'qua', 'img']
|
||||||
|
|
||||||
export const characterFilterTypes: CharacterType[] = [
|
export const characterFilterTypes: CharacterType[] = [
|
||||||
'kiana',
|
'kiana',
|
||||||
'mei',
|
'mei',
|
||||||
@@ -56,6 +58,6 @@ export const tagFilterTypes: TagType[] = [
|
|||||||
'gather',
|
'gather',
|
||||||
'heal',
|
'heal',
|
||||||
'fast-atk',
|
'fast-atk',
|
||||||
'aerial',
|
'burst',
|
||||||
'burst'
|
'aerial'
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import Honkai3rdLayout from '../../../components/layouts/Honkai3rdLayout'
|
|||||||
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
|
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
|
||||||
import Head from '../../../components/atoms/Head'
|
import Head from '../../../components/atoms/Head'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
|
import { useLocale } from '../../../lib/i18n'
|
||||||
|
|
||||||
interface BattlesuitShowPageProps {
|
interface BattlesuitShowPageProps {
|
||||||
battlesuit: Battlesuit
|
battlesuit: Battlesuit
|
||||||
@@ -33,6 +34,8 @@ interface BattlesuitShowPageProps {
|
|||||||
|
|
||||||
const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Honkai3rdLayout>
|
<Honkai3rdLayout>
|
||||||
<Head
|
<Head
|
||||||
@@ -41,7 +44,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
battlesuit.attributeType
|
battlesuit.attributeType
|
||||||
} / ${battlesuit.tags
|
} / ${battlesuit.tags
|
||||||
.map(tag => {
|
.map(tag => {
|
||||||
return getTagTypeLabel(tag)
|
return getTagTypeLabel(tag, locale)
|
||||||
})
|
})
|
||||||
.join(', ')}`}
|
.join(', ')}`}
|
||||||
canonicalHref={`/honkai3rd/battlesuits/${battlesuit.id}`}
|
canonicalHref={`/honkai3rd/battlesuits/${battlesuit.id}`}
|
||||||
@@ -65,16 +68,16 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
<ChibiIcon id={battlesuit.character} />
|
<ChibiIcon id={battlesuit.character} />
|
||||||
|
|
||||||
<Box ml={1} mr={2}>
|
<Box ml={1} mr={2}>
|
||||||
{getCharacterTypeLabel(battlesuit.character)}
|
{getCharacterTypeLabel(battlesuit.character, locale)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<AttributeIcon attributeType={battlesuit.attributeType} size={30} />
|
<AttributeIcon attributeType={battlesuit.attributeType} size={30} />
|
||||||
<Box ml={1} mr={2}>
|
<Box ml={1} mr={2}>
|
||||||
{getAttributeLabel(battlesuit.attributeType)}
|
{getAttributeLabel(battlesuit.attributeType, locale)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<WeaponTypeIcon type={battlesuit.weapon} />
|
<WeaponTypeIcon type={battlesuit.weapon} />
|
||||||
<Box ml={1}>{getWeaponTypeLabel(battlesuit.weapon)}</Box>
|
<Box ml={1}>{getWeaponTypeLabel(battlesuit.weapon, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex sx={{ p: 1 }}>
|
<Flex sx={{ p: 1 }}>
|
||||||
@@ -82,7 +85,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
return (
|
return (
|
||||||
<Flex key={tag} sx={{ mr: 2, alignItems: 'center' }}>
|
<Flex key={tag} sx={{ mr: 2, alignItems: 'center' }}>
|
||||||
<TagIcon type={tag} />
|
<TagIcon type={tag} />
|
||||||
<Box ml={1}>{getTagTypeLabel(tag)}</Box>
|
<Box ml={1}>{getTagTypeLabel(tag, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -108,7 +111,7 @@ const BattlesuitShowPage = ({ battlesuit }: BattlesuitShowPageProps) => {
|
|||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Box>{getSkillTypeLabel(skill.skillType)}</Box>
|
<Box>{getSkillTypeLabel(skill.skillType, locale)}</Box>
|
||||||
</Box>
|
</Box>
|
||||||
<Box sx={{ whiteSpace: 'pre-wrap', borderBottom: 'default', p: 1 }}>
|
<Box sx={{ whiteSpace: 'pre-wrap', borderBottom: 'default', p: 1 }}>
|
||||||
<FormattedText>{formatSkillInfo(skill)}</FormattedText>
|
<FormattedText>{formatSkillInfo(skill)}</FormattedText>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
/** @jsxImportSource theme-ui */
|
||||||
import { Box, Heading } from '@theme-ui/components'
|
import { Box, Heading } from '@theme-ui/components'
|
||||||
import { NextPageContext } from 'next'
|
import { NextPageContext } from 'next'
|
||||||
import { Flex, Link, Text } from 'theme-ui'
|
import { Flex, Text } from 'theme-ui'
|
||||||
import { loadBattlesuitCatalog } from '../../../lib/v2/server/loadData'
|
import { loadBattlesuitCatalog } from '../../../lib/v2/server/loadData'
|
||||||
import { BattlesuitCatalogItem, TagType } from '../../../lib/v2/data/types'
|
import { BattlesuitCatalogItem, TagType } from '../../../lib/v2/data/types'
|
||||||
import BattlesuitCatalogItemCard from '../../../components/v2/BattlesuitCatalogItemCard'
|
import BattlesuitCatalogItemCard from '../../../components/v2/BattlesuitCatalogItemCard'
|
||||||
@@ -11,13 +11,15 @@ import { useTranslation } from 'next-i18next'
|
|||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import { getI18NProps } from '../../../server/i18n'
|
import { getI18NProps } from '../../../server/i18n'
|
||||||
import FilterButton from '../../../components/atoms/FilterButton'
|
import FilterButton from '../../../components/atoms/FilterButton'
|
||||||
import { translate } from '../../../lib/i18n'
|
import { useLocale } from '../../../lib/i18n'
|
||||||
import { characterFilterTypes } from '../../../lib/v2/data/utils'
|
import { attributeTypes, characterFilterTypes, tagFilterTypes } from '../../../lib/v2/data/utils'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
import { getCharacterTypeLabel, getTagTypeLabel } from '../../../lib/v2/data/text'
|
import { getAttributeLabel, getCharacterTypeLabel, getTagTypeLabel } from '../../../lib/v2/data/text'
|
||||||
import ChibiIcon from '../../../components/v2/ChibiIcon'
|
import ChibiIcon from '../../../components/v2/ChibiIcon'
|
||||||
import TagIcon from '../../../components/v2/TagIcon'
|
import TagIcon from '../../../components/v2/TagIcon'
|
||||||
|
import AttributeIcon from '../../../components/v2/AttributeIcon'
|
||||||
|
import PageLink from '../../../components/atoms/PageLink'
|
||||||
|
|
||||||
interface BattlesuitListPageProps {
|
interface BattlesuitListPageProps {
|
||||||
battlesuitCatalog: BattlesuitCatalogItem[]
|
battlesuitCatalog: BattlesuitCatalogItem[]
|
||||||
@@ -25,7 +27,8 @@ interface BattlesuitListPageProps {
|
|||||||
|
|
||||||
const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { locale, query } = useRouter()
|
const { query } = useRouter()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
const valkyrieFilter = useMemo(() => {
|
const valkyrieFilter = useMemo(() => {
|
||||||
if (query.valkyrie == null) {
|
if (query.valkyrie == null) {
|
||||||
@@ -49,16 +52,28 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return valkyrieFilter === battlesuit.character
|
switch (valkyrieFilter) {
|
||||||
|
case 'bio':
|
||||||
|
case 'psy':
|
||||||
|
case 'mech':
|
||||||
|
case 'qua':
|
||||||
|
case 'img':
|
||||||
|
return battlesuit.attributeType === valkyrieFilter
|
||||||
|
}
|
||||||
|
|
||||||
|
return battlesuit.character === valkyrieFilter
|
||||||
})
|
})
|
||||||
}, [battlesuitCatalog, valkyrieFilter])
|
}, [battlesuitCatalog, valkyrieFilter])
|
||||||
|
|
||||||
const tagFilterTypes = useMemo(() => {
|
const tagFilterTypeOptions = useMemo(() => {
|
||||||
const tagSet = battlesuitsFilteredByValkyrie.reduce<Set<TagType>>((set, battlesuit) => {
|
const tagSet = battlesuitsFilteredByValkyrie.reduce<Set<TagType>>((set, battlesuit) => {
|
||||||
battlesuit.tags.forEach(tag => set.add(tag))
|
battlesuit.tags.forEach(tag => set.add(tag))
|
||||||
return set
|
return set
|
||||||
}, new Set())
|
}, new Set())
|
||||||
return [...tagSet]
|
|
||||||
|
return [...tagSet].sort((a, b) => {
|
||||||
|
return tagFilterTypes.indexOf(a) - tagFilterTypes.indexOf(b)
|
||||||
|
})
|
||||||
}, [battlesuitsFilteredByValkyrie])
|
}, [battlesuitsFilteredByValkyrie])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -83,26 +98,36 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
|||||||
|
|
||||||
<Heading as="h3">{t('battlesuits-list.filter-by-valkyries')}</Heading>
|
<Heading as="h3">{t('battlesuits-list.filter-by-valkyries')}</Heading>
|
||||||
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
|
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
|
||||||
|
{attributeTypes.map(type => {
|
||||||
|
const active = type === valkyrieFilter
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FilterButton key={type} active={active} href={active ? `` : `?valkyrie=${type}`} m={1}>
|
||||||
|
<Flex sx={{ alignItems: 'center' }}>
|
||||||
|
<AttributeIcon attributeType={type} size={30} />
|
||||||
|
<Text ml={1}>{getAttributeLabel(type, locale)}</Text>
|
||||||
|
</Flex>
|
||||||
|
</FilterButton>
|
||||||
|
)
|
||||||
|
})}
|
||||||
{characterFilterTypes.map(type => {
|
{characterFilterTypes.map(type => {
|
||||||
const active = type === valkyrieFilter
|
const active = type === valkyrieFilter
|
||||||
return (
|
return (
|
||||||
<FilterButton key={type} active={active} href={active ? `` : `?valkyrie=${type}`} m={1}>
|
<FilterButton key={type} active={active} href={active ? `` : `?valkyrie=${type}`} m={1}>
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
<Flex sx={{ alignItems: 'center' }}>
|
||||||
<ChibiIcon id={type} />
|
<ChibiIcon id={type} />
|
||||||
<Text ml={1}>
|
<Text ml={1}>{getCharacterTypeLabel(type, locale)}</Text>
|
||||||
{translate(locale, { 'ko-KR': getCharacterTypeLabel(type, 'ko-KR') }, getCharacterTypeLabel(type))}
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</FilterButton>
|
</FilterButton>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
{tagFilterTypes.length > 0 && (
|
{tagFilterTypeOptions.length > 0 && (
|
||||||
<>
|
<>
|
||||||
<Heading as="h3">{t('battlesuits-list.filter-by-features')}</Heading>
|
<Heading as="h3">{t('battlesuits-list.filter-by-features')}</Heading>
|
||||||
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
|
<Flex mb={2} sx={{ flexWrap: 'wrap' }}>
|
||||||
{tagFilterTypes.map(type => {
|
{tagFilterTypeOptions.map(type => {
|
||||||
const active = type === tagFilter
|
const active = type === tagFilter
|
||||||
return (
|
return (
|
||||||
<FilterButton
|
<FilterButton
|
||||||
@@ -115,9 +140,7 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
|||||||
>
|
>
|
||||||
<Flex sx={{ alignItems: 'center' }}>
|
<Flex sx={{ alignItems: 'center' }}>
|
||||||
<TagIcon type={type} />
|
<TagIcon type={type} />
|
||||||
<Text ml={1}>
|
<Text ml={1}>{getTagTypeLabel(type, locale)}</Text>
|
||||||
{translate(locale, { 'ko-KR': getTagTypeLabel(type, 'ko-KR') }, getTagTypeLabel(type))}
|
|
||||||
</Text>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
</FilterButton>
|
</FilterButton>
|
||||||
)
|
)
|
||||||
@@ -134,12 +157,13 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
|||||||
}
|
}
|
||||||
return battlesuit.tags.findIndex(tag => tag === tagFilter) > -1
|
return battlesuit.tags.findIndex(tag => tag === tagFilter) > -1
|
||||||
})
|
})
|
||||||
|
.sort(sortBattlesuits)
|
||||||
.map(battlesuit => {
|
.map(battlesuit => {
|
||||||
return (
|
return (
|
||||||
<Box key={battlesuit.id}>
|
<Box key={battlesuit.id}>
|
||||||
<Link href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
|
<PageLink href={`/honkai3rd/battlesuits/${battlesuit.id}`}>
|
||||||
<BattlesuitCatalogItemCard battlesuit={battlesuit} />
|
<BattlesuitCatalogItemCard battlesuit={battlesuit} />
|
||||||
</Link>
|
</PageLink>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -152,9 +176,35 @@ const BattlesuitListPage = ({ battlesuitCatalog }: BattlesuitListPageProps) => {
|
|||||||
export default BattlesuitListPage
|
export default BattlesuitListPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const battlesuitCatalog = loadBattlesuitCatalog()
|
const battlesuitCatalog = loadBattlesuitCatalog(locale).filter(item => {
|
||||||
|
// APHO 2
|
||||||
|
if (item.id.match(/90[0-9]{2}/)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
switch (item.id) {
|
||||||
|
// Durandal Story Only
|
||||||
|
case '805':
|
||||||
|
// Bronya Story Only?
|
||||||
|
case '316':
|
||||||
|
// APHO 1
|
||||||
|
case '1411':
|
||||||
|
case '1304':
|
||||||
|
case '1203':
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { battlesuitCatalog, ...(await getI18NProps(locale)) }
|
props: { battlesuitCatalog, ...(await getI18NProps(locale)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sortBattlesuits(a: BattlesuitCatalogItem, b: BattlesuitCatalogItem) {
|
||||||
|
return getOrderIndex(b) - getOrderIndex(a)
|
||||||
|
|
||||||
|
function getOrderIndex(battlesuit: BattlesuitCatalogItem) {
|
||||||
|
return parseInt(battlesuit.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ const ElfShowPage = ({ elf }: ElfShowPageProps) => {
|
|||||||
export default ElfShowPage
|
export default ElfShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { elfId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { elfId: string } }) {
|
||||||
const elf = loadElfData(params.elfId)
|
const elf = loadElfData(params.elfId, locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { elf, ...(await getI18NProps(locale)) }
|
props: { elf, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/** @jsxImportSource theme-ui */
|
/** @jsxImportSource theme-ui */
|
||||||
import { Box, Card, Heading } from '@theme-ui/components'
|
import { Box, Card, Heading } from '@theme-ui/components'
|
||||||
import { NextPageContext } from 'next'
|
import { NextPageContext } from 'next'
|
||||||
import { Flex, Link } from 'theme-ui'
|
import { Flex } from 'theme-ui'
|
||||||
import { ElfCatalogItem } from '../../../lib/v2/data/types'
|
import { ElfCatalogItem } from '../../../lib/v2/data/types'
|
||||||
import { loadElfCatalog } from '../../../lib/v2/server/loadData'
|
import { loadElfCatalog } from '../../../lib/v2/server/loadData'
|
||||||
import RarityBar from '../../../components/v2/RarityBar'
|
import RarityBar from '../../../components/v2/RarityBar'
|
||||||
@@ -11,6 +11,7 @@ import Head from '../../../components/atoms/Head'
|
|||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { getI18NProps } from '../../../server/i18n'
|
import { getI18NProps } from '../../../server/i18n'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
|
import PageLink from '../../../components/atoms/PageLink'
|
||||||
|
|
||||||
interface ElfListPageProps {
|
interface ElfListPageProps {
|
||||||
elfs: ElfCatalogItem[]
|
elfs: ElfCatalogItem[]
|
||||||
@@ -34,7 +35,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
|
|||||||
{ href: '/honkai3rd/elfs', label: t('common.elfs') }
|
{ href: '/honkai3rd/elfs', label: t('common.elfs') }
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Heading as="h1">Elfs</Heading>
|
<Heading as="h1">{t('elfs-list.elfs')}</Heading>
|
||||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||||
{elfs
|
{elfs
|
||||||
.sort((a, b) => {
|
.sort((a, b) => {
|
||||||
@@ -49,7 +50,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
|
|||||||
.map(elf => {
|
.map(elf => {
|
||||||
return (
|
return (
|
||||||
<Box key={elf.id} m={2}>
|
<Box key={elf.id} m={2}>
|
||||||
<Link href={`/honkai3rd/elfs/${elf.id}`}>
|
<PageLink href={`/honkai3rd/elfs/${elf.id}`}>
|
||||||
<Card p={1}>
|
<Card p={1}>
|
||||||
<Box>
|
<Box>
|
||||||
<ElfIcon icon={elf.cardIcon} />
|
<ElfIcon icon={elf.cardIcon} />
|
||||||
@@ -61,7 +62,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
|
|||||||
{elf.fullName}
|
{elf.fullName}
|
||||||
</Box>
|
</Box>
|
||||||
</Card>
|
</Card>
|
||||||
</Link>
|
</PageLink>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
@@ -74,7 +75,7 @@ const ElfListPage = ({ elfs }: ElfListPageProps) => {
|
|||||||
export default ElfListPage
|
export default ElfListPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const elfs = loadElfCatalog()
|
const elfs = loadElfCatalog(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { elfs, ...(await getI18NProps(locale)) }
|
props: { elfs, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ const BattlesuitShowPage = ({ battlesuit, erBattlesuit }: BattlesuitShowPageProp
|
|||||||
export default BattlesuitShowPage
|
export default BattlesuitShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { battlesuitId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { battlesuitId: string } }) {
|
||||||
const battlesuit = loadBattlesuitData(params.battlesuitId)
|
const battlesuit = loadBattlesuitData(params.battlesuitId, locale)
|
||||||
const erBattlesuit = loadErBattlesuit(params.battlesuitId)
|
const erBattlesuit = loadErBattlesuit(params.battlesuitId, locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { battlesuit, erBattlesuit, ...(await getI18NProps(locale)) }
|
props: { battlesuit, erBattlesuit, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
|||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { getI18NProps } from '../../../server/i18n'
|
import { getI18NProps } from '../../../server/i18n'
|
||||||
import PageLink from '../../../components/atoms/PageLink'
|
import PageLink from '../../../components/atoms/PageLink'
|
||||||
|
import { getSignetGroupLabel } from '../../../lib/v2/data/text'
|
||||||
|
import { useLocale } from '../../../lib/i18n'
|
||||||
|
|
||||||
interface ErPageProps {
|
interface ErPageProps {
|
||||||
erBattlesuitCatalog: ErBattlesuitCatalogItem[]
|
erBattlesuitCatalog: ErBattlesuitCatalogItem[]
|
||||||
@@ -31,6 +33,7 @@ interface ErPageProps {
|
|||||||
|
|
||||||
const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }: ErPageProps) => {
|
const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }: ErPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
const battlesuitCatalogMap = useMemo(() => {
|
const battlesuitCatalogMap = useMemo(() => {
|
||||||
return battlesuitCatalog.reduce((map, item) => {
|
return battlesuitCatalog.reduce((map, item) => {
|
||||||
@@ -57,9 +60,9 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Heading as="h1">Elysian Realm</Heading>
|
<Heading as="h1">{t('elysian-realm.elysian-realm')}</Heading>
|
||||||
|
|
||||||
<Heading as="h2">Signets</Heading>
|
<Heading as="h2">{t('elysian-realm.signets')}</Heading>
|
||||||
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
|
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
|
||||||
{signetGroups.map(signetGroup => {
|
{signetGroups.map(signetGroup => {
|
||||||
return (
|
return (
|
||||||
@@ -71,7 +74,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
originalSize={120}
|
originalSize={120}
|
||||||
size={40}
|
size={40}
|
||||||
/>
|
/>
|
||||||
<Box p={1}>{signetGroup.name}</Box>
|
<Box p={1}>{getSignetGroupLabel(signetGroup.id, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Card>
|
</Card>
|
||||||
</PageLink>
|
</PageLink>
|
||||||
@@ -79,7 +82,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
})}
|
})}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Heading as="h2">Battlesuits</Heading>
|
<Heading as="h2">{t('elysian-realm.battlesuits')}</Heading>
|
||||||
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
|
<Flex sx={{ flexWrap: 'wrap', mb: 3 }}>
|
||||||
{erBattlesuitCatalog.map(erBattlesuit => {
|
{erBattlesuitCatalog.map(erBattlesuit => {
|
||||||
const battlesuit = battlesuitCatalogMap.get(erBattlesuit.battlesuit)!
|
const battlesuit = battlesuitCatalogMap.get(erBattlesuit.battlesuit)!
|
||||||
@@ -93,7 +96,7 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
})}
|
})}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Heading as="h2">Supports</Heading>
|
<Heading as="h2">{t('elysian-realm.supports')}</Heading>
|
||||||
|
|
||||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||||
{erSupports.map(support => {
|
{erSupports.map(support => {
|
||||||
@@ -109,14 +112,13 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
{battlesuit.fullName}
|
{battlesuit.fullName}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
{/* <BattlesuitCatalogItemCard battlesuit={battlesuit} /> */}
|
|
||||||
</PageLink>
|
</PageLink>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Heading as="h2">Sigils</Heading>
|
<Heading as="h2">{t('elysian-realm.remembrance-sigil')}</Heading>
|
||||||
|
|
||||||
<Flex sx={{ flexWrap: 'wrap' }}>
|
<Flex sx={{ flexWrap: 'wrap' }}>
|
||||||
{erSigils.map(sigil => {
|
{erSigils.map(sigil => {
|
||||||
@@ -137,13 +139,13 @@ const ErPage = ({ erBattlesuitCatalog, battlesuitCatalog, erSupports, erSigils }
|
|||||||
export default ErPage
|
export default ErPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const erBattlesuitCatalog = loadErBattlesuitCatalog()
|
const erBattlesuitCatalog = loadErBattlesuitCatalog(locale)
|
||||||
const battlesuitCatalog = loadBattlesuitCatalog()
|
const battlesuitCatalog = loadBattlesuitCatalog(locale)
|
||||||
const erSupports = loadErSupports().map(support => {
|
const erSupports = loadErSupports(locale).map(support => {
|
||||||
return support.battlesuit
|
return support.battlesuit
|
||||||
})
|
})
|
||||||
|
|
||||||
const erSigils = loadErSigils().map(sigil => {
|
const erSigils = loadErSigils(locale).map(sigil => {
|
||||||
return {
|
return {
|
||||||
id: sigil.id,
|
id: sigil.id,
|
||||||
name: sigil.name
|
name: sigil.name
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
|
|||||||
title={`${t('elysian-realm.remembrance-sigil')} (${t('common.elysian-realm')}) - ${t(
|
title={`${t('elysian-realm.remembrance-sigil')} (${t('common.elysian-realm')}) - ${t(
|
||||||
'common.honkai-3rd'
|
'common.honkai-3rd'
|
||||||
)} - ${t('common.abyss-lab')}`}
|
)} - ${t('common.abyss-lab')}`}
|
||||||
description={`${t('common.elysian-realm')} ${t('elysian-realm.supports')}`}
|
description={`${t('common.elysian-realm')} ${t('elysian-realm.remembrance-sigil')}`}
|
||||||
canonicalHref={`/honkai3rd/er/sigils`}
|
canonicalHref={`/honkai3rd/er/sigils`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Heading as="h1">ER Sigils</Heading>
|
<Heading as="h1">{t('elysian-realm.remembrance-sigil')}</Heading>
|
||||||
|
|
||||||
<Card mb={3}>
|
<Card mb={3}>
|
||||||
{erSigils.map(sigil => {
|
{erSigils.map(sigil => {
|
||||||
@@ -76,7 +76,7 @@ const SigilsPage = ({ erSigils }: SigilsPageProps) => {
|
|||||||
export default SigilsPage
|
export default SigilsPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const erSigils = loadErSigils()
|
const erSigils = loadErSigils(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { erSigils, ...(await getI18NProps(locale)) }
|
props: { erSigils, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import { Fragment, useMemo } from 'react'
|
|||||||
import { assetsBucketBaseUrl } from '../../../../lib/consts'
|
import { assetsBucketBaseUrl } from '../../../../lib/consts'
|
||||||
import { signetGroups } from '../../../../lib/v2/data/er'
|
import { signetGroups } from '../../../../lib/v2/data/er'
|
||||||
import SquareImage from '../../../../components/v2/SquareImage'
|
import SquareImage from '../../../../components/v2/SquareImage'
|
||||||
import { getErSignetTypeLabel } from '../../../../lib/v2/data/text'
|
import { getErSignetTypeLabel, getSignetGroupLabel } from '../../../../lib/v2/data/text'
|
||||||
import Honkai3rdLayout from '../../../../components/layouts/Honkai3rdLayout'
|
import Honkai3rdLayout from '../../../../components/layouts/Honkai3rdLayout'
|
||||||
import Head from '../../../../components/atoms/Head'
|
import Head from '../../../../components/atoms/Head'
|
||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import Breadcrumb from '../../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../../components/organisms/Breadcrumb'
|
||||||
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
|
import { generateI18NPaths, getI18NProps } from '../../../../server/i18n'
|
||||||
|
import { useLocale } from '../../../../lib/i18n'
|
||||||
|
|
||||||
interface BattlesuitShowPageProps {
|
interface BattlesuitShowPageProps {
|
||||||
group: ErSignetGroup
|
group: ErSignetGroup
|
||||||
@@ -20,6 +21,7 @@ interface BattlesuitShowPageProps {
|
|||||||
|
|
||||||
const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
|
const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
const signetSets = useMemo(() => {
|
const signetSets = useMemo(() => {
|
||||||
const signetSetMap = signets.reduce<Map<string, ErSignet[]>>((map, signet) => {
|
const signetSetMap = signets.reduce<Map<string, ErSignet[]>>((map, signet) => {
|
||||||
@@ -56,7 +58,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
href: `/honkai3rd/er/signets/${group.id}`,
|
href: `/honkai3rd/er/signets/${group.id}`,
|
||||||
label: group.name
|
label: getSignetGroupLabel(group.id, locale)
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
@@ -77,7 +79,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
|
|||||||
<Heading as="h3" my={0} ml={1}>
|
<Heading as="h3" my={0} ml={1}>
|
||||||
{signet.name}
|
{signet.name}
|
||||||
</Heading>
|
</Heading>
|
||||||
<Box sx={{ ml: 12, color: 'textMuted' }}>{getErSignetTypeLabel(signet.quality)}</Box>
|
<Box sx={{ ml: 1, color: 'textMuted' }}>{getErSignetTypeLabel(signet.quality, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Box sx={{ p: 1, borderBottom: 'default', '&:last-child': { borderBottom: 'none' } }}>
|
<Box sx={{ p: 1, borderBottom: 'default', '&:last-child': { borderBottom: 'none' } }}>
|
||||||
{signet.desc}
|
{signet.desc}
|
||||||
@@ -100,7 +102,7 @@ const BattlesuitShowPage = ({ signets, group }: BattlesuitShowPageProps) => {
|
|||||||
export default BattlesuitShowPage
|
export default BattlesuitShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { groupId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { groupId: string } }) {
|
||||||
const signets = loadErSignets(params.groupId)
|
const signets = loadErSignets(params.groupId, locale)
|
||||||
const group = signetGroups.find(group => group.id === params.groupId)
|
const group = signetGroups.find(group => group.id === params.groupId)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const SupportsPage = ({
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Heading as="h1">ER Supports</Heading>
|
<Heading as="h1">{t('elysian-realm.supports')}</Heading>
|
||||||
|
|
||||||
<Card mb={3}>
|
<Card mb={3}>
|
||||||
{erSupports.map(support => {
|
{erSupports.map(support => {
|
||||||
@@ -84,8 +84,8 @@ const SupportsPage = ({
|
|||||||
export default SupportsPage
|
export default SupportsPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const battlesuitCatalog = loadBattlesuitCatalog()
|
const battlesuitCatalog = loadBattlesuitCatalog(locale)
|
||||||
const erSupports = loadErSupports()
|
const erSupports = loadErSupports(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { battlesuitCatalog, erSupports, ...(await getI18NProps(locale)) }
|
props: { battlesuitCatalog, erSupports, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ const StigmataSetShowPage = ({ stigmataSet, stigmata }: StigmataSetShowPage) =>
|
|||||||
export default StigmataSetShowPage
|
export default StigmataSetShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmataSetId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmataSetId: string } }) {
|
||||||
const stigmataSet = loadStigmataSetData(params.stigmataSetId)
|
const stigmataSet = loadStigmataSetData(params.stigmataSetId, locale)
|
||||||
const stigmata = stigmataSet.stigmaIdList.map(id => {
|
const stigmata = stigmataSet.stigmaIdList.map(id => {
|
||||||
return loadStigmaData(id)
|
return loadStigmaData(id, locale)
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const StigmataSetListPage = ({ stigmataSetCatalog }: StigmataSetListPageProps) =
|
|||||||
export default StigmataSetListPage
|
export default StigmataSetListPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const stigmataSetCatalog = loadStigmataSetCatalog()
|
const stigmataSetCatalog = loadStigmataSetCatalog(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { stigmataSetCatalog, ...(await getI18NProps(locale)) }
|
props: { stigmataSetCatalog, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import Head from '../../../components/atoms/Head'
|
|||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
import PageLink from '../../../components/atoms/PageLink'
|
import PageLink from '../../../components/atoms/PageLink'
|
||||||
|
import { useLocale } from '../../../lib/i18n'
|
||||||
|
|
||||||
interface StigmaShowPageProps {
|
interface StigmaShowPageProps {
|
||||||
rootStigma: RootStigma
|
rootStigma: RootStigma
|
||||||
@@ -23,6 +24,7 @@ interface StigmaShowPageProps {
|
|||||||
|
|
||||||
const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPageProps) => {
|
const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
const stigma = rootStigma.stigmata[rootStigma.stigmata.length - 1]
|
const stigma = rootStigma.stigmata[rootStigma.stigmata.length - 1]
|
||||||
|
|
||||||
@@ -70,7 +72,7 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
|
|||||||
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(stigma.description)}</Box>
|
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(stigma.description)}</Box>
|
||||||
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
|
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
|
||||||
<StigmaTypeIcon type={stigma.type} />
|
<StigmaTypeIcon type={stigma.type} />
|
||||||
<Box ml={1}>{getStigmaTypeLabel(stigma.type)}</Box>
|
<Box ml={1}>{getStigmaTypeLabel(stigma.type, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Box sx={{ p: 1 }}>
|
<Box sx={{ p: 1 }}>
|
||||||
HP : {hp} / ATK : {atk} / DEF : {def} / CRT : {crt} (at Max Lv {stigma.maxLv})
|
HP : {hp} / ATK : {atk} / DEF : {def} / CRT : {crt} (at Max Lv {stigma.maxLv})
|
||||||
@@ -148,7 +150,7 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
|
|||||||
</Flex>
|
</Flex>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{/* <pre>{JSON.stringify(weapon, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(stigma, null, 2)}</pre> */}
|
||||||
</Box>
|
</Box>
|
||||||
</Honkai3rdLayout>
|
</Honkai3rdLayout>
|
||||||
)
|
)
|
||||||
@@ -157,14 +159,14 @@ const StigmaShowPage = ({ rootStigma, stigmataSetCatalogItem }: StigmaShowPagePr
|
|||||||
export default StigmaShowPage
|
export default StigmaShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmaId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { stigmaId: string } }) {
|
||||||
const rootStigma = loadStigmaData(params.stigmaId)
|
const rootStigma = loadStigmaData(params.stigmaId, locale)
|
||||||
const setId = rootStigma.stigmata[0].setId
|
const setId = rootStigma.stigmata[0].setId
|
||||||
|
|
||||||
let stigmataSetCatalogItem: StigmataSetCatalogItem | null = null
|
let stigmataSetCatalogItem: StigmataSetCatalogItem | null = null
|
||||||
if (setId !== '0') {
|
if (setId !== '0') {
|
||||||
const stigmataSet = loadStigmataSetData(setId)
|
const stigmataSet = loadStigmataSetData(setId, locale)
|
||||||
const setStigmataList = stigmataSet.stigmaIdList.map(id => {
|
const setStigmataList = stigmataSet.stigmaIdList.map(id => {
|
||||||
const targetRootStigma = params.stigmaId === id ? rootStigma : loadStigmaData(id)
|
const targetRootStigma = params.stigmaId === id ? rootStigma : loadStigmaData(id, locale)
|
||||||
const maxedStigma = targetRootStigma.stigmata[targetRootStigma.stigmata.length - 1]
|
const maxedStigma = targetRootStigma.stigmata[targetRootStigma.stigmata.length - 1]
|
||||||
return {
|
return {
|
||||||
id: targetRootStigma.id,
|
id: targetRootStigma.id,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => {
|
|||||||
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') }
|
{ href: '/honkai3rd/stigmata', label: t('common.stigmata') }
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Heading as="h1">Stigmata (Single)</Heading>
|
<Heading as="h1">{t('stigmata-list.stigmata-single')}</Heading>
|
||||||
|
|
||||||
<Box mb={3}>
|
<Box mb={3}>
|
||||||
<PageLink href="/honkai3rd/stigmata-sets">{t('stigmata-list.show-set-list')}</PageLink>
|
<PageLink href="/honkai3rd/stigmata-sets">{t('stigmata-list.show-set-list')}</PageLink>
|
||||||
@@ -70,7 +70,7 @@ const StigmataListPage = ({ stigmataCatalog }: StigmataListPageProps) => {
|
|||||||
export default StigmataListPage
|
export default StigmataListPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const stigmataCatalog = loadStigmataCatalog()
|
const stigmataCatalog = loadStigmataCatalog(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { stigmataCatalog, ...(await getI18NProps(locale)) }
|
props: { stigmataCatalog, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import Head from '../../../components/atoms/Head'
|
|||||||
import { useTranslation } from 'next-i18next'
|
import { useTranslation } from 'next-i18next'
|
||||||
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
|
import { generateI18NPaths, getI18NProps } from '../../../server/i18n'
|
||||||
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
import Breadcrumb from '../../../components/organisms/Breadcrumb'
|
||||||
|
import { useLocale } from '../../../lib/i18n'
|
||||||
|
|
||||||
interface WeaponShowPageProps {
|
interface WeaponShowPageProps {
|
||||||
rootWeapon: RootWeaponData
|
rootWeapon: RootWeaponData
|
||||||
@@ -20,9 +21,11 @@ interface WeaponShowPageProps {
|
|||||||
|
|
||||||
const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
|
const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const locale = useLocale()
|
||||||
|
|
||||||
const weapon = rootWeapon.weapons[rootWeapon.weapons.length - 1]
|
const weapon = rootWeapon.weapons[rootWeapon.weapons.length - 1]
|
||||||
|
|
||||||
const weaponTypeLabel = getWeaponTypeLabel(weapon.type)
|
const weaponTypeLabel = getWeaponTypeLabel(weapon.type, locale)
|
||||||
const atk = Math.floor(weapon.attackBase + weapon.attackAdd * (weapon.maxLv - 1))
|
const atk = Math.floor(weapon.attackBase + weapon.attackAdd * (weapon.maxLv - 1))
|
||||||
const crt = Math.floor(weapon.criticalBase + weapon.criticalAdd * (weapon.maxLv - 1))
|
const crt = Math.floor(weapon.criticalBase + weapon.criticalAdd * (weapon.maxLv - 1))
|
||||||
|
|
||||||
@@ -54,7 +57,7 @@ const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
|
|||||||
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(weapon.description)}</Box>
|
<Box sx={{ p: 1, borderBottom: 'default' }}>{replaceNewLine(weapon.description)}</Box>
|
||||||
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
|
<Flex sx={{ alignItems: 'center', p: 1, borderBottom: 'default' }}>
|
||||||
<WeaponTypeIcon type={weapon.type} />
|
<WeaponTypeIcon type={weapon.type} />
|
||||||
<Box ml={1}>{getWeaponTypeLabel(weapon.type)}</Box>
|
<Box ml={1}>{getWeaponTypeLabel(weapon.type, locale)}</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Box sx={{ p: 1 }}>
|
<Box sx={{ p: 1 }}>
|
||||||
ATK : {atk} / CRT : {crt} (at Max Lv {weapon.maxLv})
|
ATK : {atk} / CRT : {crt} (at Max Lv {weapon.maxLv})
|
||||||
@@ -112,7 +115,7 @@ const WeaponShowPage = ({ rootWeapon }: WeaponShowPageProps) => {
|
|||||||
export default WeaponShowPage
|
export default WeaponShowPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale, params }: NextPageContext & { params: { weaponId: string } }) {
|
export async function getStaticProps({ locale, params }: NextPageContext & { params: { weaponId: string } }) {
|
||||||
const rootWeapon = loadWeaponData(params.weaponId)
|
const rootWeapon = loadWeaponData(params.weaponId, locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { rootWeapon, ...(await getI18NProps(locale)) }
|
props: { rootWeapon, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const WeaponListPage = ({ weaponCatalog }: WeaponListPageProps) => {
|
|||||||
export default WeaponListPage
|
export default WeaponListPage
|
||||||
|
|
||||||
export async function getStaticProps({ locale }: NextPageContext) {
|
export async function getStaticProps({ locale }: NextPageContext) {
|
||||||
const weaponCatalog = loadWeaponCatalog()
|
const weaponCatalog = loadWeaponCatalog(locale)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: { weaponCatalog, ...(await getI18NProps(locale)) }
|
props: { weaponCatalog, ...(await getI18NProps(locale)) }
|
||||||
|
|||||||
Reference in New Issue
Block a user