Skip to content

Commit

Permalink
Aizad/88786/mt5 redirection modal fix (#7663)
Browse files Browse the repository at this point in the history
* chore: fix mt5 redirection modal closing on trade

* fix: modal and dialog close seperately after clicking outside

* fix: re-add dialog_status condition back to redirect-notice-modal

* fix: reverted the previous changes

* fix: remove useclickoutside for page overlay

* fix: update deriv/api package to latest version

* fix: updated package version to match with master

* Merge branch 'develop' of github.com:binary-com/deriv-app into aizad/88786/mt5-redirection-modal-fix

* fix: codecov and circleci

* fix: upgrade package
  • Loading branch information
aizad-deriv committed Mar 21, 2023
1 parent be43adf commit 7966d0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
10 changes: 1 addition & 9 deletions packages/cfd/src/Containers/mt5-trade-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import DerivXTradeModal from './derivx-trade-modal';

type TMT5TradeModalProps = {
mt5_trade_account: Required<DetailsOfEachMT5Loginid>;
disableApp: () => void;
enableApp: () => void;
is_eu_user: boolean;
is_open: boolean;
onPasswordManager: (
Expand All @@ -30,8 +28,6 @@ type TMT5TradeModalProps = {

const MT5TradeModal = ({
mt5_trade_account,
disableApp,
enableApp,
is_eu_user,
is_open,
onPasswordManager,
Expand Down Expand Up @@ -69,8 +65,6 @@ const MT5TradeModal = ({
<React.Suspense fallback={<UILoader />}>
<DesktopWrapper>
<Modal
disableApp={disableApp}
enableApp={enableApp}
is_open={is_open}
title={localize('Trade')}
toggleModal={toggleModal}
Expand Down Expand Up @@ -98,11 +92,9 @@ const MT5TradeModal = ({
);
};

export default connect(({ modules: { cfd }, modules, ui, common, traders_hub }: RootStore) => ({
export default connect(({ modules: { cfd }, modules, common, traders_hub }: RootStore) => ({
dxtrade_tokens: cfd.dxtrade_tokens,
platform: common.platform,
disableApp: ui.disableApp,
enableApp: ui.enableApp,
mt5_trade_account: modules.cfd.mt5_trade_account,
show_eu_related_content: traders_hub.show_eu_related_content,
}))(MT5TradeModal);
2 changes: 1 addition & 1 deletion packages/components/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const ModalElement = ({
modal_root_ref.current?.querySelectorAll(portal_elements_selector.join(', ')).length;

const validateClickOutside = (e: IClickEvent): boolean => {
const is_absolute_modal_visible = document.getElementById('modal_root_absolute')?.hasChildNodes();
const is_absolute_modal_visible = document.getElementById('popup_root')?.hasChildNodes();
const path = e.path ?? e.composedPath?.();
return (
has_close_icon &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const PageOverlay = ({
header_classname,
}: React.PropsWithChildren<TPageOverlay>) => {
const page_overlay_ref = React.useRef<HTMLDivElement>(null);
useOnClickOutside(page_overlay_ref, onClickClose, () => !!(is_open && portal_id));

const el_page_overlay = (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,18 @@ const RedirectNoticeModal = ({ is_logged_in, is_eu, portal_id }) => {
}, [is_logged_in, is_eu]);

return ReactDOM.createPortal(
dialog_status ? (
<Dialog
className='redirect-notice'
is_visible={dialog_status}
title='Redirect notice'
is_open={dialog_status}
cancel_button_text={localize('Cancel')}
confirm_button_text={localize('Proceed')}
onCancel={onCancelDialog}
onConfirm={onConfirmDialog}
>
{localize('You are being redirected to an external website.')}
</Dialog>
) : null,
<Dialog
className='redirect-notice'
is_visible={dialog_status}
title='Redirect notice'
cancel_button_text={localize('Cancel')}
confirm_button_text={localize('Proceed')}
onCancel={onCancelDialog}
onConfirm={onConfirmDialog}
dismissable={onCancelDialog}
>
{localize('You are being redirected to an external website.')}
</Dialog>,
document.getElementById(portal_id)
);
};
Expand Down

1 comment on commit 7966d0d

@vercel
Copy link

@vercel vercel bot commented on 7966d0d Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app-git-master.binary.sx
deriv-app.vercel.app
binary.sx
deriv-app.binary.sx

Please sign in to comment.