From bc4f9713d167fc2177459ad5a2b08d1379a0e5b4 Mon Sep 17 00:00:00 2001 From: wepsree Date: Mon, 22 Aug 2022 11:12:46 -0700 Subject: [PATCH] add spinner to tx modal and other fixes --- src/components/Modal.tsx | 9 +++- src/components/TransactionModal.tsx | 68 +++++++++++++++-------------- src/i18n/en.ts | 1 + src/pages/Home.tsx | 8 +++- src/pages/SignTx.tsx | 2 +- 5 files changed, 52 insertions(+), 36 deletions(-) diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 4198109..3e9e2a7 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -2,9 +2,11 @@ import { ArrowNarrowLeftIcon, PlusIcon } from '@heroicons/react/solid'; import { ReactNode, useEffect, useRef } from 'react'; import ReactDOM from 'react-dom'; import { useKeyPress } from '../utils/hooks'; +import Spinner from './Spinner'; type Props = { fullscreen?: boolean; + spinner?: boolean; bottom?: boolean; noHeader?: boolean; heading?: string; @@ -31,6 +33,7 @@ const Modal = ({ plusIcon, buttonText, onButtonClick, + spinner, bottom, noBackArrow, }: Props) => { @@ -62,7 +65,11 @@ const Modal = ({ mouseDraggingModal.current = false; }} > - {fullscreen ? ( + {spinner ? ( +
+ +
+ ) : fullscreen ? (
e.stopPropagation()} className="flex flex-col w-full h-full bg-skin-base" diff --git a/src/components/TransactionModal.tsx b/src/components/TransactionModal.tsx index 212e5a9..5e8bce0 100644 --- a/src/components/TransactionModal.tsx +++ b/src/components/TransactionModal.tsx @@ -20,7 +20,7 @@ import DeterministicIcon from './DeterministicIcon'; import Modal from './Modal'; type Props = State & { - noBackArrow?: boolean; + thirdPartyTx?: boolean; transaction?: Transaction; contractFuncParams?: any[]; onBack?: () => void; // clicking back arrow @@ -55,7 +55,7 @@ const Field = ({ ); const TransactionModal = ({ - noBackArrow, + thirdPartyTx, unsentBlock, onBack, onCancel = onBack, @@ -119,7 +119,7 @@ const TransactionModal = ({ {(!!transaction || !!unsentBlock) && ( onBack && onBack()} className="flex flex-col" @@ -225,14 +225,8 @@ const TransactionModal = ({
) : ( - window.close()} unsentBlock={block} /> + window.close()} unsentBlock={block} /> ); };