[0];
-type TCashierLockedProps = {
+type TProps = {
account_status: GetAccountStatus;
accounts: { [k: string]: TAccount };
current_currency_type: string;
@@ -30,266 +29,19 @@ const CashierLocked = ({
is_withdrawal_locked,
loginid,
is_identity_verification_needed,
-}: TCashierLockedProps) => {
- const { cashier_validation } = account_status;
- const no_residence = cashier_validation?.includes('no_residence');
- const unwelcome_status = cashier_validation?.includes('unwelcome_status');
- const self_exclusion = cashier_validation?.includes('SelfExclusion');
- const no_withdrawal_or_trading_status = cashier_validation?.includes('no_withdrawal_or_trading_status');
- const only_pa_withdrawals_allowed_status = cashier_validation?.includes('only_pa_withdrawals_allowed_status');
- const withdraw_service_unavailable_for_pa = cashier_validation?.includes('WithdrawServiceUnavailableForPA');
- const withdrawal_locked_status = cashier_validation?.includes('withdrawal_locked_status');
- const documents_expired = cashier_validation?.includes('documents_expired');
- const cashier_locked_status = cashier_validation?.includes('cashier_locked_status');
- const disabled_status = cashier_validation?.includes('disabled_status');
- const financial_assessment_required = cashier_validation?.includes('FinancialAssessmentRequired');
- const ask_currency = cashier_validation?.includes('ASK_CURRENCY');
- const ask_authenticate = cashier_validation?.includes('ASK_AUTHENTICATE');
- const ask_financial_risk_approval = cashier_validation?.includes('ASK_FINANCIAL_RISK_APPROVAL');
- const ask_tin_information = cashier_validation?.includes('ASK_TIN_INFORMATION');
- const ask_self_exclusion_max_turnover_set = cashier_validation?.includes('ASK_SELF_EXCLUSION_MAX_TURNOVER_SET');
- const ask_fix_details = cashier_validation?.includes('ASK_FIX_DETAILS');
- const ask_uk_funds_protection = cashier_validation?.includes('ASK_UK_FUNDS_PROTECTION');
- const pa_commision_withdrawal_limit = cashier_validation?.includes('PACommisionWithdrawalLimit');
+}: TProps) => {
+ const state = getMessage({
+ cashier_validation: account_status.cashier_validation,
+ is_crypto: current_currency_type === 'crypto',
+ is_system_maintenance,
+ is_cashier_locked,
+ is_deposit_locked,
+ is_withdrawal_locked,
+ is_identity_verification_needed,
+ excluded_until: accounts ? accounts[loginid]?.excluded_until : undefined,
+ });
- let icon = 'IcCashierLocked';
- let title = localize('Cashier is locked');
- let message: string | JSX.Element = localize(
- 'Your cashier is currently locked. Please contact us via live chat to find out how to unlock it.'
- );
-
- if (is_system_maintenance) {
- if (current_currency_type === 'crypto') {
- if (is_withdrawal_locked) {
- title = localize('Withdrawals are locked');
- message = localize(
- 'Withdrawals are temporarily unavailable due to system maintenance. You can make your withdrawals when the maintenance is complete.'
- );
- } else if (is_deposit_locked) {
- title = 'Deposits are locked';
- message = localize(
- 'Deposits are temporarily unavailable due to system maintenance. You can make your deposits when the maintenance is complete.'
- );
- } else {
- message = localize(
- 'Our cryptocurrency cashier is temporarily down due to system maintenance. You can access the Cashier in a few minutes when the maintenance is complete.'
- );
- }
- } else {
- message = localize(
- 'Our cashier is temporarily down due to system maintenance. You can access the Cashier in a few minutes when the maintenance is complete.'
- );
- }
- } else if (is_cashier_locked) {
- if (no_residence) {
- message = localize(
- 'You’ve not set your country of residence. To access Cashier, please update your country of residence in the Personal details section in your account settings.'
- );
- } else if (documents_expired) {
- message = localize(
- 'The identification documents you submitted have expired. Please submit valid identity documents to unlock Cashier. '
- );
- } else if (cashier_locked_status) {
- message = localize(
- 'Your cashier is currently locked. Please contact us via live chat to find out how to unlock it.'
- );
- } else if (disabled_status) {
- message = localize(
- 'Your account is temporarily disabled. Please contact us via live chat to enable deposits and withdrawals again.'
- );
- } else if (ask_currency) {
- message = localize('Please set your account currency to enable deposits and withdrawals.');
- } else if (ask_authenticate) {
- if (is_identity_verification_needed) {
- message = (
- ]}
- />
- );
- } else {
- message = (
- ,
- ,
- ]}
- />
- );
- }
- } else if (ask_financial_risk_approval) {
- message = (
- ,
- ]}
- />
- );
- } else if (financial_assessment_required) {
- message = (
- ,
- ]}
- />
- );
- } else if (ask_tin_information) {
- message = (
- ,
- ]}
- />
- );
- } else if (ask_uk_funds_protection) {
- message = (
- ]}
- />
- );
- } else if (ask_self_exclusion_max_turnover_set) {
- message = (
- ,
- ]}
- />
- );
- } else if (ask_fix_details) {
- message = (
- ,
- ]}
- />
- );
- }
- } else if (is_deposit_locked && ask_fix_details) {
- icon = 'IcCashierDepositLock';
- title = localize('Deposits are locked');
- message = (
- ,
- ]}
- />
- );
- } else if (is_deposit_locked && self_exclusion) {
- icon = 'IcCashierDepositLock';
- title = localize('Deposits are locked');
- message = localize(
- 'You have chosen to exclude yourself from trading on our website until {{exclude_until}}. If you are unable to place a trade or deposit after your self-exclusion period, please contact us via live chat.',
- {
- exclude_until: formatDate(accounts[loginid].excluded_until, 'DD MMM, YYYY'),
- }
- );
- } else if (is_deposit_locked && unwelcome_status) {
- icon = 'IcCashierDepositLock';
- title = localize('Deposits are locked');
- message = localize('Please contact us via live chat.');
- } else if (is_withdrawal_locked && financial_assessment_required) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = (
- ,
- ]}
- />
- );
- } else if (is_withdrawal_locked && ask_authenticate) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = (
- ,
- ,
- ]}
- />
- );
- } else if (is_withdrawal_locked && ask_fix_details) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = (
- ,
- ]}
- />
- );
- } else if (is_withdrawal_locked && withdraw_service_unavailable_for_pa) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = localize('This feature is not available for payment agents.');
- } else if (is_withdrawal_locked && no_withdrawal_or_trading_status) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = localize(
- 'Unfortunately, you can only make deposits. Please contact us via live chat to enable withdrawals.'
- );
- } else if (is_withdrawal_locked && withdrawal_locked_status) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = localize(
- 'Unfortunately, you can only make deposits. Please contact us via live chat to enable withdrawals.'
- );
- } else if (is_withdrawal_locked && only_pa_withdrawals_allowed_status) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Withdrawals are locked');
- message = localize('You can only make deposits. Please contact us via live chat for more information.');
- } else if (is_withdrawal_locked && pa_commision_withdrawal_limit) {
- icon = 'IcCashierWithdrawalLock';
- title = localize('Cashier is locked for withdrawals');
- message = localize(
- "It seems that you've no commissions to withdraw at the moment. You can make withdrawals once you receive your commissions."
- );
- }
-
- return (
-
-
-
- {title}
-
-
- {message}
-
-
- );
+ return ;
};
export default connect(({ client, modules }: TRootStore) => ({
diff --git a/packages/cashier/src/components/empty-state/empty-state.scss b/packages/cashier/src/components/empty-state/empty-state.scss
new file mode 100644
index 000000000000..78db55602c46
--- /dev/null
+++ b/packages/cashier/src/components/empty-state/empty-state.scss
@@ -0,0 +1,32 @@
+.cashier-empty-state {
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ max-width: 67.2rem;
+ margin: 4rem auto 0;
+
+ &__icon {
+ width: 12.8rem;
+ height: 12.8rem;
+ margin-bottom: 2.4rem;
+ }
+
+ &__title {
+ margin-bottom: 0.8rem;
+
+ @include mobile {
+ margin-left: 1.2rem;
+ margin-right: 1.2rem;
+ }
+ }
+
+ &__desc {
+ margin-bottom: 3.2rem;
+
+ @include mobile {
+ padding: 0 1rem;
+ }
+ }
+}
diff --git a/packages/cashier/src/components/empty-state/empty-state.tsx b/packages/cashier/src/components/empty-state/empty-state.tsx
new file mode 100644
index 000000000000..08c850b565f4
--- /dev/null
+++ b/packages/cashier/src/components/empty-state/empty-state.tsx
@@ -0,0 +1,23 @@
+import { Icon, Text } from '@deriv/components';
+import React from 'react';
+import './empty-state.scss';
+
+export type TEmptyStateProps = {
+ icon: string;
+ title: string | React.ReactNode;
+ description: string | React.ReactNode;
+};
+
+const EmptyState = ({ icon, title, description }: TEmptyStateProps) => (
+
+
+
+ {title}
+
+
+ {description}
+
+
+);
+
+export default EmptyState;
diff --git a/packages/cashier/src/components/empty-state/index.ts b/packages/cashier/src/components/empty-state/index.ts
new file mode 100644
index 000000000000..5923bfc4525d
--- /dev/null
+++ b/packages/cashier/src/components/empty-state/index.ts
@@ -0,0 +1,3 @@
+import EmptyState from './empty-state';
+
+export default EmptyState;
diff --git a/packages/components/src/components/vertical-tab/vertical-tab-content-container.jsx b/packages/components/src/components/vertical-tab/vertical-tab-content-container.jsx
index c0bea8cd1a89..6ff505015c2d 100644
--- a/packages/components/src/components/vertical-tab/vertical-tab-content-container.jsx
+++ b/packages/components/src/components/vertical-tab/vertical-tab-content-container.jsx
@@ -7,7 +7,7 @@ import Icon from '../icon/icon.jsx';
const SideNotes = ({ class_name, side_notes }) => {
return (
{side_notes?.map((note, i) => (