replaced raw tooltip implementation for remix-ui-checkbox

pull/5370/head
Joseph Izang 2 years ago
parent 9031c9ab4c
commit 1fc70bd850
  1. 23
      libs/remix-ui/checkbox/src/lib/remix-ui-checkbox.tsx

@ -1,3 +1,4 @@
import { CustomTooltip } from '@remix-ui/helper';
import React, { CSSProperties } from 'react' //eslint-disable-line import React, { CSSProperties } from 'react' //eslint-disable-line
import { OverlayProps, OverlayTrigger, OverlayTriggerProps, Tooltip } from 'react-bootstrap'// eslint-disable-line import { OverlayProps, OverlayTrigger, OverlayTriggerProps, Tooltip } from 'react-bootstrap'// eslint-disable-line
import './remix-ui-checkbox.css' import './remix-ui-checkbox.css'
@ -36,15 +37,8 @@ export const RemixUiCheckbox = ({
display = 'flex', display = 'flex',
tooltipPlacement = 'right-start' tooltipPlacement = 'right-start'
}: RemixUiCheckboxProps) => { }: RemixUiCheckboxProps) => {
return (
<OverlayTrigger const childJSX = (
placement={tooltipPlacement}
overlay={
<Tooltip id={`${name}Tooltip`}>
<span>{title}</span>
</Tooltip>
}
>
<div className="listenOnNetwork_2A0YE0 custom-control custom-checkbox" style={{ display: display, alignItems: 'center', visibility: visibility } as CSSProperties } onClick={onClick}> <div className="listenOnNetwork_2A0YE0 custom-control custom-checkbox" style={{ display: display, alignItems: 'center', visibility: visibility } as CSSProperties } onClick={onClick}>
<input <input
id={id} id={id}
@ -60,7 +54,16 @@ export const RemixUiCheckbox = ({
{label} {label}
</label> </label>
</div> </div>
</OverlayTrigger> )
return (
<CustomTooltip
tooltipText={title}
tooltipId={`${name}Tooltip`}
placement={tooltipPlacement}
>
{childJSX}
</CustomTooltip>
) )
} }

Loading…
Cancel
Save