Instantly share code, notes, and snippets.
🏠
Working from home
- Astana, Kazakhstan
This file contains hidden or 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
import { Button, ButtonProps } from '@mantine/core'; | |
import React from 'react'; | |
interface AsyncButtonProps extends ButtonProps { | |
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => Promise<unknown>; | |
} | |
export const AsyncButton = React.forwardRef<HTMLButtonElement, AsyncButtonProps>((props, ref) => { | |
const [pending, setPending] = React.useState(false); | |
const { onClick, ...rest } = props; |
This file contains hidden or 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
import * as React from 'react'; | |
import IconButton from '@material-ui/core/IconButton'; | |
import { Theme, withStyles } from '@material-ui/core/styles'; | |
import AttachFile from '@material-ui/icons/AttachFile'; | |
import Menu from '@material-ui/core/Menu'; | |
import MenuItem from '@material-ui/core/MenuItem'; | |
import Dialog from '@material-ui/core/Dialog'; | |
import DialogTitle from '@material-ui/core/DialogTitle'; | |
import DialogContent from '@material-ui/core/DialogContent'; | |
import Badge from '@material-ui/core/Badge'; |