Yes it is, but in the 5.6 release the DeviceList.js has changed and this function doesn't work anymore i need to figure out what's wrong with it
try doing this in DeviceRow.js:
const getStatusColorIcon = (item) => {
switch (item.status) {
case 'online':
return 'green';
case 'offline':
return 'red';
case 'unknown':
default:
return 'gray';
}
};
<Avatar style={{ background: getStatusColorIcon(item) }}>
can be a start
@Cristian,
Thanks for the info, I managed to change the background color using your example.
One question though, if I want to change the actual icon image color, what should I use as the style. I have tried a few options without any luck.
I have tried:
<Avatar style={{ color: getStatusColorIcon(item) }}>
<Avatar style={{ iconColor: getStatusColorIcon(item) }}>
<Avatar style={{ bgcolor: getStatusColorIcon(item) }}>
What's the problem with adding it again? Seems like a trivial change.