Skip to content

Commit 3c5cbe8

Browse files
committed
Edits to Adoption/Foster records
1 parent 53d9f90 commit 3c5cbe8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/client/src/pages/DataView360/View/components/CollapsibleTable.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import PropTypes from 'prop-types';
32
import { makeStyles } from '@material-ui/core/styles';
43
import Box from '@material-ui/core/Box';
54
import Collapse from '@material-ui/core/Collapse';
@@ -31,10 +30,16 @@ function getAnimalAge(epochTime) {
3130
return moment().diff(dateOfBirth, 'years');
3231
}
3332

33+
function showAnimalAge(epochTime) {
34+
const age = getAnimalAge(epochTime)
35+
return (age === 1) ? `${age} year` : `${age} years`
36+
}
37+
3438
function Row(props) {
3539
const [open, setOpen] = React.useState(false);
3640
const classes = useRowStyles();
3741
const { row, events } = props;
42+
const photo = row.Photos[0]
3843
return (
3944
<React.Fragment>
4045
<TableRow className={classes.root}>
@@ -48,8 +53,8 @@ function Row(props) {
4853
</TableCell>
4954
<TableCell align="center">{row.Type}</TableCell>
5055
<TableCell align="center">{row.Breed}</TableCell>
51-
<TableCell align="center">{getAnimalAge(row.DOBUnixTime)}</TableCell>
52-
<TableCell align="center">{<img src={row.Photos[0]} alt="animal" style={{ "maxWidth": "100px" }} />}</TableCell>
56+
<TableCell align="center">{showAnimalAge(row.DOBUnixTime)}</TableCell>
57+
<TableCell align="center">{<img src={photo} alt="animal" style={{ "maxWidth": "100px" }} />}</TableCell>
5358
</TableRow>
5459
<TableRow>
5560
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}>
@@ -62,7 +67,7 @@ function Row(props) {
6267
<TableHead>
6368
<TableRow>
6469
<TableCell align="center">Subtype</TableCell>
65-
<TableCell align="center">Time</TableCell>
70+
<TableCell align="center">Date</TableCell>
6671
<TableCell align="center">Type</TableCell>
6772
<TableCell align="center">User</TableCell>
6873
</TableRow>

0 commit comments

Comments
 (0)