chore(trading): remove underlines on tooltips (#4884)
This commit is contained in:
parent
bb402c02f6
commit
d78de10855
@ -53,7 +53,7 @@ export const HeaderStat = ({
|
||||
<div data-testid="item-header" id={id}>
|
||||
{heading}
|
||||
</div>
|
||||
<Tooltip description={description}>
|
||||
<Tooltip description={description} underline>
|
||||
<div
|
||||
data-testid="item-value"
|
||||
aria-labelledby={id}
|
||||
|
@ -290,7 +290,6 @@ export const DealTicketMarginDetails = ({
|
||||
assetDecimals
|
||||
) ?? '-'
|
||||
}
|
||||
noUnderline
|
||||
>
|
||||
<div className="font-mono text-right">
|
||||
{formatValue(
|
||||
|
@ -47,7 +47,7 @@ export const KeyValue = ({
|
||||
<Tooltip description={labelDescription}>
|
||||
<div className="text-muted">{label}</div>
|
||||
</Tooltip>
|
||||
<Tooltip description={`${value ?? '-'} ${symbol || ''}`} noUnderline>
|
||||
<Tooltip description={`${value ?? '-'} ${symbol || ''}`}>
|
||||
{valueElement}
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
@ -19,14 +19,14 @@ export interface TooltipProps {
|
||||
align?: 'start' | 'center' | 'end';
|
||||
side?: 'top' | 'right' | 'bottom' | 'left';
|
||||
sideOffset?: number;
|
||||
noUnderline?: boolean;
|
||||
underline?: boolean;
|
||||
}
|
||||
|
||||
export const TOOLTIP_TRIGGER_CLASS_NAME = (noUnderline?: boolean) =>
|
||||
classNames(
|
||||
{ 'underline underline-offset-2': !noUnderline },
|
||||
'decoration-neutral-400 dark:decoration-neutral-400 decoration-dashed'
|
||||
);
|
||||
export const TOOLTIP_TRIGGER_CLASS_NAME = (underline?: boolean) =>
|
||||
classNames({
|
||||
'underline underline-offset-2 decoration-neutral-400 dark:decoration-neutral-400 decoration-dashed':
|
||||
underline,
|
||||
});
|
||||
|
||||
// Conditionally rendered tooltip if description content is provided.
|
||||
export const Tooltip = ({
|
||||
@ -36,12 +36,12 @@ export const Tooltip = ({
|
||||
sideOffset,
|
||||
align = 'start',
|
||||
side = 'bottom',
|
||||
noUnderline,
|
||||
underline,
|
||||
}: TooltipProps) =>
|
||||
description ? (
|
||||
<Provider delayDuration={200} skipDelayDuration={100}>
|
||||
<Root open={open}>
|
||||
<Trigger asChild className={TOOLTIP_TRIGGER_CLASS_NAME(noUnderline)}>
|
||||
<Trigger asChild className={TOOLTIP_TRIGGER_CLASS_NAME(underline)}>
|
||||
{children}
|
||||
</Trigger>
|
||||
{description && (
|
||||
|
Loading…
Reference in New Issue
Block a user