add types for refactored component

pull/2955/head
Joseph Izang 2 years ago committed by yann300
parent 6f90bb099d
commit 0bda3a543a
  1. 23
      libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx
  2. 10
      libs/remix-ui/helper/src/types/customtooltip.ts

@ -0,0 +1,23 @@
import React from 'react';
import { Fragment } from 'react';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import { CustomTooltipType } from '../../types/customtooltip'
function CustomTooltip({ children, placement, tooltipId, tooltipClasses, tooltipText }: CustomTooltipType) {
return (
<Fragment>
<OverlayTrigger
placement={placement}
overlay={
<Tooltip id={tooltipId ?? `${tooltipText}Tooltip`} className={tooltipClasses}>
<span>{tooltipText}</span>
</Tooltip>
}
>
{children}
</OverlayTrigger>
</Fragment>
)
}

@ -0,0 +1,10 @@
import { ReactNode } from "react"
import { Placement } from "react-bootstrap/esm/Overlay"
export type CustomTooltipType = {
children: ReactNode,
placement?: Placement,
tooltipId?: string,
tooltipClasses?:string,
tooltipText: string
}
Loading…
Cancel
Save