diff --git a/src/ConfirmationDialog.js b/src/ConfirmationDialog.js new file mode 100644 index 0000000..6446e61 --- /dev/null +++ b/src/ConfirmationDialog.js @@ -0,0 +1,29 @@ +import React from 'react'; +import Button from './Button'; + +export default function ConfirmationDialog(props) { + return ( + <> +
+
+

{props.message}

+
+ + +
+
+ + ) +} diff --git a/src/GroupPage.js b/src/GroupPage.js index 07b69df..b0668d2 100644 --- a/src/GroupPage.js +++ b/src/GroupPage.js @@ -6,6 +6,7 @@ import Button from "./Button"; import LinkButton from "./LinkButton"; import Footer from "./Footer"; import Error404 from "./Error404"; +import ConfirmationDialog from './ConfirmationDialog'; import "./css/GroupPage.css"; import "./css/ConfirmationDialog.css"; @@ -599,24 +600,11 @@ export default withRouter(class GroupPage extends Component { } { this.state.showDeleteGroup && - <> -
-
-

Are you sure you want to delete this group?

-
- - -
-
- + } } diff --git a/src/SetPage.js b/src/SetPage.js index 9210212..86af3c2 100644 --- a/src/SetPage.js +++ b/src/SetPage.js @@ -10,6 +10,7 @@ import TestStart from './TestStart'; import ClassicTestStart from './ClassicTestStart'; import LivesTestStart from './LivesTestStart'; import CountdownTestStart from './CountdownTestStart'; +import ConfirmationDialog from "./ConfirmationDialog"; import "./css/PopUp.css"; import "./css/SetPage.css"; @@ -453,24 +454,11 @@ export default withRouter(class SetPage extends React.Component { : this.state.showDeleteConfirmation && - <> -
-
-

Are you sure you want to delete this set?

-
- - -
-
- + } {