Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amina/fix: regulator switcher #99

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/appstore/src/components/main-title-bar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { Text, DesktopWrapper, MobileWrapper, Tabs, Icon } from '@deriv/components';
import { ContentFlag } from '@deriv/shared';
import AccountTypeDropdown from './account-type-dropdown';
import AssetSummary from './asset-summary';
import RegulatorSwitcher from './regulators-switcher';
Expand All @@ -9,9 +10,10 @@ import { observer } from 'mobx-react-lite';
import { useStores } from 'Stores/index';

const MainTitleBar = () => {
const { traders_hub, client } = useStores();
const { active_index, handleTabItemClick, toggleRegulatorsCompareModal, is_real } = traders_hub;
const { is_low_risk } = client;
const { traders_hub } = useStores();
const { active_index, handleTabItemClick, toggleRegulatorsCompareModal, content_flag } = traders_hub;
const is_low_risk_cr_real_account =
content_flag === ContentFlag.LOW_RISK_CR_NON_EU || content_flag === ContentFlag.LOW_RISK_CR_EU;

return (
<React.Fragment>
Expand All @@ -23,7 +25,7 @@ const MainTitleBar = () => {
</Text>
<AccountTypeDropdown />
</div>
{is_real && is_low_risk ? <RegulatorSwitcher /> : null}
{is_low_risk_cr_real_account && <RegulatorSwitcher />}
<AssetSummary />
</div>
</DesktopWrapper>
Expand All @@ -33,7 +35,7 @@ const MainTitleBar = () => {
<div className='main-title-bar-mobile--account-type-dropdown'>
<AccountTypeDropdown />
</div>
{is_real && is_low_risk ? (
{is_low_risk_cr_real_account && (
<div className='main-title-bar-mobile--regulator'>
<div
className='main-title-bar-mobile--regulator--compare-modal'
Expand All @@ -52,7 +54,7 @@ const MainTitleBar = () => {
<div label={localize('EU')} />
</Tabs>
</div>
) : null}
)}
</div>
<AssetSummary />
</MobileWrapper>
Expand Down