Skip to content

Instantly share code, notes, and snippets.

View NurbekGithub's full-sized avatar
🏠
Working from home

Nurbek NurbekGithub

🏠
Working from home
  • Astana, Kazakhstan
View GitHub Profile
@NurbekGithub
NurbekGithub / AsyncButton.tsx
Created January 16, 2024 01:01
Mantine Async Button
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;
@NurbekGithub
NurbekGithub / MuiUploadButton.tsx
Created November 14, 2018 10:45
Upload Component for Material-ui
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';