Skip to content

Commit

Permalink
fix: renamed your ads are running to hide my ads
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed May 11, 2023
1 parent 62bd456 commit 582ff90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
7 changes: 0 additions & 7 deletions packages/p2p/src/components/my-ads/my-ads.scss
Original file line number Diff line number Diff line change
Expand Up @@ -713,18 +713,11 @@
.toggle-ads {
display: flex;
align-items: center;
font-size: var(--text-size-s);
justify-items: flex-start;

&__message {
margin-right: 1.6rem;
}
&--on {
color: var(--text-profit-success);
}
&--off {
color: var(--text-less-prominent);
}
}

&__expand-button {
Expand Down
26 changes: 11 additions & 15 deletions packages/p2p/src/components/my-ads/toggle-ads.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ToggleSwitch } from '@deriv/components';
import { Text, ToggleSwitch } from '@deriv/components';
import { useIsMounted } from '@deriv/shared';
import classNames from 'classnames';
import { observer } from 'mobx-react-lite';
import { requestWS } from 'Utils/websocket';
import { localize } from 'Components/i18next';
import { Localize } from '@deriv/translations';
import { useStores } from 'Stores';
import './my-ads.scss';

Expand Down Expand Up @@ -33,18 +32,15 @@ const ToggleAds = observer(() => {
};

return (
<div
className={classNames('toggle-ads', {
'toggle-ads--on': general_store.is_listed,
'toggle-ads--off': !general_store.is_listed || general_store.is_barred,
})}
>
<div className='toggle-ads__message'>
{(my_ads_store.api_error || general_store.is_listed) && !general_store.is_barred
? localize('Your ads are running')
: localize('Your ads are paused')}
</div>

<div className='toggle-ads'>
<Text
className='toggle-ads__message'
color={`${general_store.is_listed ? 'profit-success' : 'less-prominent'}`}
line_height='xl'
size='xs'
>
<Localize i18n_default_text='Hide my ads' />
</Text>
<ToggleSwitch
id='toggle-my-ads'
is_enabled={general_store.is_listed && !general_store.is_barred}
Expand Down

0 comments on commit 582ff90

Please sign in to comment.