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

View File

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

View File

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