removed formik, used own FormProvider instead

This commit is contained in:
Jan Prochazka
2020-12-05 16:16:04 +01:00
parent 1644587072
commit a3837083da
17 changed files with 248 additions and 266 deletions

View File

@@ -4,6 +4,7 @@ import styled from 'styled-components';
import { FontIcon } from '../icons';
import dimensions from '../theme/dimensions';
import useTheme from '../theme/useTheme';
import { useForm } from '../utility/FormProvider';
const ButtonDiv = styled.div`
padding: 5px 15px;
@@ -58,3 +59,12 @@ export default function LargeButton({ children, onClick, icon = undefined, disab
</ButtonDiv>
);
}
export function LargeFormButton({ children, onClick, icon = undefined, disabled = undefined }) {
const { values } = useForm();
return (
<LargeButton icon={icon} disabled={disabled} onClick={() => onClick(values)}>
{children}
</LargeButton>
);
}