save connection, list connections

This commit is contained in:
Jan Prochazka
2020-01-01 22:11:35 +01:00
parent 0119d1839f
commit 800f3eec26
5 changed files with 67 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import styled from 'styled-components';
import { TextField, SelectField } from './inputs';
import { Field } from 'formik';
import { Field, useFormikContext } from 'formik';
export const FormRow = styled.div`
display: flex;
@@ -40,9 +40,10 @@ export function FormSelectField({ label, children, ...other }) {
}
export function FormSubmit({ text }) {
return (
<FormRow>
<input type="submit" value={text} />
</FormRow>
);
return <input type="submit" value={text} />;
}
export function FormButton({ text, onClick, ...other }) {
const { values } = useFormikContext();
return <input type="button" value={text} onClick={() => onClick(values)} {...other} />;
}