@@ -5,7 +5,7 @@ import { formatUnits, parseUnits } from 'ethers/lib/utils';
55import { t } from 'i18next' ;
66
77import { TxStep } from '@sovryn/sdk' ;
8- import { Button } from '@sovryn/ui' ;
8+ import { Button , ErrorBadge , ErrorLevel } from '@sovryn/ui' ;
99
1010import { RSK_CHAIN_ID } from '../../../../../../config/chains' ;
1111
@@ -22,6 +22,7 @@ import { SendFlowContext, SendFlowStep } from '../../../contexts/sendflow';
2222import { useBridge } from '../../../hooks/useBridge' ;
2323import { useBridgeLimits } from '../../../hooks/useBridgeLimits' ;
2424import { useBridgeService } from '../../../hooks/useBridgeService' ;
25+ import { useERC20BridgeLocked } from '../../../hooks/useERC20BridgeLocked' ;
2526import { TxStatusTitle } from '../../TxStatusTitle' ;
2627
2728const translation = translations . erc20Bridge . confirmationScreens ;
@@ -178,6 +179,8 @@ export const ReviewScreen: React.FC = () => {
178179 TxStep . PENDING ,
179180 ] . includes ( transaction . step ) ;
180181
182+ const isBridgeLocked = useERC20BridgeLocked ( ) ;
183+
181184 return (
182185 < div className = "text-center" >
183186 < TxStatusTitle step = { transaction . step } />
@@ -191,26 +194,33 @@ export const ReviewScreen: React.FC = () => {
191194 ) ) }
192195 </ div >
193196
194- < div className = "mt-12" >
195- < Button
196- text = {
197- transaction . step === TxStep . CONFIRMED
198- ? t ( translations . common . buttons . done )
199- : [ TxStep . USER_DENIED , TxStep . FAILED ] . includes ( transaction . step )
200- ? t ( translations . common . buttons . retry )
201- : t ( translations . common . buttons . confirm )
202- }
203- onClick = {
204- transaction . step === TxStep . CONFIRMED
205- ? handleErc20BridgeDialogClose
206- : handleSubmit
207- }
208- loading = { isLoading }
209- disabled = { isLoading }
210- className = "w-full"
211- dataAttribute = "erc20-send-confirm"
197+ { isBridgeLocked ? (
198+ < ErrorBadge
199+ level = { ErrorLevel . Warning }
200+ message = { t ( translations . maintenanceMode . erc20Bridge ) }
212201 />
213- </ div >
202+ ) : (
203+ < div className = "mt-12" >
204+ < Button
205+ text = {
206+ transaction . step === TxStep . CONFIRMED
207+ ? t ( translations . common . buttons . done )
208+ : [ TxStep . USER_DENIED , TxStep . FAILED ] . includes ( transaction . step )
209+ ? t ( translations . common . buttons . retry )
210+ : t ( translations . common . buttons . confirm )
211+ }
212+ onClick = {
213+ transaction . step === TxStep . CONFIRMED
214+ ? handleErc20BridgeDialogClose
215+ : handleSubmit
216+ }
217+ loading = { isLoading }
218+ disabled = { isLoading || isBridgeLocked }
219+ className = "w-full"
220+ dataAttribute = "erc20-send-confirm"
221+ />
222+ </ div >
223+ ) }
214224 </ div >
215225 ) ;
216226} ;
0 commit comments