Skip to content

Commit cff50a2

Browse files
authored
Merge pull request #665 from dottharun/feat/infoTooltip
feat: Migrate infoTooltip from cloud
2 parents 6a59994 + 4c59088 commit cff50a2

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

src/custom/CustomTooltip/customTooltip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ function CustomTooltip({
5656
}
5757

5858
export default CustomTooltip;
59+
export type { CustomTooltipProps };

src/custom/CustomTooltip/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import CustomTooltip from './customTooltip';
2+
import InfoTooltip from './infoTooltip';
23

3-
export { CustomTooltip };
4+
export { CustomTooltip, InfoTooltip };
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { iconSmall } from '../../constants/iconsSizes';
2+
import InfoOutlinedIcon from '../../icons/InfoOutlined/InfoOutlined';
3+
import CustomTooltip, { CustomTooltipProps } from './customTooltip';
4+
5+
type InfoTooltipProps = {
6+
helpText: string | React.ReactNode | JSX.Element;
7+
style?: React.CSSProperties;
8+
} & Omit<CustomTooltipProps, 'title' | 'children'>;
9+
10+
const InfoTooltip = ({ helpText, style = {}, ...props }: InfoTooltipProps) => {
11+
return (
12+
<CustomTooltip title={helpText} {...props}>
13+
<div
14+
style={{
15+
display: 'flex',
16+
flexDirection: 'row',
17+
alignItems: 'center',
18+
justifyContent: 'center',
19+
...style
20+
}}
21+
>
22+
<InfoOutlinedIcon {...iconSmall} />
23+
</div>
24+
</CustomTooltip>
25+
);
26+
};
27+
28+
export default InfoTooltip;

src/custom/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
CustomColumnVisibilityControl,
99
CustomColumnVisibilityControlProps
1010
} from './CustomColumnVisibilityControl/CustomColumnVisibilityControl';
11-
import { CustomTooltip } from './CustomTooltip';
11+
import { CustomTooltip, InfoTooltip } from './CustomTooltip';
1212
import {
1313
CustomDialog,
1414
StyledDialogActions,
@@ -60,6 +60,7 @@ export {
6060
Fallback,
6161
FeedbackButton,
6262
FlipCard,
63+
InfoTooltip,
6364
LearningCard,
6465
ModalCard,
6566
PopperListener,

0 commit comments

Comments
 (0)