Vehicules status colors

Anton Tananaeva year ago

What's the problem with adding it again? Seems like a trivial change.

You ka year ago

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

Cristiana year ago

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

Joysticka year ago

@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) }}>