Skip to content

Commit c7671f5

Browse files
committed
support custom labels to add
1 parent c84893a commit c7671f5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/Components/ProjectListApplyer.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const ProjectListApplyer = ({
3535
applyedLabels,
3636
applyingStatus,
3737
onApply,
38+
labelsToAdd,
3839
labelsToRemove,
3940
alert
4041
}) => (
@@ -61,7 +62,7 @@ const ProjectListApplyer = ({
6162
<LabelList
6263
header="Labels to Add:"
6364
className="labels-to-add"
64-
labels={LABELS_TO_ADD}
65+
labels={labelsToAdd}
6566
applyedLabels={applyedLabels}
6667
/>
6768
{labelsToRemove.length === 0 ? null :
@@ -76,6 +77,11 @@ const ProjectListApplyer = ({
7677
</div>
7778
);
7879

80+
const labelShape = PropTypes.shape({
81+
name: PropTypes.string.isRequired,
82+
color: PropTypes.string.isRequired,
83+
});
84+
7985
ProjectListApplyer.propTypes = {
8086
className: PropTypes.string,
8187

@@ -91,17 +97,16 @@ ProjectListApplyer.propTypes = {
9197
projects: PropTypes.arrayOf(projectShape).isRequired,
9298
selectedPreject: projectShape,
9399

94-
labelsToRemove: PropTypes.arrayOf(PropTypes.shape({
95-
name: PropTypes.string.isRequired,
96-
color: PropTypes.string.isRequired,
97-
})).isRequired,
100+
labelsToAdd: PropTypes.arrayOf(labelShape),
101+
labelsToRemove: PropTypes.arrayOf(labelShape).isRequired,
98102
}
99103

100104
ProjectListApplyer.defaultProps = {
101105
className: "",
102106
applying: false,
103107
applyedLabels: [],
104108
labelsToRemove: [],
109+
labelsToAdd: LABELS_TO_ADD,
105110
}
106111

107112
export default ProjectListApplyer

0 commit comments

Comments
 (0)