@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
33
44import { MODAL_STATUS } from "../../interfaces" ;
55import i18n from "../../localeImport" ;
6+ import CircularLoader from "../CircularLoader" ;
67import Image from "../Image" ;
78import PulseLoader from "../PulseLoader" ;
89import { ConnectedStatusType , ConnectingStatusType , ErroredStatusType , LoaderProps } from "./Loader.type" ;
@@ -88,29 +89,65 @@ function ErroredStatus(props: ErroredStatusType) {
8889 ) ;
8990}
9091
92+ function AuthorizingStatus ( ) {
93+ return (
94+ < div className = "w3a--flex w3a--size-full w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-6" >
95+ < p className = "w3a--p-2 w3a--text-center w3a--text-base w3a--font-semibold w3a--text-app-gray-900 dark:w3a--text-app-white" >
96+ Verify on MetaMask
97+ </ p >
98+ < div className = "w3a--flex w3a--justify-center" >
99+ < CircularLoader width = { 95 } height = { 95 } thickness = { 6 } arcSizeDeg = { 100 } >
100+ < Image
101+ imageId = { `login-metamask` }
102+ hoverImageId = { `login-metamask` }
103+ fallbackImageId = "wallet"
104+ height = "45"
105+ width = "45"
106+ isButton
107+ extension = "svg"
108+ />
109+ </ CircularLoader >
110+ </ div >
111+ < p className = "w3a--text-center w3a--text-sm w3a--text-app-gray-500 dark:w3a--text-app-gray-400" >
112+ We’ve sent a request to your wallet. Verify on your wallet to confirm that you own this wallet.
113+ </ p >
114+ < button className = "w3a--w-full w3a--rounded-xl w3a--bg-app-gray-100 w3a--p-2 w3a--py-3 w3a--text-sm w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:w3a--text-app-white" >
115+ Click here to verify
116+ </ button >
117+ </ div >
118+ ) ;
119+ }
120+
91121/**
92122 * Loader component
93123 * @param props - LoaderProps
94124 * @returns Loader component
95125 */
96126function Loader ( props : LoaderProps ) {
97- const { connector, connectorName, modalStatus, onClose, appLogo, message } = props ;
127+ const { connector, connectorName, modalStatus, onClose, appLogo, message, isConnectAndSignAuthenticationMode } = props ;
98128
99129 useEffect ( ( ) => {
100130 if ( modalStatus === MODAL_STATUS . CONNECTED ) {
101131 setTimeout ( ( ) => {
102132 onClose ( ) ;
103133 } , 1000 ) ;
104134 }
105- } , [ modalStatus , onClose ] ) ;
135+ if ( isConnectAndSignAuthenticationMode && modalStatus === MODAL_STATUS . AUTHORIZED ) {
136+ setTimeout ( ( ) => {
137+ onClose ( ) ;
138+ } , 1000 ) ;
139+ }
140+ } , [ modalStatus , onClose , isConnectAndSignAuthenticationMode ] ) ;
106141
107142 return (
108143 < div className = "w3a--flex w3a--h-full w3a--flex-1 w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4" >
109144 { modalStatus === MODAL_STATUS . CONNECTING && < ConnectingStatus connector = { connector } connectorName = { connectorName } appLogo = { appLogo } /> }
110145
111- { modalStatus === MODAL_STATUS . CONNECTED && < ConnectedStatus message = { message } /> }
146+ { ( modalStatus === MODAL_STATUS . CONNECTED || modalStatus === MODAL_STATUS . AUTHORIZED ) && < ConnectedStatus message = { message } /> }
112147
113148 { modalStatus === MODAL_STATUS . ERRORED && < ErroredStatus message = { message } /> }
149+
150+ { modalStatus === MODAL_STATUS . AUTHORIZING && < AuthorizingStatus /> }
114151 </ div >
115152 ) ;
116153}
0 commit comments