This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { Divider, Button, TextField } from "@material-ui/core"; | |
| import { makeStyles } from "@material-ui/core/styles"; | |
| import { FieldArray, Form, Formik, getIn } from "formik"; | |
| import * as Yup from "yup"; | |
| const validationSchema = Yup.object().shape({ | |
| people: Yup.array().of( | |
| Yup.object().shape({ | |
| firstName: Yup.string().required("First name is required"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const fetchAsBlob = url => fetch(url) | |
| .then(response => response.blob()); | |
| export const convertBlobToBase64 = blob => new Promise((resolve, reject) => { | |
| const reader = new FileReader; | |
| reader.onerror = reject; | |
| reader.onload = () => { | |
| resolve(reader.result); | |
| }; | |
| reader.readAsDataURL(blob); |