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

Commit

Permalink
use final icon for eco-responsible places
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-dupre committed Oct 26, 2022
1 parent f46ac66 commit 2e417e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions public/images/leaf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/components/ui/MainActionButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import classnames from 'classnames';
import { capitalizeFirst } from 'src/libs/string';
import { Flex } from '@qwant/qwant-ponents';
import { ReactComponent as IconLeaf } from '../../../public/images/leaf.svg';

const MainActionButton = ({
variant,
Expand All @@ -13,8 +14,6 @@ const MainActionButton = ({
ecoResponsible,
...rest
}) => {
const extraIconClass = ecoResponsible ? 'eco-responsible-icon' : '';

return (
<button
type="button"
Expand All @@ -29,7 +28,9 @@ const MainActionButton = ({
{...rest}
>
{typeof icon === 'string' ? (
<div className={`mainActionButton-icon icon-${icon} ${extraIconClass}`} style={iconStyle} />
<div className={`mainActionButton-icon icon-${icon}`} style={iconStyle}>
ecoResponsible && <IconLeaf className="ecoResponsible-icon" />
</div>
) : (
<Flex className="mainActionButton-icon" center>
{icon}
Expand Down
10 changes: 5 additions & 5 deletions src/scss/includes/components/mainActionButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
margin-bottom: $spacing-xs;
}

.eco-responsible-icon:after {
content: '🌳';
font-size: 20px;
.ecoResponsible-icon {
position: fixed;
margin-top: -15px;
margin-left: -5px;
width: 20px;
fill: var(--green-400);
margin-top: -10px;
margin-left: -10px;
}

&:active {
Expand Down

0 comments on commit 2e417e2

Please sign in to comment.