Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 9907a4f

Browse files
committed
fix: show "Interested" tab if nobody to review
ref issue #80
1 parent 27a6277 commit 9907a4f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/routes/PositionDetails/index.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Page for the list of candidates for position.
55
*/
6-
import React, { useCallback, useState } from "react";
6+
import React, { useCallback, useEffect, useState } from "react";
77
import PT from "prop-types";
88
import Page from "components/Page";
99
import LoadingIndicator from "components/LoadingIndicator";
@@ -16,7 +16,8 @@ import { useTeamPositionsState } from "./hooks/useTeamPositionsState";
1616
import "./styles.module.scss";
1717

1818
const PositionDetails = ({ teamId, positionId }) => {
19-
const [candidateStatus, setCandidateStatus] = useState(CANDIDATE_STATUS.OPEN);
19+
// be dafault show "Interested" tab
20+
const [candidateStatus, setCandidateStatus] = useState(CANDIDATE_STATUS.SHORTLIST);
2021
const {
2122
state: { position, error },
2223
updateCandidate,
@@ -29,6 +30,13 @@ const PositionDetails = ({ teamId, positionId }) => {
2930
[setCandidateStatus]
3031
);
3132

33+
// if there are some candidates to review, then show "To Review" tab by default
34+
useEffect(() => {
35+
if (position && _.filter(position.candidates, { status: CANDIDATE_STATUS.OPEN }).length > 0) {
36+
setCandidateStatus(CANDIDATE_STATUS.OPEN)
37+
}
38+
}, [position])
39+
3240
return (
3341
<Page title="Job Details">
3442
{!position ? (

0 commit comments

Comments
 (0)