@@ -8,61 +8,60 @@ import Button from "components/Button";
8
8
import React from "react" ;
9
9
import cn from "classnames" ;
10
10
import PT from "prop-types" ;
11
+ import Spinner from "components/CenteredSpinner" ;
11
12
import ProgressBar from "../ProgressBar" ;
12
13
import "./styles.module.scss" ;
13
- import IconMultipleActionsCheck from "../../../../assets/images/icon-multiple-actions-check-2.svg" ;
14
- import IconListQuill from "../../../../assets/images/icon-list-quill.svg" ;
15
- import IconOfficeFileText from "../../../../assets/images/icon-office-file-text.svg" ;
16
-
17
14
function Progress ( {
18
15
extraStyleName,
19
16
isDisabled,
17
+ isSearching,
20
18
onClick,
21
19
buttonLabel,
22
20
stages,
23
21
percentage,
24
22
} ) {
25
-
26
- let backgroundIcon
27
- if ( extraStyleName === "input-skills" ) {
28
- backgroundIcon = < IconListQuill styleName = "transparent-icon" />
29
- } else if ( extraStyleName === "input-job-description" ) {
30
- backgroundIcon = < IconOfficeFileText styleName = "transparent-icon" />
31
- } else {
32
- backgroundIcon = < IconMultipleActionsCheck styleName = "transparent-icon" />
33
- }
34
-
35
23
return (
36
24
< div styleName = { cn ( "progress" , extraStyleName ) } >
37
25
< ProgressBar percentDone = { percentage } />
38
26
< ul styleName = "list" >
39
- { stages . map ( ( stage ) => (
27
+ { stages . map ( ( stage , idx ) => (
40
28
< li
41
29
styleName = { cn ( "list-item" , {
42
30
active : stage . isCurrent ,
43
31
done : stage . completed ,
44
32
} ) }
33
+ data-index = { idx + 1 }
45
34
>
46
35
{ stage . name }
47
36
</ li >
48
37
) ) }
49
38
</ ul >
50
39
< Button
40
+ styleName = { cn ( { searching : isSearching } ) }
51
41
size = "medium"
52
42
type = "secondary"
53
43
disabled = { isDisabled }
54
44
onClick = { onClick }
55
45
>
56
- { buttonLabel }
46
+ { isSearching ? (
47
+ < >
48
+ < div styleName = "spinner" >
49
+ < Spinner stype = "Oval" width = "16" height = "16" />
50
+ </ div >
51
+ Searching
52
+ </ >
53
+ ) : (
54
+ buttonLabel
55
+ ) }
57
56
</ Button >
58
- { backgroundIcon }
59
57
</ div >
60
58
) ;
61
59
}
62
60
63
61
Progress . propTypes = {
64
62
extraStyleName : PT . string ,
65
63
isDisabled : PT . bool ,
64
+ isSearching : PT . bool ,
66
65
onClick : PT . func ,
67
66
buttonLabel : PT . string ,
68
67
currentStageIdx : PT . number ,
0 commit comments