Skip to content

Commit

Permalink
Amina/fix: regulator switcher (#99)
Browse files Browse the repository at this point in the history
* fix: regulator

* fix: regulator
  • Loading branch information
amina-deriv committed Jan 5, 2023
1 parent c5293c3 commit 2a98f34
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit 2a98f34

Please sign in to comment.