From 5bb5652aefae359dc8a03573fb88bcc88677b14b Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 22 Jan 2023 20:54:30 -0800 Subject: [PATCH] Wire up API call to callback for summons --- components/ExtraSummons/index.tsx | 2 ++ components/SummonGrid/index.tsx | 5 +++++ components/SummonUnit/index.tsx | 8 ++++++++ 3 files changed, 15 insertions(+) diff --git a/components/ExtraSummons/index.tsx b/components/ExtraSummons/index.tsx index ea3f7993..58383ede 100644 --- a/components/ExtraSummons/index.tsx +++ b/components/ExtraSummons/index.tsx @@ -14,6 +14,7 @@ interface Props { removeSummon: (id: string) => void updateObject: (object: SearchableObject, position: number) => void updateUncap: (id: string, position: number, uncap: number) => void + updateTranscendence: (id: string, position: number, stage: number) => void } const ExtraSummons = (props: Props) => { @@ -36,6 +37,7 @@ const ExtraSummons = (props: Props) => { gridSummon={props.grid[props.offset + i]} updateObject={props.updateObject} updateUncap={props.updateUncap} + updateTranscendence={props.updateTranscendence} /> ) diff --git a/components/SummonGrid/index.tsx b/components/SummonGrid/index.tsx index 0df99f4b..25f19e61 100644 --- a/components/SummonGrid/index.tsx +++ b/components/SummonGrid/index.tsx @@ -377,6 +377,7 @@ const SummonGrid = (props: Props) => { removeSummon={removeSummon} updateObject={receiveSummonFromSearch} updateUncap={initiateUncapUpdate} + updateTranscendence={initiateTranscendenceUpdate} /> ) @@ -390,8 +391,10 @@ const SummonGrid = (props: Props) => { key="grid_friend_summon" position={6} unitType={2} + removeSummon={removeSummon} updateObject={receiveSummonFromSearch} updateUncap={initiateUncapUpdate} + updateTranscendence={initiateTranscendenceUpdate} /> ) @@ -411,6 +414,7 @@ const SummonGrid = (props: Props) => { removeSummon={removeSummon} updateObject={receiveSummonFromSearch} updateUncap={initiateUncapUpdate} + updateTranscendence={initiateTranscendenceUpdate} /> ) @@ -428,6 +432,7 @@ const SummonGrid = (props: Props) => { removeSummon={removeSummon} updateObject={receiveSummonFromSearch} updateUncap={initiateUncapUpdate} + updateTranscendence={initiateTranscendenceUpdate} /> ) diff --git a/components/SummonUnit/index.tsx b/components/SummonUnit/index.tsx index f393252a..63346678 100644 --- a/components/SummonUnit/index.tsx +++ b/components/SummonUnit/index.tsx @@ -29,6 +29,7 @@ interface Props { removeSummon: (id: string) => void updateObject: (object: SearchableObject, position: number) => void updateUncap: (id: string, position: number, uncap: number) => void + updateTranscendence: (id: string, position: number, stage: number) => void } const SummonUnit = ({ @@ -39,6 +40,7 @@ const SummonUnit = ({ removeSummon: sendSummonToRemove, updateObject, updateUncap, + updateTranscendence, }: Props) => { // Translations and locale const { t } = useTranslation('common') @@ -105,6 +107,10 @@ const SummonUnit = ({ if (gridSummon) updateUncap(gridSummon.id, position, uncap) } + function passTranscendenceData(stage: number) { + if (gridSummon) updateTranscendence(gridSummon.id, position, stage) + } + function removeSummon() { if (gridSummon) sendSummonToRemove(gridSummon.id) } @@ -246,8 +252,10 @@ const SummonUnit = ({ xlb={gridSummon.object.uncap.xlb || false} editable={editable} uncapLevel={gridSummon.uncap_level} + transcendenceStage={gridSummon.transcendence_step} position={gridSummon.position} updateUncap={passUncapData} + updateTranscendence={passTranscendenceData} special={false} /> ) : (