From 45319d81db4ecb6602f11078d905d5f11c61d054 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 17 Feb 2023 17:06:30 +0530 Subject: [PATCH] fix: default label color (#295) * fix: colors of old labels can now be changed * fix: black color for labels with no color --- apps/app/components/issues/select/label.tsx | 5 +++-- apps/app/components/issues/sidebar.tsx | 11 +++++++---- apps/app/components/labels/create-label-modal.tsx | 2 +- .../components/labels/create-update-label-inline.tsx | 7 +++++-- apps/app/components/labels/single-label.tsx | 2 +- apps/app/components/project/settings/single-label.tsx | 2 +- apps/app/components/states/create-state-modal.tsx | 2 +- .../components/states/create-update-state-inline.tsx | 2 +- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/apps/app/components/issues/select/label.tsx b/apps/app/components/issues/select/label.tsx index f0a1d2d64..2b810b30a 100644 --- a/apps/app/components/issues/select/label.tsx +++ b/apps/app/components/issues/select/label.tsx @@ -102,7 +102,8 @@ export const IssueLabelSelect: React.FC = ({ setIsOpen, value, onChange, {label.name} @@ -128,7 +129,7 @@ export const IssueLabelSelect: React.FC = ({ setIsOpen, value, onChange, {child.name} diff --git a/apps/app/components/issues/sidebar.tsx b/apps/app/components/issues/sidebar.tsx index 3ab331244..22c98ebc6 100644 --- a/apps/app/components/issues/sidebar.tsx +++ b/apps/app/components/issues/sidebar.tsx @@ -324,7 +324,7 @@ export const IssueDetailsSidebar: React.FC = ({ > {label.name} @@ -386,7 +386,10 @@ export const IssueDetailsSidebar: React.FC = ({ {label.name} @@ -413,7 +416,7 @@ export const IssueDetailsSidebar: React.FC = ({ {child.name} @@ -472,7 +475,7 @@ export const IssueDetailsSidebar: React.FC = ({ )} diff --git a/apps/app/components/labels/create-label-modal.tsx b/apps/app/components/labels/create-label-modal.tsx index 89c286012..58967d6d4 100644 --- a/apps/app/components/labels/create-label-modal.tsx +++ b/apps/app/components/labels/create-label-modal.tsx @@ -118,7 +118,7 @@ export const CreateLabelModal: React.FC = ({ isOpen, projectId, handleClo )} diff --git a/apps/app/components/labels/create-update-label-inline.tsx b/apps/app/components/labels/create-update-label-inline.tsx index 3b7fe614c..6c61d6d5a 100644 --- a/apps/app/components/labels/create-update-label-inline.tsx +++ b/apps/app/components/labels/create-update-label-inline.tsx @@ -100,7 +100,10 @@ export const CreateUpdateLabelInline: React.FC = ({ useEffect(() => { if (!labelToUpdate) return; - setValue("color", labelToUpdate.color); + setValue( + "color", + labelToUpdate.color && labelToUpdate.color !== "" ? labelToUpdate.color : "#000" + ); setValue("name", labelToUpdate.name); }, [labelToUpdate, setValue]); @@ -123,7 +126,7 @@ export const CreateUpdateLabelInline: React.FC = ({ )} diff --git a/apps/app/components/labels/single-label.tsx b/apps/app/components/labels/single-label.tsx index 927a30d5a..9c311518e 100644 --- a/apps/app/components/labels/single-label.tsx +++ b/apps/app/components/labels/single-label.tsx @@ -24,7 +24,7 @@ export const SingleLabel: React.FC = ({
{label.name}
diff --git a/apps/app/components/project/settings/single-label.tsx b/apps/app/components/project/settings/single-label.tsx index c58fb608f..24f5e6af4 100644 --- a/apps/app/components/project/settings/single-label.tsx +++ b/apps/app/components/project/settings/single-label.tsx @@ -72,7 +72,7 @@ const SingleLabel: React.FC = ({ label, issueLabels, editLabel, handleLab )} diff --git a/apps/app/components/states/create-state-modal.tsx b/apps/app/components/states/create-state-modal.tsx index 5986b4e53..c3bdd5526 100644 --- a/apps/app/components/states/create-state-modal.tsx +++ b/apps/app/components/states/create-state-modal.tsx @@ -158,7 +158,7 @@ export const CreateStateModal: React.FC = ({ isOpen, projectId, handleClo )} diff --git a/apps/app/components/states/create-update-state-inline.tsx b/apps/app/components/states/create-update-state-inline.tsx index 7d67f8fcd..76082f16c 100644 --- a/apps/app/components/states/create-update-state-inline.tsx +++ b/apps/app/components/states/create-update-state-inline.tsx @@ -141,7 +141,7 @@ export const CreateUpdateStateInline: React.FC = ({ data, onClose, select )}