diff --git a/web/cashtab/src/components/Common/ApiError.js b/web/cashtab/src/components/Common/ApiError.js new file mode 100644 --- /dev/null +++ b/web/cashtab/src/components/Common/ApiError.js @@ -0,0 +1,15 @@ +import * as React from 'react'; +import { CashLoader } from '@components/Common/CustomIcons'; +import { AlertMsg } from '@components/Common/Atoms'; + +export const ApiError = () => { + return ( + <> + + API connection lost. +
Re-establishing connection... +
+ + + ); +}; diff --git a/web/cashtab/src/components/Common/Atoms.js b/web/cashtab/src/components/Common/Atoms.js --- a/web/cashtab/src/components/Common/Atoms.js +++ b/web/cashtab/src/components/Common/Atoms.js @@ -48,7 +48,7 @@ `; export const AlertMsg = styled.p` - color: ${props => props.theme.forms.error}; + color: ${props => props.theme.forms.error} !important; `; export const ConvertAmount = styled.div` diff --git a/web/cashtab/src/components/Configure/Configure.js b/web/cashtab/src/components/Configure/Configure.js --- a/web/cashtab/src/components/Configure/Configure.js +++ b/web/cashtab/src/components/Configure/Configure.js @@ -19,7 +19,6 @@ SmartButton, } from '@components/Common/PrimaryButton'; import { - CashLoader, ThemedCopyOutlined, ThemedWalletOutlined, ThemedDollarOutlined, @@ -27,6 +26,7 @@ import { ReactComponent as Trashcan } from '@assets/trashcan.svg'; import { ReactComponent as Edit } from '@assets/edit.svg'; import { Event } from '@utils/GoogleAnalytics'; +import { ApiError } from '@components/Common/ApiError'; const { Panel } = Collapse; @@ -474,12 +474,7 @@ Manage Wallets {apiError ? ( - <> - -

- An error occured on our end. Reconnecting... -

- + ) : ( <> updateSavedWalletsOnCreate()}> diff --git a/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap b/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap --- a/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap +++ b/web/cashtab/src/components/Configure/__tests__/__snapshots__/Configure.test.js.snap @@ -2,7 +2,7 @@ exports[`Configure with a wallet 1`] = `

[

[ { @@ -510,21 +510,7 @@ type="warning" /> )} - {apiError && ( - <> - -

- - An error occured on our end. - Reconnecting... - -

- - )} + {apiError && } diff --git a/web/cashtab/src/components/Send/SendToken.js b/web/cashtab/src/components/Send/SendToken.js --- a/web/cashtab/src/components/Send/SendToken.js +++ b/web/cashtab/src/components/Send/SendToken.js @@ -13,7 +13,6 @@ import PrimaryButton, { SecondaryButton, } from '@components/Common/PrimaryButton'; -import { CashLoader } from '@components/Common/CustomIcons'; import { FormItemWithMaxAddon, FormItemWithQRCodeAddon, @@ -37,6 +36,7 @@ convertEtokenToSimpleledger, } from '@utils/cashMethods'; import { TokenReceivedNotificationIcon } from '@components/Common/CustomIcons'; +import { ApiError } from '@components/Common/ApiError'; const SendToken = ({ tokenId, jestBCH, passLoadingStatus }) => { const { wallet, apiError } = React.useContext(WalletContext); @@ -363,7 +363,6 @@ Send {token.info.tokenName} - {apiError && } ) : ( submit()}> @@ -378,18 +377,7 @@ type="warning" /> )} - {apiError && ( -

- - An error occured on our end. - Reconnecting... - -

- )} + {apiError && } {tokenStats !== null && ( { /* @@ -60,19 +60,7 @@ )} )} - {apiError && ( - <> -

- An error occurred on our end. -

Re-establishing connection... -

- - - )} + {apiError && }
,

You need at least @@ -140,7 +140,7 @@

,

You need at least @@ -318,7 +318,7 @@ ,

You need at least @@ -398,7 +398,7 @@ ,

You need at least diff --git a/web/cashtab/src/components/Wallet/Wallet.js b/web/cashtab/src/components/Wallet/Wallet.js --- a/web/cashtab/src/components/Wallet/Wallet.js +++ b/web/cashtab/src/components/Wallet/Wallet.js @@ -7,7 +7,7 @@ import { Link } from 'react-router-dom'; import TokenList from './TokenList'; import TxHistory from './TxHistory'; -import { CashLoader } from '@components/Common/CustomIcons'; +import { ApiError } from '@components/Common/ApiError'; import { BalanceHeader } from '@components/Common/BalanceHeader'; import { BalanceHeaderFiat } from '@components/Common/BalanceHeaderFiat'; import { LoadingCtn, ZeroBalanceHeader } from '@components/Common/Atoms'; @@ -213,15 +213,7 @@ )} )} - {apiError && ( - <> -

- An error occurred on our end. -

Re-establishing connection... -

- - - )} + {apiError && } {wallet && ((wallet.Path245 && wallet.Path145) || wallet.Path1899) && ( <>