This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 5 files changed +23
-26
lines changed
MyTeamsDetails/components
components/PositionCandidates
5 files changed +23
-26
lines changed Original file line number Diff line number Diff line change @@ -9,24 +9,27 @@ import PT from "prop-types";
9
9
import "./styles.module.scss" ;
10
10
import { formatFullName } from "utils/format" ;
11
11
import { TOPCODER_COMMUNITY_WEBSITE_URL } from "../../../config" ;
12
+ import { Link } from "@reach/router" ;
12
13
13
- const User = ( { user, hideFullName = false } ) => {
14
- {
15
- console . log ( user ) ;
16
- }
14
+ const User = ( { user, hideFullName = false , handleLinkTo } ) => {
17
15
return (
18
16
< div styleName = "user" >
19
17
< Avatar { ...user } />
20
18
< div styleName = "user-details" >
21
- < a
22
- href = {
23
- user . teamId
24
- ? `/taas/myteams/${ user . teamId } /rb/${ user . id } `
25
- : `${ TOPCODER_COMMUNITY_WEBSITE_URL } /members/${ user . handle } `
26
- }
27
- >
28
- < strong > { user . handle } </ strong >
29
- </ a >
19
+ { /* if "handleLinkTo" is provided, use it as internal link, otherwise as external profile link */ }
20
+ { handleLinkTo ? (
21
+ < Link to = { handleLinkTo } >
22
+ < strong > { user . handle } </ strong >
23
+ </ Link >
24
+ ) : (
25
+ < a
26
+ href = { `${ TOPCODER_COMMUNITY_WEBSITE_URL } /members/${ user . handle } ` }
27
+ target = "_blank"
28
+ >
29
+ < strong > { user . handle } </ strong >
30
+ </ a >
31
+ ) }
32
+
30
33
{ ! hideFullName && (
31
34
< div > { formatFullName ( user . firstName , user . lastName ) } </ div >
32
35
) }
@@ -43,6 +46,7 @@ User.propTypes = {
43
46
handle : PT . string ,
44
47
} ) ,
45
48
hideFullName : PT . bool ,
49
+ handleLinkTo : PT . string ,
46
50
} ;
47
51
48
52
export default User ;
Original file line number Diff line number Diff line change @@ -115,8 +115,8 @@ const TeamMembers = ({ team }) => {
115
115
user = { {
116
116
...member ,
117
117
photoUrl : member . photo_url ,
118
- teamId : team . id ,
119
118
} }
119
+ handleLinkTo = { `/taas/myteams/${ team . id } /rb/${ member . id } ` }
120
120
/>
121
121
</ div >
122
122
< div styleName = "table-group-first-inner" >
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import Button from "components/Button";
11
11
import { POSITION_STATUS , POSITION_STATUS_TO_TEXT , RATE_TYPE } from "constants" ;
12
12
import "./styles.module.scss" ;
13
13
import { formatDateRange } from "utils/format" ;
14
+ import { Link } from "@reach/router" ;
14
15
15
16
const TeamPositions = ( { teamId, positions } ) => {
16
17
return (
@@ -33,12 +34,12 @@ const TeamPositions = ({ teamId, positions }) => {
33
34
< div styleName = "table-row" key = { index } >
34
35
< div styleName = "table-group-first" >
35
36
< div styleName = "table-cell cell-skills" >
36
- < a
37
+ < Link
37
38
styleName = "job-title"
38
- href = { `/taas/myteams/${ teamId } /positions/${ position . id } ` }
39
+ to = { `/taas/myteams/${ teamId } /positions/${ position . id } ` }
39
40
>
40
41
< strong > { position . title } </ strong >
41
- </ a >
42
+ </ Link >
42
43
< SkillsList skills = { position . skills } limit = { 5 } />
43
44
</ div >
44
45
< div styleName = "table-group-first-inner" >
Original file line number Diff line number Diff line change @@ -55,12 +55,7 @@ const populateSkillsMatched = (position, candidate) => ({
55
55
skillsMatched : _ . intersectionBy ( position . skills , candidate . skills , "id" ) ,
56
56
} ) ;
57
57
58
- const PositionCandidates = ( {
59
- position,
60
- candidateStatus,
61
- updateCandidate,
62
- teamId,
63
- } ) => {
58
+ const PositionCandidates = ( { position, candidateStatus, updateCandidate } ) => {
64
59
const { candidates } = position ;
65
60
const [ sortBy , setSortBy ] = useState ( CANDIDATES_SORT_BY . SKILL_MATCHED ) ;
66
61
const filteredCandidates = useMemo (
@@ -170,7 +165,6 @@ const PositionCandidates = ({
170
165
user = { {
171
166
...candidate ,
172
167
photoUrl : candidate . photo_url ,
173
- teamId : teamId ,
174
168
} }
175
169
hideFullName
176
170
/>
@@ -247,7 +241,6 @@ const PositionCandidates = ({
247
241
PositionCandidates . propType = {
248
242
position : PT . object ,
249
243
candidateStatus : PT . oneOf ( Object . values ( CANDIDATE_STATUS ) ) ,
250
- teamId : PT . string . isRequired ,
251
244
} ;
252
245
253
246
export default PositionCandidates ;
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ const PositionDetails = ({ teamId, positionId }) => {
50
50
position = { position }
51
51
candidateStatus = { candidateStatus }
52
52
updateCandidate = { updateCandidate }
53
- teamId = { teamId }
54
53
/>
55
54
</ >
56
55
) }
You can’t perform that action at this time.
0 commit comments