save changes to DB

This commit is contained in:
Jan Prochazka
2020-03-24 19:47:53 +01:00
parent 464662cb18
commit 01e2cb3087
6 changed files with 66 additions and 29 deletions

View File

@@ -14,7 +14,7 @@ const SqlWrapper = styled.div`
width: 40vw;
`;
export default function ConfirmSqlModal({ modalState, sql, engine }) {
export default function ConfirmSqlModal({ modalState, sql, engine, onConfirm }) {
return (
<ModalBase modalState={modalState}>
<h2>Save changes</h2>
@@ -23,7 +23,14 @@ export default function ConfirmSqlModal({ modalState, sql, engine }) {
</SqlWrapper>
<FormRow>
<input type="button" value="OK" onClick={modalState.close} />
<input
type="button"
value="OK"
onClick={() => {
modalState.close();
onConfirm();
}}
/>
<input type="button" value="Close" onClick={modalState.close} />
</FormRow>
</ModalBase>