Skip to content

Commit

Permalink
fix: mt5 alignment for both financial and derived section (#6897)
Browse files Browse the repository at this point in the history
  • Loading branch information
aizad-deriv committed Nov 17, 2022
1 parent 8c1e247 commit db89c9a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
36 changes: 20 additions & 16 deletions packages/cfd/src/Components/cfd-account-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import classNames from 'classnames';
import React from 'react';
import { CSSTransition } from 'react-transition-group';
import { Icon, Money, Button, Text, DesktopWrapper, MobileWrapper, Popover } from '@deriv/components';
import { isMobile, mobileOSDetect, getCFDPlatformLabel, CFD_PLATFORMS } from '@deriv/shared';
import { isMobile, mobileOSDetect, getCFDPlatformLabel, CFD_PLATFORMS, isDesktop } from '@deriv/shared';
import { localize, Localize } from '@deriv/translations';
import { connect } from 'Stores/connect';
import RootStore from 'Stores/index';
Expand Down Expand Up @@ -330,21 +330,25 @@ const CFDAccountCardComponent = ({
)}
</div>
</div>
{platform === CFD_PLATFORMS.MT5 && type.type === 'financial' && !isMobile() && is_logged_in && (
<Button
onClick={() => setIsAcuityModalOpen(true)}
className='cfd-account-card__acuity-banner'
type='button'
transparent
>
<div className='cfd-account-card__acuity-banner--wrapper'>
<Icon icon='icMt5Acuity' />
<Text as='p' size='xxs' weight='bold' color='prominent'>
<Localize i18n_default_text='Get Acuity trading tools' />
</Text>
<Icon icon='IcAddOutline' color='secondary' />
</div>
</Button>
{platform === CFD_PLATFORMS.MT5 && isDesktop() && is_logged_in && (
<div className='cfd-account-card__acuity-container'>
{type.type === 'financial' && (
<Button
onClick={() => setIsAcuityModalOpen(true)}
className='cfd-account-card__acuity-banner'
type='button'
transparent
>
<div className='cfd-account-card__acuity-banner--wrapper'>
<Icon icon='icMt5Acuity' />
<Text as='p' size='xxs' weight='bold' color='prominent'>
<Localize i18n_default_text='Get Acuity trading tools' />
</Text>
<Icon icon='IcAddOutline' color='secondary' />
</div>
</Button>
)}
</div>
)}
{existing_data && <div className='cfd-account-card__divider' />}

Expand Down
9 changes: 7 additions & 2 deletions packages/cfd/src/sass/cfd-dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1086,11 +1086,16 @@
}
}

&__acuity-container {
height: 3.4rem;
margin: 1.6rem;
}

&__acuity-banner {
background: var(--general-section-1);
height: 3.4rem;
border-radius: 0.8rem;
margin: 1.6rem;
width: 100%;
height: 100%;

&--wrapper {
display: flex;
Expand Down

0 comments on commit db89c9a

Please sign in to comment.