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.

Revisions

  1. Aslemammad created this gist Jul 13, 2020.
    19 changes: 19 additions & 0 deletions ConfirmModal.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    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>
    )
    }