Skip to content

Commit

Permalink
Merge pull request layer5io#665 from dottharun/feat/infoTooltip
Browse files Browse the repository at this point in the history
feat: Migrate infoTooltip from cloud
  • Loading branch information
aabidsofi19 authored Jul 2, 2024
2 parents 6a59994 + 4c59088 commit cff50a2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/custom/CustomTooltip/customTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ function CustomTooltip({
}

export default CustomTooltip;
export type { CustomTooltipProps };
3 changes: 2 additions & 1 deletion src/custom/CustomTooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CustomTooltip from './customTooltip';
import InfoTooltip from './infoTooltip';

export { CustomTooltip };
export { CustomTooltip, InfoTooltip };
28 changes: 28 additions & 0 deletions src/custom/CustomTooltip/infoTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { iconSmall } from '../../constants/iconsSizes';
import InfoOutlinedIcon from '../../icons/InfoOutlined/InfoOutlined';
import CustomTooltip, { CustomTooltipProps } from './customTooltip';

type InfoTooltipProps = {
helpText: string | React.ReactNode | JSX.Element;
style?: React.CSSProperties;
} & Omit<CustomTooltipProps, 'title' | 'children'>;

const InfoTooltip = ({ helpText, style = {}, ...props }: InfoTooltipProps) => {
return (
<CustomTooltip title={helpText} {...props}>
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
...style
}}
>
<InfoOutlinedIcon {...iconSmall} />
</div>
</CustomTooltip>
);
};

export default InfoTooltip;
3 changes: 2 additions & 1 deletion src/custom/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CustomColumnVisibilityControl,
CustomColumnVisibilityControlProps
} from './CustomColumnVisibilityControl/CustomColumnVisibilityControl';
import { CustomTooltip } from './CustomTooltip';
import { CustomTooltip, InfoTooltip } from './CustomTooltip';
import {
CustomDialog,
StyledDialogActions,
Expand Down Expand Up @@ -60,6 +60,7 @@ export {
Fallback,
FeedbackButton,
FlipCard,
InfoTooltip,
LearningCard,
ModalCard,
PopperListener,
Expand Down

0 comments on commit cff50a2

Please sign in to comment.