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

Commit ad5dbd4

Browse files
authored
Merge pull request #91 from yoution/issue-80
fix: issue #80
2 parents 4e57c34 + acaed88 commit ad5dbd4

File tree

5 files changed

+61
-1
lines changed

5 files changed

+61
-1
lines changed

src/components/Babge/index.jsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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;
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
}

src/constants/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ export const BUTTON_TYPE = {
7373
SEGMENT_SELECTED: "segment-selected",
7474
};
7575

76+
/**
77+
* Supported Babge Types
78+
*/
79+
export const BABGE_TYPE = {
80+
PRIMARY: "primary",
81+
DANGER: "danger",
82+
};
83+
7684
/**
7785
* Type of rate
7886
*/

src/routes/PositionDetails/components/CandidatesStatusFilter/index.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import PT from "prop-types";
66
import "./styles.module.scss";
77
import _ from "lodash";
88
import Button from "components/Button";
9+
import Babge from "components/Babge";
910
import {
1011
CANDIDATE_STATUS,
1112
CANDIDATE_STATUS_FILTERS,
@@ -15,14 +16,17 @@ import {
1516
const CandidatesStatusFilter = ({ currentStatus, onChange, candidates }) => {
1617
return (
1718
<div styleName="candidates-status-filter">
18-
{CANDIDATE_STATUS_FILTERS.map((status) => (
19+
{CANDIDATE_STATUS_FILTERS.map((status, index) => (
1920
<Button
2021
key={status}
2122
type={currentStatus === status ? "segment-selected" : "segment"}
2223
onClick={() => onChange(status)}
2324
>
2425
{CANDIDATE_STATUS_TO_TEXT[status]} (
2526
{_.filter(candidates, { status }).length})
27+
{index === 0 && _.filter(candidates, { status }).length ? (
28+
<Babge type="danger">Pending</Babge>
29+
) : null}
2630
</Button>
2731
))}
2832
</div>

src/routes/PositionDetails/components/CandidatesStatusFilter/styles.module.scss

+5
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@
88
> *:not(:last-child) {
99
margin-right: 10px;
1010
}
11+
button {
12+
span {
13+
margin-left: 5px;
14+
}
15+
}
1116
}

0 commit comments

Comments
 (0)