Skip to content

Commit

Permalink
Hamza/cfds 1196/enable mt5 notification message (binary-com#10696)
Browse files Browse the repository at this point in the history
* chore: update trade modal broker name + notifications content updated

* chore: updated boker name

* chore: notification popup for mt5 awareness

* chore: notification popup close on cta and change the color because of dark mode

* refactor: update the url and hardcoded values

* chore: revert the Broker Name changes
  • Loading branch information
hamza-deriv committed Oct 18, 2023
1 parent a0e3728 commit c08c160
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,60 +1,52 @@
import React from 'react';
import { Text } from '@deriv/components';
import { Localize } from '@deriv/translations';
import { mt5_community_url } from '@deriv/shared';

const MT5NotificationDescription = () => {
type TMT5NotificationDescription = {
setMT5NotificationModal: (value: boolean) => void;
};
const MT5NotificationDescription = ({ setMT5NotificationModal }: TMT5NotificationDescription) => {
return (
<div className={'mt5-notification-modal-description'}>
<Text as='p' size='xs'>
<Localize i18n_default_text='Follow these simple steps to fix it:' />
</Text>
<ol className='mt5-notification-list-container'>
<li className='mt5-notification-list-container-item'>
<Text as='p' size='xs'>
<Localize i18n_default_text='On your MT5 mobile app, delete your existing Deriv account:' />
</Text>
<ul>
<li className='mt5-notification-list'>
<Text as='p' size='xs'>
<Localize
i18n_default_text='- iOS: Swipe left on the account and tap <0>Delete</0>.'
components={[<strong key={0} />]}
/>
</Text>
</li>
<li className='mt5-notification-list'>
<Text as='p' size='xs'>
<Localize
i18n_default_text='- Android: Tap the account, open <0>Options</0>, and tap <0>Delete</0>.'
components={[<strong key={0} />]}
/>
</Text>
</li>
</ul>
</li>
<li className='mt5-notification-list-container-item'>
<li className='mt5-notification-list'>
<Text as='p' size='xs'>
<Localize
i18n_default_text='Search for the broker <0>Deriv Holdings (Guernsey) Limited</0> and select it.'
components={[<strong key={0} />]}
i18n_default_text='Log back in to MT5 after 7:30 GMT on 20 Oct 2023 if you’re having difficulty logging in to MT5 as we’re making some updates to our MT5 platform. <0>Follow these steps</0> to log back in to MT5.'
components={[
<a
className='mt5-notification-list__link'
target='_blank'
rel='noopener noreferrer'
href={mt5_community_url}
key={0}
onClick={() => {
setMT5NotificationModal(false);
}}
/>,
]}
/>
</Text>
</li>
<li className='mt5-notification-list-container-item'>
<li className='mt5-notification-list'>
<Text as='p' size='xs'>
<Localize i18n_default_text='Re-add your MT5 account using the same log in credentials.' />
<Localize
i18n_default_text='If you need further assistance, let us know via <0>live chat</0>.'
components={[
<a
className='mt5-notification-list__link'
onClick={() => {
window.LC_API.open_chat_window();
setMT5NotificationModal(false);
}}
key={0}
/>,
]}
/>
</Text>
</li>
</ol>
<Text as='p' size='xs'>
<Localize
i18n_default_text='If this doesn’t work, uninstall and re-install the MT5 app. Then redo steps <0>2</0> and <0>3</0>.'
components={[<strong key={0} />]}
/>
</Text>
<Text as='p' size='xs' className='mt5-notification-list-contact'>
<Localize i18n_default_text='Need more help? Contact us through live chat for assistance.' />
</Text>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
}
}
.mt5-notification-list {
list-style: none;
list-style: disc;
margin-top: 0.4rem;
&-container {
list-style: auto;
padding: 1.5rem;
padding-left: 1.5rem;
font-size: 1.6rem;
color: var(--text-general);
&-item {
list-style: decimal;
}
}
&-contact {
margin-top: 1rem;
&__link {
color: var(--text-red);
cursor: pointer;
text-decoration: underline;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const MT5Notification = observer(() => {
<Modal
has_close_icon={false}
is_open={is_mt5_notification_modal_visible}
title={localize('Trouble accessing Deriv MT5 on your mobile?')}
title={localize('Deriv MT5: Your action is needed')}
toggleModal={clickHandler}
className='mt5-notification-modal'
width='510px'
>
<Modal.Body className='mt5-notification-modal-body'>
<MT5NotificationDescription />
<MT5NotificationDescription setMT5NotificationModal={setMT5NotificationModal} />
</Modal.Body>
<Modal.Footer has_separator>
<Button
Expand All @@ -41,7 +41,7 @@ const MT5Notification = observer(() => {
<MobileDialog
portal_element_id='modal_root'
wrapper_classname='mt5-notification-modal-description'
title={localize('Trouble accessing Deriv MT5 on your mobile?')}
title={localize('Deriv MT5: Your action is needed')}
visible={is_mt5_notification_modal_visible}
onClose={() => {
setMT5NotificationModal(false);
Expand All @@ -60,7 +60,7 @@ const MT5Notification = observer(() => {
</div>
}
>
<MT5NotificationDescription />
<MT5NotificationDescription setMT5NotificationModal={setMT5NotificationModal} />
</MobileDialog>
</MobileWrapper>
</React.Suspense>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const AppNotificationMessages = ({
'trustpilot',
'unwelcome',
'additional_kyc_info',
'mt5_notification',
].includes(message.key) || message.type === 'p2p_completed_order'
: true;

Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/Stores/notification-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ export default class NotificationStore extends BaseStore {
this.addNotificationMessage(this.client_notifications.svg_poi_expired);
}
}
if (client && this.root_store.client.mt5_login_list.length > 0) {
this.addNotificationMessage(this.client_notifications.mt5_notification);
}
}

if (!is_eu && isMultiplierContract(selected_contract_type) && current_language === 'EN' && is_logged_in) {
Expand Down Expand Up @@ -1430,7 +1433,7 @@ export default class NotificationStore extends BaseStore {
},
mt5_notification: {
key: 'mt5_notification',
header: localize('Trouble accessing Deriv MT5 on your mobile?'),
header: localize('Deriv MT5: Your action is needed'),
message: localize('Follow these simple instructions to fix it.'),
action: {
text: localize('Learn more'),
Expand Down
3 changes: 3 additions & 0 deletions packages/shared/src/utils/cfd/cfd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,6 @@ export const getAuthenticationStatusInfo = (account_status: GetAccountStatus): T
is_idv_revoked,
};
};

export const mt5_community_url =
'https://community.deriv.com/t/log-in-using-mt5-pc-or-mobile-app-application-guideline/49622';

0 comments on commit c08c160

Please sign in to comment.