Skip to content

Commit

Permalink
fix: clicking on the icon sends the right status
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastia committed Jun 22, 2021
1 parent 2945028 commit b366634
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/components/Admin/ApplicationReview/DecisionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export const DecisionModal: React.FunctionComponent<Props> = ({
? `Revert Decision`
: 'Make a Decision or Request Changes';

const handleDecision = (e) => {
onDecision(e.target.value);
};

const makeDecisionContent = (
<>
<Modal.Body>
Expand All @@ -40,7 +36,7 @@ export const DecisionModal: React.FunctionComponent<Props> = ({
value="REQUESTED_CHANGES"
variant="outline-secondary"
size="lg"
onClick={handleDecision}
onClick={() => onDecision('REQUESTED_CHANGES')}
>
<FontAwesomeIcon icon={faEnvelope} />
Request Changes
Expand All @@ -52,7 +48,7 @@ export const DecisionModal: React.FunctionComponent<Props> = ({
value="APPROVED"
variant="success"
size="lg"
onClick={handleDecision}
onClick={() => onDecision('APPROVED')}
>
<FontAwesomeIcon icon={faCheck} />
Approve
Expand All @@ -62,7 +58,7 @@ export const DecisionModal: React.FunctionComponent<Props> = ({
value="REJECTED"
variant="danger"
size="lg"
onClick={handleDecision}
onClick={() => onDecision('REJECTED')}
>
<FontAwesomeIcon icon={faTimes} />
Reject
Expand Down Expand Up @@ -93,7 +89,7 @@ export const DecisionModal: React.FunctionComponent<Props> = ({
)}
</Modal.Body>
<Modal.Footer>
<Button value="SUBMITTED" onClick={handleDecision}>
<Button value="SUBMITTED" onClick={() => onDecision('SUBMITTED')}>
Revert Decision
</Button>
</Modal.Footer>
Expand Down

0 comments on commit b366634

Please sign in to comment.