diff --git a/src/components/common/ConfirmationButton.tsx b/src/components/common/ConfirmationButton.tsx new file mode 100644 index 0000000..8498189 --- /dev/null +++ b/src/components/common/ConfirmationButton.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { ButtonProps } from '@material-ui/core'; +import Button from '@material-ui/core/Button'; + +const ConfirmationButton = (props: ButtonProps) => { + const [isAskingForConfirmation, toggleConfirmation] = React.useState(false); + const { className, onClick, ...buttonProps } = props; + const askForConfirmation = () => { + toggleConfirmation(true); + setTimeout(() => toggleConfirmation(false), 3000); + }; + const onConfirmation = (e: any) => { + toggleConfirmation(false); + onClick!(e); + }; + if (isAskingForConfirmation) { + return ; + } + return + - {/* -
-

Manifest Data

-
{formatDisplayData(standaloneData)}
-
-
*/} );