Skip to content

Commit

Permalink
feat(grower-detail): display device manufacturer with device id
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynndp committed Nov 15, 2021
1 parent 34d1ed7 commit ae0d3fc
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/components/GrowerDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ const GrowerDetail = (props) => {
sortedRegistrations
.map((reg) => ({
id: reg.device_identifier,
os: reg.manufacturer === 'apple' ? 'iOS' : 'Android',
os:
reg.manufacturer.toLowerCase() === 'apple'
? 'iOS'
: 'Android',
}))
.filter((id) => id),
);
Expand Down Expand Up @@ -252,16 +255,18 @@ const GrowerDetail = (props) => {
</Typography>
{(deviceIdentifiers.length && (
<table>
{deviceIdentifiers.map((device, i) => (
<tr key={i}>
<td>
<Typography variant="body1">{device.id}</Typography>
</td>
<td>
<Typography variant="body1">({device.os})</Typography>
</td>
</tr>
))}
<tbody>
{deviceIdentifiers.map((device, i) => (
<tr key={i}>
<td>
<Typography variant="body1">{device.id}</Typography>
</td>
<td>
<Typography variant="body1">({device.os})</Typography>
</td>
</tr>
))}
</tbody>
</table>
)) || <Typography variant="body1">---</Typography>}
</Grid>
Expand Down

0 comments on commit ae0d3fc

Please sign in to comment.