Skip to content

Commit e8e207f

Browse files
authored
Merge branch 'master' into US-change-name-adding-insurers-services-and-programs
2 parents 976b438 + 4c43395 commit e8e207f

File tree

2 files changed

+54
-13
lines changed

2 files changed

+54
-13
lines changed

frontend/src/components/ParticipantsList.js

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,40 @@ import TableCell from "@material-ui/core/TableCell"
88
import TableHead from "@material-ui/core/TableHead"
99
import TableRow from "@material-ui/core/TableRow"
1010
import Fab from "@material-ui/core/Fab"
11-
import AddIcon from "@material-ui/icons/Add"
1211
import AssignmentIndIcon from "@material-ui/icons/AssignmentInd"
1312
import { observer } from "mobx-react-lite"
1413
import { Link } from "react-router-dom"
14+
import BottomNavigation from "@material-ui/core/BottomNavigation"
15+
import PersonAddIcon from "@material-ui/icons/PersonAdd"
16+
import { makeStyles } from "@material-ui/core/styles"
17+
import Grid from "@material-ui/core/Grid"
1518

1619
const ParticipantsList = observer(() => {
20+
const useStyles = makeStyles({
21+
addParticipantNav: {
22+
width: "100%",
23+
position: "fixed",
24+
bottom: 0,
25+
left: 0,
26+
right: 0,
27+
backgroundColor: "#d4d4d4",
28+
height: "auto",
29+
},
30+
addParticipant: {
31+
float: "right",
32+
},
33+
addParticipantText: {
34+
float: "left",
35+
color: "primary",
36+
fontWeight: "bold",
37+
marginRight: "1em",
38+
display: "inline-block",
39+
verticalAlign: "middle",
40+
lineHeight: "normal",
41+
},
42+
})
43+
const classes = useStyles()
44+
1745
const rootStore = useContext(rootStoreContext)
1846
const participantsStore = rootStore.ParticipantStore
1947
const [isLoading, setIsLoading] = useState(false)
@@ -49,9 +77,6 @@ const ParticipantsList = observer(() => {
4977
<Table>
5078
<TableHead>
5179
<TableRow>
52-
<TableCell>
53-
<Typography>#</Typography>
54-
</TableCell>
5580
<TableCell>
5681
<Typography>PPID</Typography>
5782
</TableCell>
@@ -71,7 +96,7 @@ const ParticipantsList = observer(() => {
7196
<Typography>Race</Typography>
7297
</TableCell>
7398
<TableCell>
74-
<Typography>Edit Participant Info</Typography>
99+
<Typography>Edit Participant</Typography>
75100
</TableCell>
76101
</TableRow>
77102
</TableHead>
@@ -81,9 +106,6 @@ const ParticipantsList = observer(() => {
81106
key={index}
82107
onClick={e => handleParticipant(e, participant)}
83108
>
84-
<TableCell>
85-
<Typography>Number</Typography>
86-
</TableCell>
87109
<TableCell>
88110
<Typography>{participant.pp_id} </Typography>
89111
</TableCell>
@@ -114,9 +136,21 @@ const ParticipantsList = observer(() => {
114136
</TableBody>
115137
</Table>
116138
</div>
117-
<Fab color="primary" aria-label="add" size="large">
118-
<AddIcon />
119-
</Fab>
139+
<BottomNavigation showLabels className={classes.addParticipantNav}>
140+
<Link to="/participantInfo">
141+
<Grid container>
142+
<Grid container item justify="flex-end">
143+
<Typography
144+
color="primary"
145+
style={{ fontSize: 28, paddingRight: "0.75em" }}
146+
>
147+
Add Participant
148+
</Typography>
149+
<PersonAddIcon color="primary" style={{ fontSize: 50 }} />
150+
</Grid>
151+
</Grid>
152+
</Link>
153+
</BottomNavigation>
120154
</div>
121155
)}
122156
</Fragment>

frontend/src/components/QueueTable.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const QueueTable = observer(queueData => {
7878
title={queueStore.queueStats[queueData.queueData].name}
7979
className={classes.table}
8080
localization={{ body: { emptyDataSourceMessage: "Queue is empty" } }}
81-
options={{ search: false }}
81+
options={{ search: false, sorting: true }}
8282
data={queueStore.queues[queueData.queueData].map(x => ({
8383
urgency: x.urgency,
8484
last: x.participant.last_name,
@@ -103,10 +103,17 @@ const QueueTable = observer(queueData => {
103103
column="urgency"
104104
/>
105105
),
106+
customSort: (a, b) => +a.urgency[1] - +b.urgency[1],
106107
},
107108
{ title: "Last", field: "last" },
108109
{ title: "UID", field: "uid" },
109-
{ title: "Time", field: "timeElapsed" },
110+
{
111+
title: "Time",
112+
field: "timeElapsed",
113+
customSort: (a, b) =>
114+
new Date("1970/01/01 " + a.timeElapsed) -
115+
new Date("1970/01/01 " + b.timeElapsed),
116+
},
110117
{
111118
title: "Status",
112119
//eslint-disable-next-line

0 commit comments

Comments
 (0)