Fix wrong visibility icon (#2707)

fix-wrong-visibility-icon
This commit is contained in:
bosiraphael 2023-11-24 18:24:54 +01:00 committed by GitHub
parent 135733288d
commit e810ad7016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -224,6 +224,7 @@ export const BoardOptionsDropdownContent = ({
<ViewFieldsVisibilityDropdownSection
title="Visible"
fields={visibleBoardCardFields}
isVisible={true}
onVisibilityChange={handleFieldVisibilityChange}
isDraggable={true}
onDragEnd={handleReorderField}
@ -234,6 +235,7 @@ export const BoardOptionsDropdownContent = ({
<ViewFieldsVisibilityDropdownSection
title="Hidden"
fields={hiddenBoardCardFields}
isVisible={false}
onVisibilityChange={handleFieldVisibilityChange}
isDraggable={false}
/>

View File

@ -137,6 +137,7 @@ export const TableOptionsDropdownContent = ({
<ViewFieldsVisibilityDropdownSection
title="Visible"
fields={visibleTableColumns}
isVisible={true}
onVisibilityChange={handleColumnVisibilityChange}
isDraggable={true}
onDragEnd={handleReorderField}
@ -147,6 +148,7 @@ export const TableOptionsDropdownContent = ({
<ViewFieldsVisibilityDropdownSection
title="Hidden"
fields={hiddenTableColumns}
isVisible={false}
onVisibilityChange={handleColumnVisibilityChange}
isDraggable={false}
/>

View File

@ -27,6 +27,7 @@ type ViewFieldsVisibilityDropdownSectionProps = {
field: Omit<ColumnDefinition<FieldMetadata>, 'size' | 'position'>,
) => void;
title: string;
isVisible: boolean;
isDraggable: boolean;
onDragEnd?: OnDragEndResponder;
};
@ -35,6 +36,7 @@ export const ViewFieldsVisibilityDropdownSection = ({
fields,
onVisibilityChange,
title,
isVisible,
isDraggable,
onDragEnd,
}: ViewFieldsVisibilityDropdownSectionProps) => {
@ -71,7 +73,7 @@ export const ViewFieldsVisibilityDropdownSection = ({
if (!field.infoTooltipContent) {
return [
{
Icon: field.isVisible ? IconMinus : IconPlus,
Icon: isVisible ? IconMinus : IconPlus,
onClick: () => onVisibilityChange(field),
},
];