Skip to content

Commit

Permalink
Adrienne / Changed styling for Inactive chip and long text is wrapped…
Browse files Browse the repository at this point in the history
… when overflown (#5974)

* Changed styling for Inactive chip and text is wrapped when overflown

* Used Text align prop to center text
  • Loading branch information
adrienne-deriv committed Aug 29, 2022
1 parent a6fad14 commit 6e8386c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 34 deletions.
18 changes: 16 additions & 2 deletions packages/p2p/src/components/my-ads/ad-status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,28 @@ import './ad-status.scss';
const AdStatus = ({ is_active }) => {
if (!is_active) {
return (
<Text className='ad-status--inactive' color='loss-danger' line_height='s' size='xs' weight='bold'>
<Text
align='center'
className='ad-status--inactive'
color='loss-danger'
line_height='s'
size='xs'
weight='bold'
>
<Localize i18n_default_text='Inactive' />
</Text>
);
}

return (
<Text className='ad-status--active' color='profit-success' line_height='s' size='xs' weight='bold'>
<Text
align='center'
className='ad-status--active'
color='profit-success'
line_height='s'
size='xs'
weight='bold'
>
<Localize i18n_default_text='Active' />
</Text>
);
Expand Down
56 changes: 24 additions & 32 deletions packages/p2p/src/components/my-ads/ad-status.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
@mixin ad-status-base($background-color) {
&:before {
content: '';
height: 100%;
width: 100%;
opacity: 0.16;
display: block;
position: absolute;
left: 0;
top: 0;
border-radius: 1.6rem;
background-color: $background-color;
}
align-items: center;
display: flex;
justify-content: center;
padding: 0.1rem 1.2rem;
position: relative;
text-align: center;
}

.ad-status {
&--active {
&:before {
content: '';
height: 100%;
width: 100%;
background-color: var(--status-success);
opacity: 0.16;
display: block;
position: absolute;
left: 0;
top: 0;
border-radius: 1.6rem;
}
padding: 0.1rem 1.2rem;
text-align: center;
display: flex;
position: relative;
@include ad-status-base(var(--status-success));

width: 6.7rem;

@include mobile {
Expand All @@ -25,22 +32,7 @@
}

&--inactive {
&:before {
content: '';
height: 100%;
width: 100%;
background-color: var(--status-danger);
opacity: 0.16;
display: block;
position: absolute;
left: 0;
top: 0;
border-radius: 1.6rem;
}
padding: 0.1rem 1.2rem;
text-align: center;
display: flex;
position: relative;
@include ad-status-base(var(--status-danger));
width: 8rem;
}
}

1 comment on commit 6e8386c

@vercel
Copy link

@vercel vercel bot commented on 6e8386c Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

binary.sx
deriv-app.vercel.app
deriv-app-git-master.binary.sx
deriv-app.binary.sx

Please sign in to comment.