Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix: sonar cloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-matskevich-deriv committed Jan 8, 2024
1 parent 5ab5e4f commit 2d1b72b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ const AccountWalletDropdown = React.forwardRef(({ setIsAccDropdownOpen }, dropdo
<span>{translate('Looking for CFDs? Go to Trader\'s hub')}</span>

<a href={config.tradershub.url} className={'account__switcher-total--link'}>
<img className={'header__expand'} src='/public/images/ic-chevron-down-bold.svg' />
<img
className={'header__expand'}
src='/public/images/ic-chevron-down-bold.svg'
alt='wallet_icon'
/>
</a>
</div>
</div>
Expand Down
19 changes: 9 additions & 10 deletions src/components/Header/WalletAccountSwitcher/wallet-icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ const WalletIcon = ({ currency, is_virtual, currency_icon }) => {
return wallet_icons.includes(_currency.toLowerCase());
};

const src_path =
isWalletIcon(currency) && !is_virtual
? `${wallet_icon_path}${currency_icon}.svg`
: is_virtual
? `${wallet_icon_path}ic-wallet-deriv-demo-light.svg`
: default_currency_icon_path;

return (
<div className='acc-info__wallets-container'>
{
<div className='app-icon__top-icon'>
<div className='wallet-icon'>
<img src={`${wallet_icon_path}ic-wallet-options-light.svg`} />
<img src={`${wallet_icon_path}ic-wallet-options-light.svg`} alt='wallet_icon' />
</div>
</div>
}
Expand All @@ -25,15 +32,7 @@ const WalletIcon = ({ currency, is_virtual, currency_icon }) => {
is_virtual ? 'demo' : currency.toLowerCase()
}-bg`}
>
<img
src={
isWalletIcon(currency) && !is_virtual
? `${wallet_icon_path}${currency_icon}.svg`
: is_virtual
? `${wallet_icon_path}ic-wallet-deriv-demo-light.svg`
: default_currency_icon_path
}
/>
<img src={src_path} alt='wallet_icon' />
</div>
</div>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/components/Header/account-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const AccountMenu = ({ is_open }) => {
{has_wallet_account ? (
<WalletIcon currency={currency} is_virtual={is_virtual} currency_icon={currency_icon} />
) : (
<img className='header__acc-icon' src={`/public/images/currency/ic-currency-${currency_icon}.svg`} />
<img
className='header__acc-icon'
src={`/public/images/currency/ic-currency-${currency_icon}.svg`}
alt='icon'
/>
)}
<div
id='header__acc-balance'
Expand All @@ -52,6 +56,7 @@ const AccountMenu = ({ is_open }) => {
<img
className={classNames('header__icon header__expand', { open: is_open })}
src={`/public/images/${account_icon}.svg`}
alt='icon'
/>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/text/text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const isEmptyObject = obj => {
let is_empty = true;
if (obj && obj instanceof Object) {
Object.keys(obj).forEach(key => {
if (Object.prototype.hasOwnProperty.call(obj, key)) is_empty = false;
if (Object.hasOwn(obj, key)) is_empty = false;
});
}
return is_empty;
Expand Down

0 comments on commit 2d1b72b

Please sign in to comment.