Skip to content

Commit 607b19e

Browse files
[CFDS] shontzu/TRAH-4372/cfds-unavailable-tag-content-update (#17968)
* chore: new PR becasue old one stale * chore: empty commit * chore: update tests * chore: typo * style: changed button variant from medium to large * style: padding issue with modal component
1 parent ccce2a4 commit 607b19e

File tree

11 files changed

+34
-23
lines changed

11 files changed

+34
-23
lines changed

packages/account/src/Configs/get-mt5-status-badge-config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const getMT5StatusBadgeConfig = (mt5_account_status: TMT5AccountStatus) => {
4343
};
4444
case TRADING_PLATFORM_STATUS.UNAVAILABLE:
4545
return {
46-
text: <Localize i18n_default_text='<0>Unavailable</0>' components={[BadgeTextComponent]} />,
46+
text: <Localize i18n_default_text='<0>Temporarily unavailable</0>' components={[BadgeTextComponent]} />,
4747
icon: 'IcAlertWarning',
4848
};
4949
default:

packages/account/src/Configs/get-status-badge-config.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import React from 'react';
2-
import { ACCOUNT_BADGE_STATUS, TAccountBadgeStatus } from '@deriv/shared';
2+
import { Text } from '@deriv/components';
3+
import { ACCOUNT_BADGE_STATUS, MT5_ACCOUNT_STATUS, TAccountBadgeStatus, TRADING_PLATFORM_STATUS } from '@deriv/shared';
34
import { Localize } from '@deriv-com/translations';
45

56
const getStatusBadgeConfig = (account_status: TAccountBadgeStatus) => {
7+
const BadgeTextComponent = <Text key={0} weight='bold' size='xxxs' color='warning' />;
8+
69
switch (account_status) {
710
case ACCOUNT_BADGE_STATUS.PENDING:
811
return {
@@ -15,13 +18,22 @@ const getStatusBadgeConfig = (account_status: TAccountBadgeStatus) => {
1518
icon: 'IcMt5Failed',
1619
icon_size: '18',
1720
};
18-
case ACCOUNT_BADGE_STATUS.NEEDS_VERIFICATION: {
21+
case ACCOUNT_BADGE_STATUS.NEEDS_VERIFICATION:
1922
return {
2023
text: <Localize i18n_default_text='Needs Verification' />,
2124
icon: 'IcMt5Verification',
2225
icon_size: '18',
2326
};
24-
}
27+
case MT5_ACCOUNT_STATUS.UNDER_MAINTENANCE:
28+
return {
29+
text: <Localize i18n_default_text='<0>Server maintenance</0>' components={[BadgeTextComponent]} />,
30+
icon: 'IcAlertWarning',
31+
};
32+
case TRADING_PLATFORM_STATUS.UNAVAILABLE:
33+
return {
34+
text: <Localize i18n_default_text='<0>Temporarily unavailable</0>' components={[BadgeTextComponent]} />,
35+
icon: 'IcAlertWarning',
36+
};
2537
default:
2638
return {
2739
text: '',

packages/appstore/src/components/cfds-listing/cfds-listing.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,9 @@
17731773
flex-direction: column;
17741774
justify-content: flex-start;
17751775
align-items: flex-start;
1776+
@include mobile-or-tablet-screen {
1777+
padding: 0.8rem 1.6rem;
1778+
}
17761779
}
17771780
.dc-input {
17781781
&__label {

packages/cashier/src/pages/account-transfer/account-transfer-form/account-transfer-form.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const AccountOption = ({
8080
<StatusBadge
8181
account_status={TRADING_PLATFORM_STATUS.UNAVAILABLE}
8282
icon='IcAlertWarning'
83-
text='Unavailable'
83+
text='Temporarily unavailable'
8484
/>
8585
);
8686
}
@@ -410,9 +410,7 @@ const AccountTransferForm = observer(
410410
if (is_migration_status_present) {
411411
hint_text = <Localize i18n_default_text='You can no longer open new positions with this account.' />;
412412
} else if (is_unavailable_status_present) {
413-
hint_text = (
414-
<Localize i18n_default_text='The server is temporarily unavailable for this account. We’re working to resolve this.' />
415-
);
413+
hint_text = <Localize i18n_default_text='Check back in a few minutes by refreshing the page.' />;
416414
} else if (is_maintenance_status_present) {
417415
hint_text = (
418416
<Localize

packages/cfd/src/Containers/cfd-server-maintenance-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ const CFDServerMaintenanceModal = observer(() => {
1919
has_close_icon
2020
width={isDesktop() ? '440px' : '328px'}
2121
>
22-
<Modal.Body>
22+
<Modal.Body className='dc-modal__container_cfd-password-modal__body'>
2323
<Localize
2424
i18n_default_text='We’re currently performing server maintenance. Service may be affected.'
2525
components={[<strong key={0} />]}
2626
/>
2727
</Modal.Body>
2828
<Modal.Footer>
29-
<Button onClick={() => setServerMaintenanceModal(false)} secondary medium>
29+
<Button onClick={() => setServerMaintenanceModal(false)} secondary large>
3030
<Localize i18n_default_text='OK' />
3131
</Button>
3232
</Modal.Footer>

packages/cfd/src/Containers/mt5-account-unavailable-modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ const MT5AccountUnavailableModal = observer(() => {
1515
<Modal
1616
className='cfd-password-modal'
1717
is_open={is_account_unavailable_modal_visible}
18-
title={localize('Account unavailable')}
18+
title={localize('Account temporarily unavailable')}
1919
toggleModal={() => setAccountUnavailableModal(false)}
2020
has_close_icon
2121
width={isDesktop ? '440px' : '328px'}
2222
>
23-
<Modal.Body>
24-
<Localize i18n_default_text='The server is temporarily unavailable for this account. We’re working to resolve this.' />
23+
<Modal.Body className='dc-modal__container_cfd-password-modal__body'>
24+
<Localize i18n_default_text='Check back in a few minutes by refreshing the page.' />
2525
</Modal.Body>
2626
<Modal.Footer>
2727
<Button type='button' onClick={() => setAccountUnavailableModal(false)} secondary medium>

packages/shared/src/utils/constants/auth-status-codes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ export const ACCOUNT_BADGE_STATUS = {
1111
FAILED: 'failed',
1212
NEEDS_VERIFICATION: 'needs_verification',
1313
PENDING: 'pending',
14+
UNDER_MAINTENANCE: 'under_maintenance',
15+
UNAVAILABLE: 'unavailable',
1416
} as const;

packages/wallets/src/features/cashier/modules/Transfer/hooks/useTransferMessages/utils/tradingPlatformStatusMessageFn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const tradingPlatformStatusMessageFn = ({ platformStatus }: TMessageFnProps) =>
99
const message = isMaintenance ? (
1010
<Localize i18n_default_text='We’re currently performing server maintenance. Service may be affected.' />
1111
) : (
12-
<Localize i18n_default_text='The server is temporarily unavailable for this account. We’re working to resolve this.' />
12+
<Localize i18n_default_text='Check back in a few minutes by refreshing the page.' />
1313
);
1414

1515
return {

packages/wallets/src/features/cfd/components/PlatformStatusBadge/PlatformStatusBadge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getBadgeText = (status: TProps['status'], localize: (key: string) => strin
1717
return localize('Server maintenance');
1818
case TRADING_PLATFORM_STATUS.UNAVAILABLE:
1919
case MT5_ACCOUNT_STATUS.UNAVAILABLE:
20-
return localize('Unavailable');
20+
return localize('Temporarily unavailable');
2121
default:
2222
return '';
2323
}

packages/wallets/src/features/cfd/screens/TradingPlatformStatus/TradingPlatformStatus.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,21 @@ const getContentConfig = (localize: ReturnType<typeof useTranslations>['localize
1515
title: localize('Server Maintenance'),
1616
};
1717
const unavailableConfig = {
18-
content: localize('The server is temporarily unavailable for this account. We’re working to resolve this.'),
19-
title: localize('Account Unavailable'),
18+
content: localize('Check back in a few minutes by refreshing the page.'),
19+
title: localize('Account temporarily unavailable'),
2020
};
2121

2222
return {
2323
[MT5_ACCOUNT_STATUS.UNDER_MAINTENANCE]: maintenanceConfig,
2424
[TRADING_PLATFORM_STATUS.MAINTENANCE]: maintenanceConfig,
2525
[MT5_ACCOUNT_STATUS.UNAVAILABLE]: unavailableConfig,
26-
[TRADING_PLATFORM_STATUS.UNAVAILABLE]: unavailableConfig,
2726
};
2827
};
2928

3029
const TradingPlatformStatus: React.FC<TradingPlatformStatusModalProps> = ({ status }) => {
3130
const { hide } = useModal();
3231
const { isDesktop } = useDevice();
3332
const { localize } = useTranslations();
34-
3533
const { content, title } = getContentConfig(localize)[status];
3634

3735
return (

0 commit comments

Comments
 (0)