From edb1868a5385acd617dfe433d0f84ef7f0595e55 Mon Sep 17 00:00:00 2001 From: David Totraev Date: Wed, 23 Oct 2024 20:37:20 +0500 Subject: [PATCH] feat(phase-2): EOI modal --- src/app/components/Modals/EOIModal.tsx | 72 ++++++++++++++++++++++++++ src/app/components/Staking/Staking.tsx | 11 ++++ 2 files changed, 83 insertions(+) create mode 100644 src/app/components/Modals/EOIModal.tsx diff --git a/src/app/components/Modals/EOIModal.tsx b/src/app/components/Modals/EOIModal.tsx new file mode 100644 index 00000000..e8ca5ced --- /dev/null +++ b/src/app/components/Modals/EOIModal.tsx @@ -0,0 +1,72 @@ +import { AiOutlineSignature } from "react-icons/ai"; +import { IoMdCheckmark, IoMdClose } from "react-icons/io"; + +import { GeneralModal } from "./GeneralModal"; + +type Status = "unsigned" | "signed" | "processing"; + +interface EOIModalProps { + statuses: { + slashing: Status; + unbonding: Status; + reward: Status; + eoi: Status; + }; + open: boolean; + onClose: (value: boolean) => void; +} + +const STATUS_ICON = { + unsigned: , + signed: , + processing: ( + + ), +} as const; + +export function EOIModal({ open, statuses, onClose }: EOIModalProps) { + return ( + +
+

Staking Express Of Interest

+ +
+ +
+

+ Please sign the messages below to prepare your staking + express-of-interest (EOI): +

+ +
    +
  • + {STATUS_ICON[statuses.slashing]} + Consent to slashing +
  • +
  • + {STATUS_ICON[statuses.unbonding]} + Consent to slashing during unbonding +
  • +
  • + {STATUS_ICON[statuses.reward]} + BTC-BBN address binding for receiving staking rewards +
  • +
  • + {STATUS_ICON[statuses.eoi]} + EOI transaction +
  • +
+ +

+ Please come back in a minute to check your EOI status. Once it is + accepted, you can proceed to submit the staking transaction to BTC. +

+
+
+ ); +} diff --git a/src/app/components/Staking/Staking.tsx b/src/app/components/Staking/Staking.tsx index 3d546434..5a215d0e 100644 --- a/src/app/components/Staking/Staking.tsx +++ b/src/app/components/Staking/Staking.tsx @@ -10,6 +10,7 @@ import { UTXO_KEY, } from "@/app/common/constants"; import { LoadingView } from "@/app/components/Loading/Loading"; +import { EOIModal } from "@/app/components/Modals/EOIModal"; import { useError } from "@/app/context/Error/ErrorContext"; import { useStakingStats } from "@/app/context/api/StakingStatsProvider"; import { useBTCWallet } from "@/app/context/wallet/BTCWalletProvider"; @@ -654,6 +655,16 @@ export const Staking = () => { onClose={handleCloseFeedbackModal} type={feedbackModal.type} /> + null} + /> ); };