Answer the question
In order to leave comments, you need to log in
How to make the value of a variable equal to the value from the object?
The name of one of the status states ('published', 'canceled', 'error' ... ) is passed to the component. After that, with the help of material ui, the appearance of the component should change.
border: (props) =>
props.status === 'published'
? "2px solid #F6AD55"
: "2px solid #9ae6b4",
Answer the question
In order to leave comments, you need to log in
const borders = {
published: "2px solid #F6AD55",
...
}
...
return borders[props.status]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question