generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: captain-Akshay <[email protected]>
- Loading branch information
1 parent
d722b7f
commit d936a71
Showing
3 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
import { type TooltipProps } from '@mui/material'; | ||
import { Tooltip, type TooltipProps } from '@mui/material'; | ||
import React from 'react'; | ||
import { Tooltip } from '../../base/Tooltip'; | ||
import { CHARCOAL, WHITE } from '../../theme'; | ||
|
||
type CustomTooltipProps = { | ||
title: string; | ||
title: string | React.ReactNode; | ||
onClick?: (event: React.MouseEvent<HTMLElement>) => void; | ||
children: React.ReactNode; | ||
} & Omit<TooltipProps, 'title' | 'onClick'>; | ||
|
||
function StyledTooltip({ | ||
function CustomTooltip({ | ||
title, | ||
onClick, | ||
placement, | ||
children, | ||
...props | ||
}: CustomTooltipProps): JSX.Element { | ||
return ( | ||
<Tooltip title={title} placement={placement} onClick={onClick} arrow {...props}> | ||
<Tooltip | ||
componentsProps={{ | ||
tooltip: { | ||
sx: { | ||
background: CHARCOAL, | ||
color: WHITE, | ||
fontSize: '0.75rem', | ||
borderRadius: '0.9375rem', | ||
padding: '0.9rem', | ||
zIndex: '999999' | ||
} | ||
}, | ||
popper: { | ||
sx: { | ||
opacity: '1' | ||
} | ||
} | ||
}} | ||
title={title} | ||
placement={placement} | ||
onClick={onClick} | ||
arrow | ||
{...props} | ||
> | ||
{children} | ||
</Tooltip> | ||
); | ||
} | ||
|
||
export default StyledTooltip; | ||
export default CustomTooltip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters