{icon}
-
+
{title && (
-
+
{title}
)}
{isValidElement(description) ? (
description
) : (
-
+
{description}
)}
- {actionText && (
-
- )}
+ {renderButtons?.()}
);
};
diff --git a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.scss b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.scss
index f00fe670585a..e363751aade9 100644
--- a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.scss
+++ b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.scss
@@ -54,12 +54,9 @@
}
&__success-footer {
- display: flex;
- gap: 0.8rem;
+ width: 24rem;
@include mobile {
- flex-direction: column;
- padding-block: 1.6rem;
width: 100%;
}
}
diff --git a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
index 496d65ac51fb..ae5d461015cd 100644
--- a/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
+++ b/packages/wallets/src/components/WalletsAddMoreCardBanner/WalletsAddMoreCardBanner.tsx
@@ -1,14 +1,14 @@
import React, { useCallback, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import { useAccountsList, useCreateWallet } from '@deriv/api';
-import { Success } from '../../features/cfd';
import useDevice from '../../hooks/useDevice';
import useSyncLocalStorageClientAccounts from '../../hooks/useSyncLocalStorageClientAccounts';
import CheckIcon from '../../public/images/check.svg';
import PlusIcon from '../../public/images/plus.svg';
import { THooks } from '../../types';
-import { ModalStepWrapper, ModalWrapper, WalletButton, WalletText } from '../Base';
+import { WalletButton, WalletText } from '../Base';
import { useModal } from '../ModalProvider';
+import { WalletAddedSuccess } from '../WalletAddedSuccess';
import WalletAddMoreCurrencyIcon from '../WalletAddMoreCurrencyIcon';
import { WalletError } from '../WalletError';
@@ -44,51 +44,38 @@ const WalletsAddMoreCardBanner: React.FC
= ({
}
}, [data, isMutateSuccess, switchAccount, syncLocalStorageClientAccounts]);
- useEffect(() => {
- if (status === 'error') {
- modal.show(
- modal.hide()}
- type='modal'
- />
- );
- } else if (status === 'success') {
- modal.show(
-
- {isMobile && (
-
- null}
- title={`Your ${
- data?.currency
- } wallet (${data?.landing_company_shortcode?.toUpperCase()}) is ready`}
- />
-
- )}
- {!isMobile && (
-
-
-
- )}
-
- );
- }
- }, [data?.currency, data?.landing_company_shortcode, error?.error.message, isMobile, renderButtons, status]); // eslint-disable-line react-hooks/exhaustive-deps
+ useEffect(
+ () => {
+ if (status === 'error') {
+ modal.show(
+ modal.hide()} />
+ );
+ } else if (status === 'success') {
+ modal.show(
+ {
+ history.push('wallets/cashier/deposit');
+ modal.hide();
+ }}
+ onSecondaryButtonClick={() => modal.hide()}
+ />
+ );
+ }
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [
+ data?.currency,
+ data?.display_balance,
+ data?.landing_company_shortcode,
+ error?.error.message,
+ isMobile,
+ renderButtons,
+ status,
+ ]
+ );
return (
@@ -102,22 +89,23 @@ const WalletsAddMoreCardBanner: React.FC = ({
+ )
+ }
onClick={e => {
e.stopPropagation();
currency && mutate({ account_type: isCrypto ? 'crypto' : 'doughflow', currency });
}}
- >
- {isAdded ? (
-
- )}
- {isAdded ? 'Added' : 'Add'}
-
+ size={isMobile ? 'sm' : 'lg'}
+ text={isAdded ? 'Added' : 'Add'}
+ />