diff --git a/components/uncap/TranscendencePopover/index.tsx b/components/uncap/TranscendencePopover/index.tsx index a5149ce0..de69b163 100644 --- a/components/uncap/TranscendencePopover/index.tsx +++ b/components/uncap/TranscendencePopover/index.tsx @@ -16,6 +16,7 @@ interface Props React.DialogHTMLAttributes, HTMLDivElement > { + type: 'character' | 'summon' open: boolean stage: number onOpenChange?: (open: boolean) => void @@ -25,6 +26,7 @@ interface Props const TranscendencePopover = ({ children, open: popoverOpen, + type, stage, tabIndex, onOpenChange, @@ -33,7 +35,7 @@ const TranscendencePopover = ({ const { t } = useTranslation('common') const [open, setOpen] = useState(false) - + const [baseLevel, setBaseLevel] = useState(0) const [currentStage, setCurrentStage] = useState(0) const popoverRef = React.createRef() @@ -51,9 +53,14 @@ const TranscendencePopover = ({ }, []) useEffect(() => { - setCurrentStage(stage) + if (stage) setCurrentStage(stage) }, [stage]) + useEffect(() => { + if (type === 'character') setBaseLevel(100) + else if (type === 'summon') setBaseLevel(200) + }, [type]) + useEffect(() => { setOpen(popoverOpen) }, [popoverOpen]) @@ -81,7 +88,7 @@ const TranscendencePopover = ({ />

{t('level')}  - {200 + 10 * currentStage} + {baseLevel + 10 * currentStage}