Add conditional for earring values

This commit is contained in:
Justin Edmund 2023-01-20 21:50:27 -08:00
parent a4d6321d64
commit cd3d96d36f

View file

@ -1,5 +1,10 @@
// Core dependencies // Core dependencies
import React, { useCallback, useEffect, useState } from 'react' import React, {
PropsWithChildren,
useCallback,
useEffect,
useState,
} from 'react'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next' import { useTranslation } from 'next-i18next'
import { AxiosResponse } from 'axios' import { AxiosResponse } from 'axios'
@ -56,7 +61,6 @@ interface GridCharacterObject {
interface Props { interface Props {
gridCharacter: GridCharacter gridCharacter: GridCharacter
children?: React.ReactNode
open: boolean open: boolean
onOpenChange: (open: boolean) => void onOpenChange: (open: boolean) => void
} }
@ -66,7 +70,7 @@ const CharacterModal = ({
children, children,
open: modalOpen, open: modalOpen,
onOpenChange, onOpenChange,
}: Props) => { }: PropsWithChildren<Props>) => {
const router = useRouter() const router = useRouter()
const locale = const locale =
router.locale && ['en', 'ja'].includes(router.locale) ? router.locale : 'en' router.locale && ['en', 'ja'].includes(router.locale) ? router.locale : 'en'
@ -239,8 +243,8 @@ const CharacterModal = ({
<SelectWithInput <SelectWithInput
object="earring" object="earring"
dataSet={earringData} dataSet={earringData}
selectValue={earring.modifier} selectValue={earring.modifier ? earring.modifier : 0}
inputValue={earring.strength} inputValue={earring.strength ? earring.strength : 0}
sendValidity={receiveValidity} sendValidity={receiveValidity}
sendValues={receiveEarringValues} sendValues={receiveEarringValues}
/> />