Removed drag grip and accent is now tertiary in hidden fields (#6650)

Closes #6115

This change successfully addresses the issue as described. However, it
also causes the primary non-draggable field, `Name`, to render without a
draggable handle and with a secondary accent. Is this an acceptable
outcome?



https://github.com/user-attachments/assets/4bc15e00-6c73-41d4-8342-4e36487d0981

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
nitin
2024-08-28 20:57:14 +05:30
committed by GitHub
parent 747a1549e9
commit 0531eb5015
5 changed files with 43 additions and 30 deletions

View File

@ -1,10 +1,10 @@
import { useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import {
DropResult,
OnDragEndResponder,
ResponderProvided,
} from '@hello-pangea/dnd';
import { useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import {
AppTooltip,
IconEye,
@ -33,6 +33,7 @@ type ViewFieldsVisibilityDropdownSectionProps = {
) => void;
title: string;
showSubheader: boolean;
showDragGrip: boolean;
};
export const ViewFieldsVisibilityDropdownSection = ({
@ -42,6 +43,7 @@ export const ViewFieldsVisibilityDropdownSection = ({
onVisibilityChange,
title,
showSubheader = true,
showDragGrip,
}: ViewFieldsVisibilityDropdownSectionProps) => {
const handleOnDrag = (result: DropResult, provided: ResponderProvided) => {
onDragEnd?.(result, provided);
@ -107,9 +109,8 @@ export const ViewFieldsVisibilityDropdownSection = ({
isTooltipOpen={openToolTipIndex === fieldIndex}
text={field.label}
className={`${title}-fixed-item-tooltip-anchor-${fieldIndex}`}
accent={'placeholder'}
isHoverDisabled={field.isVisible}
showGrip
accent={showDragGrip ? 'placeholder' : 'default'}
showGrip={showDragGrip}
isDragDisabled
/>
))}