From ed713984f16d1137997c03edfb0688d2120b2998 Mon Sep 17 00:00:00 2001 From: Max <5008@generative.xyz> Date: Thu, 5 Sep 2024 11:26:22 +0700 Subject: [PATCH] fix check lego --- src/modules/blockchains/Buy/component4/BoxOption/index.tsx | 4 ++-- .../blockchains/Buy/component4/ExtendsInput/index.tsx | 2 +- src/modules/blockchains/Buy/component4/Input/index.tsx | 4 ++-- src/modules/blockchains/Buy/component4/Lego/index.tsx | 6 ++++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/modules/blockchains/Buy/component4/BoxOption/index.tsx b/src/modules/blockchains/Buy/component4/BoxOption/index.tsx index e759dd65b..389b65e35 100644 --- a/src/modules/blockchains/Buy/component4/BoxOption/index.tsx +++ b/src/modules/blockchains/Buy/component4/BoxOption/index.tsx @@ -200,7 +200,6 @@ const BoxOption = ({ checked = true; } } - return ( f.section === section.key) ?.map((item) => { - let checked = false; return item.fields.map((field) => { + let checked = false; + if (allThisDappForm.length > 0) { for (const key in formDappSignal.value) { if ( diff --git a/src/modules/blockchains/Buy/component4/ExtendsInput/index.tsx b/src/modules/blockchains/Buy/component4/ExtendsInput/index.tsx index 3b8b35292..6c7e652f6 100644 --- a/src/modules/blockchains/Buy/component4/ExtendsInput/index.tsx +++ b/src/modules/blockchains/Buy/component4/ExtendsInput/index.tsx @@ -149,7 +149,7 @@ const ExtendsInput = ({ if (typeof formDappToggle[key] !== 'undefined') { setToggle(formDappToggle[key]); } else { - formDappToggle = { + formDappSignal.value = { ...formDappToggle, [key]: Boolean(value), }; diff --git a/src/modules/blockchains/Buy/component4/Input/index.tsx b/src/modules/blockchains/Buy/component4/Input/index.tsx index 16269a33e..815567b55 100644 --- a/src/modules/blockchains/Buy/component4/Input/index.tsx +++ b/src/modules/blockchains/Buy/component4/Input/index.tsx @@ -70,14 +70,14 @@ const Input = ({ const key = FormDappUtil.getKeyForm(props, props, name); // console.log( - // 'formDappInput -> ', + // 'formDappInput222', // key, // formTemplateDappSignal.value, // formDappInput[key], // ); if (typeof formDappInput[key] === 'undefined') { - formDappInput = { + formDappSignal.value = { ...formDappInput, [key]: '', }; diff --git a/src/modules/blockchains/Buy/component4/Lego/index.tsx b/src/modules/blockchains/Buy/component4/Lego/index.tsx index 18ed4e923..88a93926f 100644 --- a/src/modules/blockchains/Buy/component4/Lego/index.tsx +++ b/src/modules/blockchains/Buy/component4/Lego/index.tsx @@ -105,6 +105,12 @@ const Lego = (props: Props) => { icon || null; + if(props.infoLego?.title === 'Staking') { + console.log('checked', checked); + + } + + return (