From fd03ecbdc9948b9bb3731fcd0e85a8be8429fe29 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 9 Aug 2021 04:40:58 -0700 Subject: [PATCH] move tooltip to shared folder --- .../selectionbar/SelectionButtons.tsx | 14 ++++---------- src/components/shared/CustomTooltip.tsx | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 src/components/shared/CustomTooltip.tsx diff --git a/src/components/selectionbar/SelectionButtons.tsx b/src/components/selectionbar/SelectionButtons.tsx index 3b69125..72e9a0d 100644 --- a/src/components/selectionbar/SelectionButtons.tsx +++ b/src/components/selectionbar/SelectionButtons.tsx @@ -1,27 +1,21 @@ import React from 'react'; -import { IconButton, Icon, Tooltip, Whisper } from 'rsuite'; +import { IconButton, Icon } from 'rsuite'; import { useAppDispatch } from '../../redux/hooks'; import { clearSelected } from '../../redux/multiSelectSlice'; - -const tooltip = (text: string) => {text}; +import CustomTooltip from '../shared/CustomTooltip'; const CustomIconButton = ({ tooltipText, icon, handleClick, ...rest }: any) => { return ( <> {tooltipText ? ( - + } onClick={handleClick} /> - + ) : ( } /> )} diff --git a/src/components/shared/CustomTooltip.tsx b/src/components/shared/CustomTooltip.tsx new file mode 100644 index 0000000..605cabf --- /dev/null +++ b/src/components/shared/CustomTooltip.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Tooltip, Whisper } from 'rsuite'; + +export const tooltip = (text: string) => {text}; + +const CustomTooltip = ({ children, text, delay }: any) => { + return ( + + {children} + + ); +}; + +export default CustomTooltip;