Skip to content

Commit

Permalink
fix: toggle tooltip param
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Dec 15, 2022
1 parent b1d499a commit 31e3981
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Expand Up @@ -126,7 +126,7 @@ const AutoResizingAction = observer(() => {

return (
<ToggleInput
title="Auto Resize"
tooltip="Auto Resize"
toggle={shapes.every(s => s.props.type === 'logseq-portal')}
className="tl-button"
pressed={pressed}
Expand Down Expand Up @@ -300,7 +300,7 @@ const NoFillAction = observer(() => {
const noFill = shapes.every(s => s.props.noFill)

return (
<ToggleInput title="Fill" className="tl-button" pressed={noFill} onPressedChange={handleChange}>
<ToggleInput tooltip="Fill" className="tl-button" pressed={noFill} onPressedChange={handleChange}>
<TablerIcon name={noFill ? 'droplet-off' : 'droplet'} />
</ToggleInput>
)
Expand Down Expand Up @@ -435,7 +435,7 @@ const TextStyleAction = observer(() => {
return (
<span className="flex gap-1">
<ToggleInput
title="Bold"
tooltip="Bold"
className="tl-button"
pressed={bold}
onPressedChange={v => {
Expand All @@ -451,7 +451,7 @@ const TextStyleAction = observer(() => {
<TablerIcon name="bold" />
</ToggleInput>
<ToggleInput
title="Italic"
tooltip="Italic"
className="tl-button"
pressed={italic}
onPressedChange={v => {
Expand Down
Expand Up @@ -4,6 +4,7 @@ import * as Toggle from '@radix-ui/react-toggle'
interface ToggleInputProps extends React.HTMLAttributes<HTMLElement> {
toggle?: boolean
pressed: boolean
tooltip?: string
onPressedChange: (value: boolean) => void
}

Expand All @@ -12,11 +13,11 @@ export function ToggleInput({
pressed,
onPressedChange,
className,
title,
tooltip,
...rest
}: ToggleInputProps) {
return (
<Tooltip content={title} asChild={false}>
<Tooltip content={tooltip} asChild={false}>
<Toggle.Root
{...rest}
data-toggle={toggle}
Expand Down

0 comments on commit 31e3981

Please sign in to comment.