Sfoglia il codice sorgente

feat: add disabled support to tooltip-plus component (#7036)

tags/0.7.0
NFish 1 anno fa
parent
commit
1a302ca957
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3
    1
      web/app/components/base/tooltip-plus/index.tsx

+ 3
- 1
web/app/components/base/tooltip-plus/index.tsx Vedi File

export type TooltipProps = { export type TooltipProps = {
position?: Placement position?: Placement
triggerMethod?: 'hover' | 'click' triggerMethod?: 'hover' | 'click'
disabled?: boolean
popupContent: React.ReactNode popupContent: React.ReactNode
children: React.ReactNode children: React.ReactNode
hideArrow?: boolean hideArrow?: boolean
const Tooltip: FC<TooltipProps> = ({ const Tooltip: FC<TooltipProps> = ({
position = 'top', position = 'top',
triggerMethod = 'hover', triggerMethod = 'hover',
disabled = false,
popupContent, popupContent,
children, children,
hideArrow, hideArrow,


return ( return (
<PortalToFollowElem <PortalToFollowElem
open={open}
open={disabled ? false : open}
onOpenChange={setOpen} onOpenChange={setOpen}
placement={position} placement={position}
offset={offset ?? 10} offset={offset ?? 10}

Loading…
Annulla
Salva