From 66e4ee94c638fe326d37e6d1ec22f92ebf6ec371 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 11 Apr 2023 04:12:39 -0700 Subject: [PATCH] Fix transcendence popover levels --- components/uncap/TranscendencePopover/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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}