From 1c56a11d0bc520fccfa5df23ff7e43355b2f9f8f Mon Sep 17 00:00:00 2001 From: ukorvl Date: Thu, 7 Sep 2023 23:44:00 +0400 Subject: [PATCH] minor changes #8 --- .../pages/Contact/Form/validationSchema.ts | 3 ++- package-lock.json | 18 +++++++++++++++++- package.json | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/components/pages/Contact/Form/validationSchema.ts b/components/pages/Contact/Form/validationSchema.ts index 381a8cf..59de082 100644 --- a/components/pages/Contact/Form/validationSchema.ts +++ b/components/pages/Contact/Form/validationSchema.ts @@ -1,4 +1,5 @@ import {z} from 'zod'; +import {toFormikValidationSchema} from 'zod-formik-adapter'; const requiredFields = z.object({ name: z.string().min(1, 'Name is required').max(50, 'Too Long!'), @@ -24,4 +25,4 @@ const validationSchema = requiredFields.and(optionalFields); */ export type ContactFormData = z.infer; -export default validationSchema; +export default toFormikValidationSchema(validationSchema); diff --git a/package-lock.json b/package-lock.json index 6053296..2589df8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,8 @@ "tailwind-merge": "^1.13.1", "tailwindcss": "^3.3.3", "typescript": "5.0.4", - "zod": "^3.22.2" + "zod": "^3.22.2", + "zod-formik-adapter": "^1.2.0" }, "devDependencies": { "@next/bundle-analyzer": "^13.4.5", @@ -7530,6 +7531,15 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-formik-adapter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-formik-adapter/-/zod-formik-adapter-1.2.0.tgz", + "integrity": "sha512-62U+Mf8U05pvLsIMUTC1H6d4K5SmsrXM+YgiZhCpPin5GNhnVuXCGySmJCs0FHuTJCBy7Et5Z1i8KF5ffuLttg==", + "peerDependencies": { + "formik": "^2.2.9", + "zod": "^3.14.4" + } } }, "dependencies": { @@ -12869,6 +12879,12 @@ "version": "3.22.2", "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz", "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==" + }, + "zod-formik-adapter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-formik-adapter/-/zod-formik-adapter-1.2.0.tgz", + "integrity": "sha512-62U+Mf8U05pvLsIMUTC1H6d4K5SmsrXM+YgiZhCpPin5GNhnVuXCGySmJCs0FHuTJCBy7Et5Z1i8KF5ffuLttg==", + "requires": {} } } } diff --git a/package.json b/package.json index 9688d4e..9e9cc3e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,8 @@ "tailwind-merge": "^1.13.1", "tailwindcss": "^3.3.3", "typescript": "5.0.4", - "zod": "^3.22.2" + "zod": "^3.22.2", + "zod-formik-adapter": "^1.2.0" }, "devDependencies": { "@next/bundle-analyzer": "^13.4.5",