Skip to content

Commit

Permalink
initial structure
Browse files Browse the repository at this point in the history
  • Loading branch information
13bfrancis committed Oct 25, 2023
1 parent 328e650 commit e186550
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/services/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@emotion/styled": "^11.11.0",
"@heroicons/react": "^2.0.17",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.3.1",
"@hookform/resolvers": "^3.3.2",
"@mui/lab": "^5.0.0-alpha.136",
"@mui/material": "^5.14.1",
"@mui/styled-engine": "^5.13.2",
Expand Down
27 changes: 27 additions & 0 deletions src/services/ui/src/pages/form/medicaid-form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { SubmitHandler, useForm } from "react-hook-form";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";

const formSchema = z.object({
id: z.string(),
additionalInformation: z.string(),
attachments: z.object({}),
});

export type MedicaidFormSchema = z.infer<typeof formSchema>;

export const MedicaidForm = () => {
const { handleSubmit, register, formState } = useForm<MedicaidFormSchema>({
resolver: zodResolver(formSchema),
});

const onSubmit: SubmitHandler<MedicaidFormSchema> = (data) => {
console.log(data, formState.errors);
};

return (
<form onSubmit={handleSubmit(onSubmit)}>
<input {...register("id")} />
</form>
);
};
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3685,10 +3685,10 @@
resolved "https://registry.yarnpkg.com/@hookform/error-message/-/error-message-2.0.1.tgz#6a37419106e13664ad6a29c9dae699ae6cd276b8"
integrity sha512-U410sAr92xgxT1idlu9WWOVjndxLdgPUHEB8Schr27C9eh7/xUnITWpCMF93s+lGiG++D4JnbSnrb5A21AdSNg==

"@hookform/resolvers@^3.3.1":
version "3.3.1"
resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-3.3.1.tgz#b7cbfe767434f52cba6b99b0a9a0b73eb8895188"
integrity sha512-K7KCKRKjymxIB90nHDQ7b9nli474ru99ZbqxiqDAWYsYhOsU3/4qLxW91y+1n04ic13ajjZ66L3aXbNef8PELQ==
"@hookform/resolvers@^3.3.2":
version "3.3.2"
resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-3.3.2.tgz#5c40f06fe8137390b071d961c66d27ee8f76f3bc"
integrity sha512-Tw+GGPnBp+5DOsSg4ek3LCPgkBOuOgS5DsDV7qsWNH9LZc433kgsWICjlsh2J9p04H2K66hsXPPb9qn9ILdUtA==

"@humanwhocodes/config-array@^0.11.11":
version "0.11.11"
Expand Down

0 comments on commit e186550

Please sign in to comment.