1- import React from "react" ;
1+ import React , { useState } from "react" ;
22import { useLocation } from "react-router-dom" ;
33import { useSelector } from "react-redux" ;
44import BigNumber from "bignumber.js" ;
@@ -12,7 +12,7 @@ import { truncatedPublicKey } from "helpers";
1212
1313import { publicKeySelector } from "popup/ducks/authServices" ;
1414import { COLOR_PALETTE , FONT_WEIGHT } from "popup/styles" ;
15- import { Button , BackButton } from "popup/basics" ;
15+ import { Button , BackButton , FormSubmitButton } from "popup/basics" ;
1616
1717const El = styled . div `
1818 padding: 2.25rem 2.5rem;
@@ -92,13 +92,15 @@ export const SignTransaction = () => {
9292
9393 const { _fee, _operations } = transaction ;
9494 const publicKey = useSelector ( publicKeySelector ) ;
95+ const [ isConfirming , setIsConfirming ] = useState ( false ) ;
9596
9697 const rejectAndClose = async ( ) => {
9798 await rejectAccess ( ) ;
9899 window . close ( ) ;
99100 } ;
100101
101102 const signAndClose = async ( ) => {
103+ setIsConfirming ( true ) ;
102104 await signTransaction ( { transaction } ) ;
103105 window . close ( ) ;
104106 } ;
@@ -247,9 +249,12 @@ export const SignTransaction = () => {
247249 < RejectButton size = "small" onClick = { ( ) => rejectAndClose ( ) } >
248250 Reject
249251 </ RejectButton >
250- < Button size = "small" onClick = { ( ) => signAndClose ( ) } >
251- Confirm
252- </ Button >
252+ < FormSubmitButton
253+ buttonCTA = "Confirm"
254+ isSubmitting = { isConfirming }
255+ size = "small"
256+ onClick = { ( ) => signAndClose ( ) }
257+ />
253258 </ ButtonContainerEl >
254259 </ El >
255260 ) ;
0 commit comments