Remove some chained ternaries
Closed this issue ยท 6 comments
I like chained ternaries
and I love how they used in this project.
But I think sometimes chained ternaries
are not the best option. (depends on logic)
For example, I think above code snippet might be more readable and sustainable when written like this :
{
...
background-color: ${({theme, type, outlined, disabled}) => {
if (disabled) return undefined;
if (outlined) return theme.background;
return theme[type ?? 'primary'];
}};
}
Please let me know your opinion on this. ๐
I definitely agree with this point of view! Please try the PR
if you can.
This refactoring can be done many places in dooboo-ui
.
I only did some. There's lot left. So anyone can contribute by doing it.
@Einere I'm not sure whether all the codes related to this have been fixed, but most of them seem to have been modified, so I will close it for now.
Thanks.
@yujong-lee
Ah, I didn't aware of that.
I just commented because related PR is merged. sorry.. ๐