Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adrienne / Changed styling for Inactive chip and long text is wrapped when overflown #5974

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 11 additions & 9 deletions packages/p2p/src/components/my-ads/ad-status.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
@mixin ad-status-base {
border-radius: 1.6rem;
padding: 0.2rem 1.6rem;
width: 8.8rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is it fine to have the mixins here or should we add this to the mixins.scss?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my opinion, not really since this mixin is only included here for reducing code duplication and is only specific for ad status styling, since both the active and inactive ad status share a lot of the same css properties. If maybe however in the future we have mixins that is reusable like making calculations etc, we could include it in our own mixins.scss file for P2P


.ad-status {
&--active {
@include ad-status-base;
background: rgba(75, 180, 179, 0.16);
border-radius: 1.6rem;
padding: 0.2rem 1.6rem;
text-align: center;
width: 8.8rem;

@include mobile {
margin-bottom: 0.8rem;
Expand All @@ -13,11 +16,10 @@
}

&--inactive {
border: 1px solid var(--status-danger);
border-radius: 0.2rem;
padding: 0.1rem 1.2rem;
text-align: center;
width: 8.8rem;
@include ad-status-base;
background: rgba(236, 63, 63, 0.16);
display: flex;
justify-content: center;

@include mobile {
margin-bottom: 0.8rem;
Expand Down