diff --git a/package-lock.json b/package-lock.json index 1bce79f3..9a00b670 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@dusalabs/sdk": "^0.5.28", "@massalabs/massa-web3": "^4.0.2-dev", - "@massalabs/react-ui-kit": "^0.0.5-dev", + "@massalabs/react-ui-kit": "^0.0.6-dev", "@massalabs/wallet-provider": "^2.0.1-dev", "@rainbow-me/rainbowkit": "^2.0.0-beta.4", "@tanstack/query-core": "^5.18.1", @@ -3513,9 +3513,9 @@ } }, "node_modules/@massalabs/react-ui-kit": { - "version": "0.0.5-dev.20240611224415", - "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240611224415.tgz", - "integrity": "sha512-1H8pjj+DwV40BRrc0u7IyloJay+zhkgKteEOvNYzms66yhL/2Rbtp14nClbbzmg8hZeGQVq8YpdMd7t0qqOMCQ==", + "version": "0.0.6-dev.20240725152458", + "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.6-dev.20240725152458.tgz", + "integrity": "sha512-WRX7t4RfPbt+6HM7k1v9KPS+N+uNJ5ex26fQowpkup7bTz+p0B2/0O3Re/jXTAev1knm6UamSu35KoUzpBnqsg==", "dependencies": { "@headlessui/react": "^1.7.15", "copy-to-clipboard": "^3.3.3", diff --git a/package.json b/package.json index 1534764e..3f63dd42 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dependencies": { "@dusalabs/sdk": "^0.5.28", "@massalabs/massa-web3": "^4.0.2-dev", - "@massalabs/react-ui-kit": "^0.0.5-dev", + "@massalabs/react-ui-kit": "^0.0.6-dev", "@massalabs/wallet-provider": "^2.0.1-dev", "@rainbow-me/rainbowkit": "^2.0.0-beta.4", "@tanstack/query-core": "^5.18.1", diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 98b614eb..627ebbcb 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -274,7 +274,6 @@ "claim": { "error": { "rejected": "Claim rejected by user, try again", - "timeout": "Claim timeout out.", "unknown": "Unknown error, Try again." } }, diff --git a/src/pages/IndexPage/Layouts/LoadingLayout/PendingOperationLayout.tsx b/src/pages/IndexPage/Layouts/LoadingLayout/PendingOperationLayout.tsx index a14a08c9..88441a17 100644 --- a/src/pages/IndexPage/Layouts/LoadingLayout/PendingOperationLayout.tsx +++ b/src/pages/IndexPage/Layouts/LoadingLayout/PendingOperationLayout.tsx @@ -17,21 +17,22 @@ export function PendingOperationLayout() { const { box } = useGlobalStatusesStore(); - const IS_BOX_SUCCESS = box === Status.Success; - const IS_BOX_WARNING = box === Status.Warning; - const IS_BOX_ERROR = box === Status.Error; + const isBoxSuccess = box === Status.Success; + const isBoxWarning = box === Status.Warning; + const isBoxError = box === Status.Error; - const displaySubtitle = !IS_BOX_SUCCESS && !IS_BOX_WARNING && !IS_BOX_ERROR; + const displaySubtitle = !isBoxSuccess && !isBoxWarning && !isBoxError; - const isNotProcessing = IS_BOX_SUCCESS || IS_BOX_WARNING || IS_BOX_ERROR; + const isNotProcessing = isBoxSuccess || isBoxWarning || isBoxError; function getLoadingBoxHeader() { - if (IS_BOX_SUCCESS) return Intl.t('index.loading-box.success'); - else if (IS_BOX_ERROR) { + if (isBoxSuccess) return Intl.t('index.loading-box.success'); + if (isBoxError) { return massaToEvm ? Intl.t('index.loading-box.title-redeem-error') : Intl.t('index.loading-box.title-bridge-error'); - } else if (IS_BOX_WARNING) { + } + if (isBoxWarning) { return massaToEvm ? ( <> {Intl.t('index.loading-box.title-redeem-warning-1')} @@ -54,9 +55,9 @@ export function PendingOperationLayout() { function getLoadingBoxContent() { switch (true) { - case IS_BOX_SUCCESS: + case isBoxSuccess: return ; - case IS_BOX_WARNING: + case isBoxWarning: return ; case massaToEvm: return ; diff --git a/src/pages/IndexPage/Layouts/LoadingLayout/RedeemLayout/ClaimRedeem.tsx b/src/pages/IndexPage/Layouts/LoadingLayout/RedeemLayout/ClaimRedeem.tsx index c7d0db07..fca9c87f 100644 --- a/src/pages/IndexPage/Layouts/LoadingLayout/RedeemLayout/ClaimRedeem.tsx +++ b/src/pages/IndexPage/Layouts/LoadingLayout/RedeemLayout/ClaimRedeem.tsx @@ -48,11 +48,6 @@ export function ClaimRedeem() { [burnTxId, updateBurnRedeemOperationById], ); - const setLoadingToError = useCallback(() => { - setClaim(Status.Error); - setBox(Status.Error); - }, [setClaim, setBox]); - // Updates current redeem operation state based on claim status useEffect(() => { if (hash) setClaimTxId(hash); @@ -76,7 +71,8 @@ export function ClaimRedeem() { claimState: ClaimState.REJECTED, }); } else { - setLoadingToError(); + setClaim(Status.Error); + setBox(Status.Error); updateCurrentRedeemOperation({ claimState: ClaimState.ERROR, }); @@ -91,7 +87,6 @@ export function ClaimRedeem() { refreshBalances, setClaim, updateCurrentRedeemOperation, - setLoadingToError, setClaimTxId, ]); diff --git a/src/store/helpers/tokenSymbol.ts b/src/store/helpers/tokenSymbol.ts index 0018513b..9fbc782e 100644 --- a/src/store/helpers/tokenSymbol.ts +++ b/src/store/helpers/tokenSymbol.ts @@ -3,5 +3,6 @@ export function getMASSASymbol(symbol: string) { } export function getEVMSymbol(symbol: string) { // removes any ". + alphanumeric " from string + if (symbol === 'WETH.b') return 'ETH'; return symbol.replace(/\.[^.]+$/, ''); } diff --git a/src/utils/lambdaApi.ts b/src/utils/lambdaApi.ts index f0d86d7f..ecb0f18a 100644 --- a/src/utils/lambdaApi.ts +++ b/src/utils/lambdaApi.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import { useAccount } from 'wagmi'; import { ClaimState } from './const'; import { config } from '../const'; -import { useBridgeModeStore, useGlobalStatusesStore } from '../store/store'; +import { useBridgeModeStore } from '../store/store'; import { useResource } from '@/custom/api/useResource'; import { BurnRedeemOperation, useOperationStore } from '@/store/operationStore'; @@ -143,7 +143,6 @@ function getClaimState( export function useFetchSignatures() { const { burnTxId, getCurrentRedeemOperation, updateBurnRedeemOperationById } = useOperationStore(); - const { setBox } = useGlobalStatusesStore(); const { currentMode } = useBridgeModeStore(); const { address: evmAddress } = useAccount(); @@ -181,7 +180,6 @@ export function useFetchSignatures() { }, [ burnTxId, burnOperations, - setBox, getCurrentRedeemOperation, updateBurnRedeemOperationById, ]);