forked from github/plane
fix: default label color (#295)
* fix: colors of old labels can now be changed * fix: black color for labels with no color
This commit is contained in:
parent
7c1f357bed
commit
45319d81db
@ -102,7 +102,8 @@ export const IssueLabelSelect: React.FC<Props> = ({ setIsOpen, value, onChange,
|
|||||||
<span
|
<span
|
||||||
className="h-1.5 w-1.5 flex-shrink-0 rounded-full"
|
className="h-1.5 w-1.5 flex-shrink-0 rounded-full"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: label?.color ?? "green",
|
backgroundColor:
|
||||||
|
label.color && label.color !== "" ? label.color : "#000",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{label.name}
|
{label.name}
|
||||||
@ -128,7 +129,7 @@ export const IssueLabelSelect: React.FC<Props> = ({ setIsOpen, value, onChange,
|
|||||||
<span
|
<span
|
||||||
className="h-2 w-2 flex-shrink-0 rounded-full"
|
className="h-2 w-2 flex-shrink-0 rounded-full"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: child?.color ?? "green",
|
backgroundColor: child?.color ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{child.name}
|
{child.name}
|
||||||
|
@ -324,7 +324,7 @@ export const IssueDetailsSidebar: React.FC<Props> = ({
|
|||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className="h-2 w-2 flex-shrink-0 rounded-full"
|
className="h-2 w-2 flex-shrink-0 rounded-full"
|
||||||
style={{ backgroundColor: label?.color ?? "green" }}
|
style={{ backgroundColor: label?.color ?? "black" }}
|
||||||
/>
|
/>
|
||||||
{label.name}
|
{label.name}
|
||||||
<XMarkIcon className="h-2 w-2 group-hover:text-red-500" />
|
<XMarkIcon className="h-2 w-2 group-hover:text-red-500" />
|
||||||
@ -386,7 +386,10 @@ export const IssueDetailsSidebar: React.FC<Props> = ({
|
|||||||
<span
|
<span
|
||||||
className="h-2 w-2 flex-shrink-0 rounded-full"
|
className="h-2 w-2 flex-shrink-0 rounded-full"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: label?.color ?? "green",
|
backgroundColor:
|
||||||
|
label.color && label.color !== ""
|
||||||
|
? label.color
|
||||||
|
: "#000",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{label.name}
|
{label.name}
|
||||||
@ -413,7 +416,7 @@ export const IssueDetailsSidebar: React.FC<Props> = ({
|
|||||||
<span
|
<span
|
||||||
className="h-2 w-2 flex-shrink-0 rounded-full"
|
className="h-2 w-2 flex-shrink-0 rounded-full"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: child?.color ?? "green",
|
backgroundColor: child?.color ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{child.name}
|
{child.name}
|
||||||
@ -472,7 +475,7 @@ export const IssueDetailsSidebar: React.FC<Props> = ({
|
|||||||
<span
|
<span
|
||||||
className="h-5 w-5 rounded"
|
className="h-5 w-5 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -118,7 +118,7 @@ export const CreateLabelModal: React.FC<Props> = ({ isOpen, projectId, handleClo
|
|||||||
<span
|
<span
|
||||||
className="ml-2 h-4 w-4 rounded"
|
className="ml-2 h-4 w-4 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -100,7 +100,10 @@ export const CreateUpdateLabelInline: React.FC<Props> = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!labelToUpdate) return;
|
if (!labelToUpdate) return;
|
||||||
|
|
||||||
setValue("color", labelToUpdate.color);
|
setValue(
|
||||||
|
"color",
|
||||||
|
labelToUpdate.color && labelToUpdate.color !== "" ? labelToUpdate.color : "#000"
|
||||||
|
);
|
||||||
setValue("name", labelToUpdate.name);
|
setValue("name", labelToUpdate.name);
|
||||||
}, [labelToUpdate, setValue]);
|
}, [labelToUpdate, setValue]);
|
||||||
|
|
||||||
@ -123,7 +126,7 @@ export const CreateUpdateLabelInline: React.FC<Props> = ({
|
|||||||
<span
|
<span
|
||||||
className="h-4 w-4 rounded"
|
className="h-4 w-4 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "#000",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -24,7 +24,7 @@ export const SingleLabel: React.FC<Props> = ({
|
|||||||
<span
|
<span
|
||||||
className="h-3 w-3 flex-shrink-0 rounded-full"
|
className="h-3 w-3 flex-shrink-0 rounded-full"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: label.color,
|
backgroundColor: label.color && label.color !== "" ? label.color : "#000",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<h6 className="text-sm">{label.name}</h6>
|
<h6 className="text-sm">{label.name}</h6>
|
||||||
|
@ -72,7 +72,7 @@ const SingleLabel: React.FC<Props> = ({ label, issueLabels, editLabel, handleLab
|
|||||||
<span
|
<span
|
||||||
className="h-4 w-4 rounded"
|
className="h-4 w-4 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -158,7 +158,7 @@ export const CreateStateModal: React.FC<Props> = ({ isOpen, projectId, handleClo
|
|||||||
<span
|
<span
|
||||||
className="ml-2 h-4 w-4 rounded"
|
className="ml-2 h-4 w-4 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -141,7 +141,7 @@ export const CreateUpdateStateInline: React.FC<Props> = ({ data, onClose, select
|
|||||||
<span
|
<span
|
||||||
className="h-4 w-4 rounded"
|
className="h-4 w-4 rounded"
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: watch("color") ?? "green",
|
backgroundColor: watch("color") ?? "black",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user