5
5
* about costs and number of matching candidates.
6
6
*/
7
7
import React , { useState , useEffect } from "react" ;
8
+ import PT from "prop-types" ;
8
9
import cn from "classnames" ;
10
+ import _ from "lodash" ;
11
+ import {
12
+ formatMoney ,
13
+ } from "utils/format" ;
9
14
import { getAuthUserProfile } from "@topcoder/micro-frontends-navbar-app" ;
15
+ import config from '../../../../../config' ;
10
16
import "./styles.module.scss" ;
11
17
import IconEarthCheck from "../../../../assets/images/icon-earth-check.svg" ;
12
18
import IconMultipleUsers from "../../../../assets/images/icon-multiple-users.svg" ;
@@ -16,9 +22,15 @@ import Curve from "../../../../assets/images/curve.svg";
16
22
import CircularProgressBar from "../CircularProgressBar" ;
17
23
import Button from "components/Button" ;
18
24
19
- function ResultCard ( ) {
25
+ function ResultCard ( {
26
+ numberOfMembersAvailable,
27
+ numberOfMembers,
28
+ timeToCandidate,
29
+ timeToInterview,
30
+ isExternalMember,
31
+ rates
32
+ } ) {
20
33
const [ userHandle , setUserHandle ] = useState ( "handle" ) ;
21
- const [ showSpecialRates , setShowSpecialRates ] = useState ( false ) ;
22
34
const [ showRates , setShowRates ] = useState ( false ) ;
23
35
24
36
useEffect ( ( ) => {
@@ -29,16 +41,11 @@ function ResultCard() {
29
41
30
42
return (
31
43
< div styleName = "result-card" >
32
- < div
33
- role = "button"
34
- tabIndex = "0"
35
- onClick = { ( ) => setShowSpecialRates ( ! showSpecialRates ) }
36
- styleName = { cn ( "heading" , { [ "non-clickable" ] : ! showRates } ) }
37
- >
44
+ < div styleName = "heading" >
38
45
< IconEarthCheck />
39
46
< h3 > We have matching profiles</ h3 >
40
47
< p >
41
- We have qualified candidates who match 80 % or more of your job
48
+ We have qualified candidates who match { config . MATCHING_RATE } % or more of your job
42
49
requirements.
43
50
</ p >
44
51
< Curve styleName = "curve" />
@@ -60,7 +67,7 @@ function ResultCard() {
60
67
Rate Details
61
68
</ Button >
62
69
</ div >
63
- { showRates && showSpecialRates && (
70
+ { showRates && ! isExternalMember && (
64
71
< div styleName = "xeno-rates" >
65
72
< p styleName = "greeting-txt" >
66
73
Hi { userHandle } , we have special rates for you as a Xeno User!
@@ -72,23 +79,23 @@ function ResultCard() {
72
79
< p > (40h / week)</ p >
73
80
</ div >
74
81
< div styleName = "senior" >
75
- < h4 > Senior Member </ h4 >
82
+ < h4 > Global Rate </ h4 >
76
83
< div styleName = "cost" >
77
- < h4 > $2,000 </ h4 >
84
+ < h4 > { formatMoney ( rates [ 0 ] . global ) } </ h4 >
78
85
< p > /Week</ p >
79
86
</ div >
80
87
</ div >
81
88
< div styleName = "standard" >
82
- < h4 > Standard Member </ h4 >
89
+ < h4 > In-Conutry Rate </ h4 >
83
90
< div styleName = "cost" >
84
- < h4 > $1,500 </ h4 >
91
+ < h4 > { formatMoney ( rates [ 0 ] . inCountry ) } </ h4 >
85
92
< p > /Week</ p >
86
93
</ div >
87
94
</ div >
88
95
< div styleName = "junior" >
89
- < h4 > Junior Member </ h4 >
96
+ < h4 > Offshore Rate </ h4 >
90
97
< div styleName = "cost" >
91
- < h4 > $1,000 </ h4 >
98
+ < h4 > { formatMoney ( rates [ 0 ] . offShore ) } </ h4 >
92
99
< p > /Week</ p >
93
100
</ div >
94
101
</ div >
@@ -99,23 +106,23 @@ function ResultCard() {
99
106
< p > (30h / week)</ p >
100
107
</ div >
101
108
< div styleName = "senior" >
102
- < h4 > Senior Member </ h4 >
109
+ < h4 > Global Rate </ h4 >
103
110
< div styleName = "cost" >
104
- < h4 > $1,800 </ h4 >
111
+ < h4 > { formatMoney ( rates [ 0 ] . rate30Global ) } </ h4 >
105
112
< p > /Week</ p >
106
113
</ div >
107
114
</ div >
108
115
< div styleName = "standard" >
109
- < h4 > Standard Member </ h4 >
116
+ < h4 > In-Conutry Rate </ h4 >
110
117
< div styleName = "cost" >
111
- < h4 > $1,300 </ h4 >
118
+ < h4 > { formatMoney ( rates [ 0 ] . rate30InCountry ) } </ h4 >
112
119
< p > /Week</ p >
113
120
</ div >
114
121
</ div >
115
122
< div styleName = "junior" >
116
- < h4 > Junior Member </ h4 >
123
+ < h4 > Offshore Rate </ h4 >
117
124
< div styleName = "cost" >
118
- < h4 > $800 </ h4 >
125
+ < h4 > { formatMoney ( rates [ 0 ] . rate30OffShore ) } </ h4 >
119
126
< p > /Week</ p >
120
127
</ div >
121
128
</ div >
@@ -126,31 +133,31 @@ function ResultCard() {
126
133
< p > (20h / week)</ p >
127
134
</ div >
128
135
< div styleName = "senior" >
129
- < h4 > Senior Member </ h4 >
136
+ < h4 > Global Rate </ h4 >
130
137
< div styleName = "cost" >
131
- < h4 > $1,600 </ h4 >
138
+ < h4 > { formatMoney ( rates [ 0 ] . rate20Global ) } </ h4 >
132
139
< p > /Week</ p >
133
140
</ div >
134
141
</ div >
135
142
< div styleName = "standard" >
136
- < h4 > Standard Member </ h4 >
143
+ < h4 > In-Conutry Rate </ h4 >
137
144
< div styleName = "cost" >
138
- < h4 > $1,100 </ h4 >
145
+ < h4 > { formatMoney ( rates [ 0 ] . rate20InCountry ) } </ h4 >
139
146
< p > /Week</ p >
140
147
</ div >
141
148
</ div >
142
149
< div styleName = "junior" >
143
- < h4 > Junior Member </ h4 >
150
+ < h4 > Offshore Rate </ h4 >
144
151
< div styleName = "cost" >
145
- < h4 > $600 </ h4 >
152
+ < h4 > { formatMoney ( rates [ 0 ] . rate20OffShore ) } </ h4 >
146
153
< p > /Week</ p >
147
154
</ div >
148
155
</ div >
149
156
</ div >
150
157
</ div >
151
158
</ div >
152
159
) }
153
- { showRates && ! showSpecialRates && (
160
+ { showRates && isExternalMember && (
154
161
< div styleName = "rate-content" >
155
162
< div styleName = "rate-left-side" >
156
163
< div styleName = "cost-info" >
@@ -159,7 +166,7 @@ function ResultCard() {
159
166
< p > (40h / week)</ p >
160
167
</ div >
161
168
< div styleName = "weekly-rate" >
162
- < h5 > $1,800 </ h5 >
169
+ < h5 > { formatMoney ( rates [ 0 ] . global ) } </ h5 >
163
170
< p > /Week</ p >
164
171
</ div >
165
172
</ div >
@@ -169,7 +176,7 @@ function ResultCard() {
169
176
< p > (30h / week)</ p >
170
177
</ div >
171
178
< div styleName = "weekly-rate" >
172
- < h5 > $1,250 </ h5 >
179
+ < h5 > { formatMoney ( rates [ 0 ] . inCountry ) } </ h5 >
173
180
< p > /Week</ p >
174
181
</ div >
175
182
</ div >
@@ -179,7 +186,7 @@ function ResultCard() {
179
186
< p > (20h / week)</ p >
180
187
</ div >
181
188
< div styleName = "weekly-rate" >
182
- < h5 > $800 </ h5 >
189
+ < h5 > { formatMoney ( rates [ 0 ] . offShore ) } </ h5 >
183
190
< p > /Week</ p >
184
191
</ div >
185
192
</ div >
@@ -190,14 +197,14 @@ function ResultCard() {
190
197
< IconMultipleActionsCheck />
191
198
< div >
192
199
< p > Qualified candidates within</ p >
193
- < h6 > 24h </ h6 >
200
+ < h6 > { timeToCandidate } h </ h6 >
194
201
</ div >
195
202
</ div >
196
203
< div styleName = "timeline-info" >
197
204
< IconTeamMeetingChat />
198
205
< div >
199
206
< p > Interviews can start within</ p >
200
- < h6 > 48h </ h6 >
207
+ < h6 > { timeToInterview } h </ h6 >
201
208
</ div >
202
209
</ div >
203
210
</ div >
@@ -209,11 +216,11 @@ function ResultCard() {
209
216
< div >
210
217
< CircularProgressBar
211
218
size = "160"
212
- progress = "80"
219
+ progress = { config . MATCHING_RATE }
213
220
strokeWidth = "6"
214
221
children = {
215
222
< div styleName = "progressbar-child" >
216
- < h4 > 80 %</ h4 >
223
+ < h4 > { config . MATCHING_RATE } %</ h4 >
217
224
< p > Matching rate</ p >
218
225
</ div >
219
226
}
@@ -222,7 +229,7 @@ function ResultCard() {
222
229
< div styleName = "vertical-line" />
223
230
< div >
224
231
< IconMultipleUsers styleName = "users" />
225
- < h4 > 300 +</ h4 >
232
+ < h4 > { numberOfMembersAvailable } +</ h4 >
226
233
< p > Members matched</ p >
227
234
</ div >
228
235
</ div >
@@ -246,4 +253,12 @@ function ResultCard() {
246
253
) ;
247
254
}
248
255
256
+ ResultCard . propTypes = {
257
+ numberOfMembersAvailable :PT . number ,
258
+ numberOfMembers : PT . string ,
259
+ timeToCandidate : PT . number ,
260
+ timeToInterview : PT . number ,
261
+ isExternalMember : PT . bool ,
262
+ rates : PT . array ,
263
+ } ;
249
264
export default ResultCard ;
0 commit comments