Skip to content

Instantly share code, notes, and snippets.

@Aslemammad
Created July 13, 2020 10:13
Show Gist options
  • Save Aslemammad/ed822e5df79ec50d0fa6f2568aee9b3d to your computer and use it in GitHub Desktop.
Save Aslemammad/ed822e5df79ec50d0fa6f2568aee9b3d to your computer and use it in GitHub Desktop.
import React from 'react';
import { ModalWrapper, Reoverlay } from 'reoverlay';
// reoverlay css
import 'reoverlay/lib/ModalWrapper.css';
const ConfirmModal = ({ confirmText, onConfirm }) => {
const closeModal = () => {
Reoverlay.hideModal();
}
return (
<ModalWrapper>
{confirmText}
<button onClick={onConfirm}>Yes</button>
<button onClick={closeModal}>No</button>
</ModalWrapper>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment