This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 5 files changed +61
-1
lines changed
routes/PositionDetails/components/CandidatesStatusFilter
5 files changed +61
-1
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Babge
3
+ *
4
+ * - type - see BABGE_TYPE values
5
+ *
6
+ */
7
+ import React from "react" ;
8
+ import PT from "prop-types" ;
9
+ import cn from "classnames" ;
10
+ import { BABGE_TYPE } from "constants" ;
11
+ import "./styles.module.scss" ;
12
+
13
+ const Babge = ( { children, type = BABGE_TYPE . PRIMARY } ) => {
14
+ return < span styleName = { cn ( "babge" , `type-${ type } ` ) } > { children } </ span > ;
15
+ } ;
16
+
17
+ Babge . propTypes = {
18
+ children : PT . node ,
19
+ type : PT . oneOf ( Object . values ( BABGE_TYPE ) ) ,
20
+ } ;
21
+
22
+ export default Babge ;
Original file line number Diff line number Diff line change
1
+ @import " styles/include" ;
2
+
3
+ .babge {
4
+ @include font-roboto ;
5
+ padding : 0 8px ;
6
+ line-height : 20px ;
7
+ border-radius : 5px ;
8
+ height : 20px ;
9
+ color : #FFFFFF ;
10
+ font-size : 12px ;
11
+ letter-spacing : 0.5px ;
12
+ text-align : left ;
13
+ }
14
+
15
+ .type-primary {
16
+ background-color : #0ab88a ;
17
+ }
18
+
19
+ .type-danger {
20
+ background-color : #ef476f ;
21
+ }
Original file line number Diff line number Diff line change @@ -73,6 +73,14 @@ export const BUTTON_TYPE = {
73
73
SEGMENT_SELECTED : "segment-selected" ,
74
74
} ;
75
75
76
+ /**
77
+ * Supported Babge Types
78
+ */
79
+ export const BABGE_TYPE = {
80
+ PRIMARY : "primary" ,
81
+ DANGER : "danger" ,
82
+ } ;
83
+
76
84
/**
77
85
* Type of rate
78
86
*/
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import PT from "prop-types";
6
6
import "./styles.module.scss" ;
7
7
import _ from "lodash" ;
8
8
import Button from "components/Button" ;
9
+ import Babge from "components/Babge" ;
9
10
import {
10
11
CANDIDATE_STATUS ,
11
12
CANDIDATE_STATUS_FILTERS ,
@@ -15,14 +16,17 @@ import {
15
16
const CandidatesStatusFilter = ( { currentStatus, onChange, candidates } ) => {
16
17
return (
17
18
< div styleName = "candidates-status-filter" >
18
- { CANDIDATE_STATUS_FILTERS . map ( ( status ) => (
19
+ { CANDIDATE_STATUS_FILTERS . map ( ( status , index ) => (
19
20
< Button
20
21
key = { status }
21
22
type = { currentStatus === status ? "segment-selected" : "segment" }
22
23
onClick = { ( ) => onChange ( status ) }
23
24
>
24
25
{ CANDIDATE_STATUS_TO_TEXT [ status ] } (
25
26
{ _ . filter ( candidates , { status } ) . length } )
27
+ { index === 0 && _ . filter ( candidates , { status } ) . length ? (
28
+ < Babge type = "danger" > Pending</ Babge >
29
+ ) : null }
26
30
</ Button >
27
31
) ) }
28
32
</ div >
Original file line number Diff line number Diff line change 8
8
> * :not (:last-child ) {
9
9
margin-right : 10px ;
10
10
}
11
+ button {
12
+ span {
13
+ margin-left : 5px ;
14
+ }
15
+ }
11
16
}
You can’t perform that action at this time.
0 commit comments