From bbfdb1e984d50e1346ddf1a46ce13d247e1cc6ed Mon Sep 17 00:00:00 2001 From: Kamil Pyszkowski Date: Tue, 3 Oct 2023 10:52:03 +0200 Subject: [PATCH] Add ConfirmStakingParamsModal's acknowledgement checkbox --- .../Modal/ConfirmStakingParams/index.tsx | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/Modal/ConfirmStakingParams/index.tsx b/src/components/Modal/ConfirmStakingParams/index.tsx index eeeec0291..580919e8a 100644 --- a/src/components/Modal/ConfirmStakingParams/index.tsx +++ b/src/components/Modal/ConfirmStakingParams/index.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect, useRef, useState } from "react" +import { ChangeEventHandler, FC, useEffect, useRef, useState } from "react" import { useWeb3React } from "@web3-react/core" import { BodyLg, @@ -14,6 +14,7 @@ import { List, ListItem, HStack, + Checkbox, } from "@threshold-network/components" import { FormikProps } from "formik" import withBaseModal from "../withBaseModal" @@ -29,6 +30,7 @@ import { featureFlags } from "../../../constants" import { useStakeTransaction } from "../../../web3/hooks/useStakeTransaction" import { formatTokenAmount } from "../../../utils/formatAmount" import ModalCloseButton from "../ModalCloseButton" +import Link from "../../Link" const ConfirmStakingParamsModal: FC< BaseModalProps & { stakeAmount: string } @@ -39,6 +41,18 @@ const ConfirmStakingParamsModal: FC< const { account } = useWeb3React() const { updateState } = useStakingState() const checkIfProviderUsed = useCheckDuplicateProviderAddress() + const [isAcknowledgementChecked, setIsAcknowledgementChecked] = + useState(false) + + const handleAcknowledgementCheckbox: ChangeEventHandler = ( + event + ) => { + const { + target: { checked }, + } = event + + setIsAcknowledgementChecked(checked) + } // stake transaction, opens success modal on success callback // not needed once MAS is launched @@ -123,12 +137,26 @@ const ConfirmStakingParamsModal: FC< + + + I acknowledge that staking in Threshold requires running a node.  + + Read more + + -