Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat : Introduced Delay Options for Tooltip #5766

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/twenty-ui/src/display/tooltip/AppTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export enum TooltipPosition {
Bottom = 'bottom',
}

export enum TooltipDelay{
noDelay = '0ms',
shortDelay = '300ms',
mediumDelay = '500ms'
}

const StyledAppTooltip = styled(Tooltip)`
backdrop-filter: ${({ theme }) => theme.blur.strong};
background-color: ${({ theme }) => RGBA(theme.color.gray80, 0.8)};
Expand Down Expand Up @@ -41,6 +47,7 @@ export type AppTooltipProps = {
noArrow?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the delay prop is optional and has a default value to avoid potential undefined errors.

isOpen?: boolean;
place?: PlacesType;
delay?:TooltipDelay;
positionStrategy?: PositionStrategy;
};

Expand All @@ -52,6 +59,7 @@ export const AppTooltip = ({
isOpen,
noArrow,
offset,
delay,
place,
positionStrategy,
children,
Expand All @@ -61,6 +69,7 @@ export const AppTooltip = ({
anchorSelect,
className,
content,
delay,
delayHide,
isOpen,
noArrow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ComponentDecorator,
} from '@ui/testing';

import { AppTooltip as Tooltip, TooltipPosition } from '../AppTooltip';
import { AppTooltip as Tooltip, TooltipPosition, TooltipDelay } from '../AppTooltip';

const meta: Meta<typeof Tooltip> = {
title: 'UI/Display/Tooltip',
Expand All @@ -19,6 +19,7 @@ type Story = StoryObj<typeof Tooltip>;
export const Default: Story = {
args: {
place: TooltipPosition.Bottom,
delay : TooltipDelay.mediumDelay,
content: 'Tooltip Test',
isOpen: true,
anchorSelect: '#hover-text',
Expand Down
Loading