Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Use tooltips instead of titles on whiteboard buttons (#7643)
Move select and pan to main toolbar Create tooltip component Add tooltip support to button, toggle, toggle groups, select and color input Style shortcuts on primary tools
- Loading branch information
Showing
28 changed files
with
239 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
tldraw/apps/tldraw-logseq/src/components/Button/Button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import { Tooltip } from '../Tooltip' | ||
import type { Side } from '@radix-ui/react-popper' | ||
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
children: React.ReactNode | ||
tooltip?: React.ReactNode | ||
tooltipSide?: Side | ||
} | ||
|
||
export function Button({ className, ...rest }: ButtonProps) { | ||
return <button className={'tl-button ' + (className ?? '')} {...rest} /> | ||
export function Button({ className, tooltip, tooltipSide, ...rest }: ButtonProps) { | ||
return ( | ||
<Tooltip content={tooltip} side={tooltipSide}> | ||
<button className={'tl-button ' + (className ?? '')} {...rest} /> | ||
</Tooltip> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.