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

💄 style: Expose tooltip overlayStyle prop #162

Merged
merged 3 commits into from
Jun 9, 2024
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/ActionIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import React from 'react';
import { Loader2 } from 'lucide-react';
import { forwardRef, useMemo } from 'react';
import { Flexbox, type FlexboxProps } from 'react-layout-kit';
Expand Down Expand Up @@ -47,7 +48,7 @@ export interface ActionIconProps extends LucideIconProps, FlexboxProps {
* @description Set the loading status of ActionIcon
*/
loading?: boolean;

overlayStyle?: React.CSSProperties;
Copy link
Contributor

Choose a reason for hiding this comment

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

这个写法有问题的,不应该引入 React ,应该直接引入 CSSProperties

/**
* @description The position of the tooltip relative to the target
* @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
Expand Down Expand Up @@ -94,6 +95,7 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
onClick,
children,
loading,
overlayStyle,
tooltipDelay = 0.5,
fillOpacity,
fillRule,
Expand Down Expand Up @@ -145,7 +147,7 @@ const ActionIcon = forwardRef<HTMLDivElement, ActionIconProps>(
<Tooltip
arrow={arrow}
mouseEnterDelay={tooltipDelay}
overlayStyle={{ pointerEvents: 'none' }}
overlayStyle={{ pointerEvents: 'none', ...overlayStyle }}
placement={placement}
title={title}
>
Expand Down
Loading