-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from Cycling74/fde/tooltips
More tooltips
- Loading branch information
Showing
27 changed files
with
197 additions
and
92 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ActionIcon, Button, ButtonProps, Tooltip } from "@mantine/core"; | ||
import { FC, MouseEvent } from "react"; | ||
import { IconElement } from "./icon"; | ||
|
||
export type ResponsiveButtonProps = { | ||
color?: ButtonProps["color"]; | ||
variant?: ButtonProps["variant"]; | ||
label: string; | ||
icon: string; | ||
onClick: (e: MouseEvent<HTMLButtonElement>) => any; | ||
tooltip?: string; | ||
} | ||
|
||
export const ResponsiveButton: FC<ResponsiveButtonProps> = ({ | ||
color, | ||
variant = "default", | ||
label, | ||
icon, | ||
onClick, | ||
tooltip | ||
}) => { | ||
|
||
return ( | ||
<> | ||
<Tooltip label={ tooltip || "" } disabled={ !tooltip?.length }> | ||
<Button visibleFrom="sm" variant={ variant } color={ color } leftSection={ <IconElement path={ icon } /> } onClick={ onClick } > | ||
{ label } | ||
</Button> | ||
</Tooltip> | ||
<Tooltip label={ tooltip || "" } disabled={ !tooltip?.length }> | ||
<ActionIcon hiddenFrom="sm" variant={ variant } color={ color } onClick={ onClick } size="lg"> | ||
<IconElement path={ icon } /> | ||
</ActionIcon> | ||
</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
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.