Skip to content

Commit 55af507

Browse files
Merge pull request #409 from ameerul-deriv/P2PS-4487-p2p-is-blocked-for-wallet-user
Ameerul / P2PS-4487 P2P is blocked for Wallet User
2 parents ce44bfc + 4caab1b commit 55af507

File tree

4 files changed

+0
-39
lines changed

4 files changed

+0
-39
lines changed

src/components/BlockedScenarios/BlockedScenarios.tsx

-19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Chat from '@/utils/chat';
22
import {
33
DerivLightIcCashierBlockedIcon,
4-
DerivLightIcCashierLockedIcon,
54
DerivLightIcCashierUnderMaintenanceIcon,
65
DerivLightWalletCurrencyUnavailableIcon as P2pUnavailable,
76
} from '@deriv/quill-icons';
@@ -34,24 +33,6 @@ const BlockedScenarios = ({ type }: { type: string }) => {
3433
};
3534

3635
const blockedScenarios: TBlockedScenariosObject = {
37-
cashierLocked: {
38-
actionButton: (
39-
<Button onClick={openLiveChat} size='lg' textSize={buttonTextSize}>
40-
<Localize i18n_default_text='Live chat' />
41-
</Button>
42-
),
43-
description: (
44-
<Text align='center'>
45-
<Localize i18n_default_text='Your cashier is currently locked. Please contact us via live chat to find out why.' />
46-
</Text>
47-
),
48-
icon: <DerivLightIcCashierLockedIcon height={iconSize} width={iconSize} />,
49-
title: (
50-
<Text align='center' weight='bold'>
51-
<Localize i18n_default_text='Cashier is locked' />
52-
</Text>
53-
),
54-
},
5536
crypto: {
5637
actionButton: (
5738
<Button onClick={openDerivApp} size='lg' textSize={buttonTextSize}>

src/components/BlockedScenarios/__tests__/BlockedScenarios.spec.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,6 @@ describe('BlockedScenarios', () => {
4848
expect(screen.getByRole('button', { name: 'Live chat' })).toBeInTheDocument();
4949
});
5050

51-
it('should show the correct message for cashier locked account', () => {
52-
render(<BlockedScenarios type='cashierLocked' />);
53-
expect(screen.getByText('Cashier is locked')).toBeInTheDocument();
54-
expect(
55-
screen.getByText('Your cashier is currently locked. Please contact us via live chat to find out why.')
56-
).toBeInTheDocument();
57-
expect(screen.getByRole('button', { name: 'Live chat' })).toBeInTheDocument();
58-
});
59-
6051
it('should show the correct message when cashier is under maintenance', () => {
6152
render(<BlockedScenarios type='systemMaintenance' />);
6253
expect(screen.getByText('Cashier is currently down for maintenance')).toBeInTheDocument();

src/hooks/custom-hooks/__tests__/useIsP2PBlocked.spec.ts

-10
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ describe('useIsP2PBlocked', () => {
4040
expect(result.current).toStrictEqual({ isP2PBlocked: true, status: 'p2pBlocked' });
4141
});
4242

43-
it('should return isP2PBlocked as true and status as cashierLocked if status has cashier_locked', () => {
44-
mockUseGetAccountStatus.mockImplementation(() => ({
45-
data: { p2p_status: 'none', status: ['cashier_locked'] },
46-
}));
47-
mockUseActiveAccount.mockImplementation(() => ({ data: { currency: 'USD', is_virtual: 0 } }));
48-
49-
const { result } = renderHook(() => useIsP2PBlocked());
50-
expect(result.current).toStrictEqual({ isP2PBlocked: true, status: 'cashierLocked' });
51-
});
52-
5343
it('should return isP2PBlocked as true and status as systemMaintenance if cashier_validation has system_maintenance', () => {
5444
mockUseGetAccountStatus.mockImplementation(() => ({
5545
data: { cashier_validation: ['system_maintenance'], p2p_status: 'none', status: [] },

src/hooks/custom-hooks/useIsP2PBlocked.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const useIsP2PBlocked = () => {
1616
if (!accountStatus) return '';
1717

1818
if (accountStatus?.cashier_validation?.includes('system_maintenance')) return 'systemMaintenance';
19-
if (accountStatus.status.includes('cashier_locked')) return 'cashierLocked';
2019
if (accountStatus.p2p_status === 'perm_ban') return 'p2pBlocked';
2120

2221
return '';

0 commit comments

Comments
 (0)