Skip to content

Commit

Permalink
feat: add bgColor prop to custom tooltip
Browse files Browse the repository at this point in the history
Signed-off-by: Rudraksh Tyagi
<[email protected]>
  • Loading branch information
dragon-slayer875 committed May 20, 2024
1 parent 4fad0b5 commit fc17ee2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom/CustomTooltip/customTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type CustomTooltipProps = {
fontSize?: string;
fontWeight?: number;
variant?: 'standard' | 'small';
bgColor?: string;
} & Omit<TooltipProps, 'title' | 'onClick'>;

function CustomTooltip({
Expand All @@ -20,14 +21,15 @@ function CustomTooltip({
fontSize,
fontWeight = 400,
variant = 'small',
bgColor = CHARCOAL,
...props
}: CustomTooltipProps): JSX.Element {
return (
<Tooltip
componentsProps={{
tooltip: {
sx: {
background: CHARCOAL,
background: bgColor,
color: WHITE,
fontSize: fontSize || (variant === 'standard' ? '1rem' : '0.75rem'),
fontWeight: { fontWeight },
Expand Down

0 comments on commit fc17ee2

Please sign in to comment.