Skip to content

Commit

Permalink
DTRA / Kate / DTRA-1432 / Account switcher DTrader-V2 fixes (binary-c…
Browse files Browse the repository at this point in the history
…om#16165)

* fix: account disabled state

* fix: button style
  • Loading branch information
kate-deriv committed Jul 29, 2024
1 parent 9b2220e commit 1f8e870
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type TAccountListDTraderV2 = {
currency?: string;
has_balance?: boolean;
has_reset_balance?: boolean;
is_disabled?: boolean | number;
is_disabled?: boolean;
is_virtual?: boolean | number;
loginid?: string;
onClickResetVirtualBalance?: () => Promise<void>;
Expand Down Expand Up @@ -53,7 +53,7 @@ const AccountListDTraderV2 = ({
</div>
{has_reset_balance ? (
<Button
disabled={!!is_disabled}
disabled={is_disabled}
color='white'
label={<Localize i18n_default_text='Reset balance' />}
onClick={e => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const AccountSwitcherDTraderV2 = observer(({ history }: TAccountSwitcherDTraderV
currency={accounts[item?.loginid ?? '']?.currency}
has_balance={'balance' in accounts[item?.loginid ?? '']}
has_reset_balance={is_demo && isAbleToResetBalance(accounts[account_loginid ?? ''])}
is_disabled={item.is_disabled}
is_disabled={!!item.is_disabled}
is_virtual={item.is_virtual}
loginid={item.loginid}
redirectAccount={item.is_disabled ? undefined : () => handleSwitchAccount(item.loginid)}
Expand Down Expand Up @@ -190,7 +190,7 @@ const AccountSwitcherDTraderV2 = observer(({ history }: TAccountSwitcherDTraderV
.map(account => getAddAccountButton(account))}
</AccountGroupWrapper>
)}
{(!is_high_risk || is_eu) && has_maltainvest_account && (
{((!is_high_risk && has_maltainvest_account) || is_eu) && (
<AccountGroupWrapper
separator_text={
is_low_risk && localize(`EU Deriv ${hasMoreAccounts(BROKER_CODE.MF) ? 'accounts' : 'account'}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
gap: var(--core-spacing-800);

&__container {
background-color: unset;
border: none;
width: 100%;
height: var(--core-size-4000);
padding: var(--core-spacing-400);
Expand Down

0 comments on commit 1f8e870

Please sign in to comment.