Skip to content

Commit

Permalink
Don't show buttons if user has no submitted application
Browse files Browse the repository at this point in the history
  • Loading branch information
Struck713 committed Mar 9, 2024
1 parent 85fdd44 commit ab8ae9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion staff-frontend/pages/users.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export default function UsersManager() {

const getActions = (user) => {
const checkedIn = user.checkedIn;
const actions = [<Button key="view" onClick={() => showReview(user)}>View Application</Button>];
const actions = [];
if (user.submittedApplication)
actions.push(<Button key="view" onClick={() => showReview(user)}>View Application</Button>);
if (user.applicationApproved)
actions.push(<Button key="checkin" disabled={checkedIn} type="primary" onClick={() => checkInUser(user)}>{checkedIn ? "Checked in" : "Check in"}</Button>)
return actions;
Expand Down

0 comments on commit ab8ae9d

Please sign in to comment.