Skip to content
Snippets Groups Projects
Commit 9a3776ba authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Fix default icon

parent abb8ca78
Branches
Tags
1 merge request!291Fix/design adjustments
......@@ -20,16 +20,12 @@ const EcogestureCard: React.FC<EcogestureCardProps> = ({
const handleCardclick = () => {
handleClick && ecogesture && handleClick(ecogesture)
}
const [ecogestureIcon, setEcogestureIcon] = useState<string>()
const [ecogestureIcon, setEcogestureIcon] = useState<string>('')
useEffect(() => {
if (ecogesture) {
importIconbyId(ecogesture.id, 'ecogesture').then(icon => {
if (icon) {
setEcogestureIcon(icon)
} else {
setEcogestureIcon(defaultIcon)
}
icon ? setEcogestureIcon(icon) : setEcogestureIcon(defaultIcon)
})
}
}, [ecogesture])
......@@ -40,13 +36,7 @@ const EcogestureCard: React.FC<EcogestureCardProps> = ({
<div className="ec">
<div className={`ec-content `}>
<div className="ec-content-icon">
{ecogestureIcon && (
<StyledIcon
className="Icon"
icon={ecogestureIcon || ''}
size={50}
/>
)}
<StyledIcon className="Icon" icon={ecogestureIcon} size={50} />
</div>
<div className="ec-content-short-name text-15-bold">
{ecogesture.shortName}
......
......@@ -14,6 +14,8 @@ import { useSelector } from 'react-redux'
import MuiButton from '@material-ui/core/Button'
import EfficientyRating from './EfficientyRating'
import classNames from 'classnames'
import defaultIcon from 'assets/icons/visu/ecogesture/default.svg'
interface EcogestureModalProps {
ecogesture: Ecogesture
isAction: boolean
......@@ -41,7 +43,7 @@ const EcogestureModal: React.FC<EcogestureModalProps> = ({
useEffect(() => {
if (ecogesture) {
importIconbyId(ecogesture.id, 'ecogesture').then(icon => {
icon && setEcogestureIcon(icon)
icon ? setEcogestureIcon(icon) : setEcogestureIcon(defaultIcon)
})
if (
currentChallenge &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment