Skip to content

Commit

Permalink
Revert "fix: regulatory information (deriv-com#7543)" (deriv-com#7552)
Browse files Browse the repository at this point in the history
This reverts commit 1ca6b30.
  • Loading branch information
mahdiyeh-deriv authored and Carol Sachdeva committed Feb 8, 2023
1 parent 4deb5dd commit 0179b94
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ const MFRegulatoryInformation = () => (
</div>
);

export const RegulatoryInformation = ({ landing_company, is_eu, show_eu_related_content }) => {
export const RegulatoryInformation = ({ landing_company, is_eu }) => {
const [should_show_modal, showModal] = React.useState(false);
if (!is_eu || (is_eu && !show_eu_related_content)) return null;
if (!is_eu) return null;
const is_mx = landing_company === 'iom';
const is_mlt = landing_company === 'malta';
const is_mf = landing_company === 'maltainvest';
Expand All @@ -114,7 +114,7 @@ export const RegulatoryInformation = ({ landing_company, is_eu, show_eu_related_
>
{is_mx && <MXRegulatoryInformation />}
{is_mlt && <MLTRegulatoryInformation />}
{(is_mf || show_eu_related_content) && <MFRegulatoryInformation />}{' '}
{is_mf && <MFRegulatoryInformation />}
</Modal>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
is_landing_company_loaded,
is_pre_appstore,
setIsPreAppStore,
is_eu,
} = client;
const { cashier } = modules;
const { general_store, payment_agent_transfer, payment_agent, account_transfer } = cashier;
const { is_p2p_enabled } = general_store;
const { is_payment_agent_transfer_visible } = payment_agent_transfer;
const { is_payment_agent_visible } = payment_agent;
const { is_account_transfer_visible } = account_transfer;
const { content_flag, should_show_exit_traders_modal, switchToCRAccount, show_eu_related_content } = traders_hub;
const { content_flag, should_show_exit_traders_modal, switchToCRAccount } = traders_hub;
const is_onramp_visible = useOnrampVisible();

const liveChat = useLiveChat();
Expand Down Expand Up @@ -551,16 +550,14 @@ const ToggleMenuDrawer = observer(({ platform_config }) => {
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
{is_eu && show_eu_related_content && !is_virtual && (
<MobileDrawer.Item>
<MenuLink
link_to={getStaticUrl('/regulatory')}
icon='IcRegulatoryInformation'
text={localize('Regulatory information')}
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
)}
<MobileDrawer.Item>
<MenuLink
link_to={getStaticUrl('/regulatory')}
icon='IcRegulatoryInformation'
text={localize('Regulatory information')}
onClickLink={toggleDrawer}
/>
</MobileDrawer.Item>
<MobileDrawer.Item className='header__menu-mobile-theme--trader-hub'>
<MenuLink
link_to={getStaticUrl('/')}
Expand Down
11 changes: 2 additions & 9 deletions packages/core/src/App/Containers/Layout/default-footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const Footer = ({
settings_extension,
landing_company_shortcode,
is_pre_appstore,
show_eu_related_content,
}) => {
let footer_extensions_left = [];
let footer_extensions_right = [];
Expand Down Expand Up @@ -76,11 +75,7 @@ const Footer = ({
<ResponsibleTrading />
{is_logged_in && <AccountLimitsFooter />}
{is_logged_in && !is_virtual && (
<RegulatoryInformation
landing_company={landing_company_shortcode}
is_eu={is_eu}
show_eu_related_content={show_eu_related_content}
/>
<RegulatoryInformation landing_company={landing_company_shortcode} is_eu={is_eu} />
)}
<FooterIconSeparator />
<HelpCentre />
Expand Down Expand Up @@ -113,11 +108,10 @@ Footer.propTypes = {
enableApp: PropTypes.func,
footer_extensions: PropTypes.array,
is_pre_appstore: PropTypes.bool,
show_eu_related_content: PropTypes.bool,
};

export default withRouter(
connect(({ client, ui, traders_hub }) => ({
connect(({ client, ui }) => ({
enableApp: ui.enableApp,
footer_extensions: ui.footer_extensions,
settings_extension: ui.settings_extension,
Expand All @@ -132,6 +126,5 @@ export default withRouter(
disableApp: ui.disableApp,
toggleSettingsModal: ui.toggleSettingsModal,
is_pre_appstore: client.is_pre_appstore,
show_eu_related_content: traders_hub.show_eu_related_content,
}))(Footer)
);
11 changes: 2 additions & 9 deletions packages/core/src/App/Containers/Layout/trading-hub-footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const TradingHubFooter = ({
setDarkMode,
is_dark_mode,
is_pre_appstore,
show_eu_related_content,
}) => {
let footer_extensions_left = [];
let footer_extensions_right = [];
Expand Down Expand Up @@ -90,11 +89,7 @@ const TradingHubFooter = ({
<ResponsibleTrading />
{is_logged_in && <AccountLimitsFooter />}
{is_logged_in && !is_virtual && (
<RegulatoryInformation
landing_company={landing_company_shortcode}
is_eu={is_eu}
show_eu_related_content={show_eu_related_content}
/>
<RegulatoryInformation landing_company={landing_company_shortcode} is_eu={is_eu} />
)}
<div className='footer__links--dark-mode'>
<Popover alignment='top' message='Change theme'>
Expand Down Expand Up @@ -140,11 +135,10 @@ TradingHubFooter.propTypes = {
is_dark_mode: PropTypes.bool,
setDarkMode: PropTypes.func,
is_pre_appstore: PropTypes.bool,
show_eu_related_content: PropTypes.bool,
};

export default withRouter(
connect(({ client, ui, traders_hub }) => ({
connect(({ client, ui }) => ({
enableApp: ui.enableApp,
footer_extensions: ui.footer_extensions,
settings_extension: ui.settings_extension,
Expand All @@ -161,6 +155,5 @@ export default withRouter(
is_dark_mode: ui.is_dark_mode_on,
setDarkMode: ui.setDarkMode,
is_pre_appstore: client.is_pre_appstore,
show_eu_related_content: traders_hub.show_eu_related_content,
}))(TradingHubFooter)
);

0 comments on commit 0179b94

Please sign in to comment.