From eff869fd496de0920bf0eff55b90572c5ede77c7 Mon Sep 17 00:00:00 2001 From: Ismaeel Abdulghani Date: Fri, 1 Mar 2024 18:27:17 -0500 Subject: [PATCH] Fixed form --- frontend/package-lock.json | 376 ++++++-------------- frontend/package.json | 2 + frontend/src/app/components/DatePicker.tsx | 20 ++ frontend/src/app/components/RadioButton.tsx | 15 +- frontend/src/app/form/Assessment.tsx | 4 +- frontend/src/app/form/Pet.tsx | 14 +- frontend/src/app/form/Submit.tsx | 11 +- frontend/src/app/form/page.tsx | 5 +- frontend/src/app/info/Pet.tsx | 27 +- 9 files changed, 184 insertions(+), 290 deletions(-) create mode 100644 frontend/src/app/components/DatePicker.tsx diff --git a/frontend/package-lock.json b/frontend/package-lock.json index bd5747c..2038fed 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,12 +8,10 @@ "name": "combined-community-action", "version": "0.1.0", "dependencies": { -<<<<<<< Updated upstream -======= "@tailwindcss/forms": "^0.5.7", ->>>>>>> Stashed changes "@types/node": "20.8.9", "@types/react": "18.2.33", + "@types/react-datepicker": "^6.0.2", "@types/react-dom": "18.2.14", "autoprefixer": "10.4.16", "eslint": "8.50.0", @@ -21,14 +19,11 @@ "next": "13.5.6", "postcss": "8.4.31", "react": "18.2.0", + "react-datepicker": "^6.2.0", "react-dom": "18.2.0", "tailwindcss": "3.3.3", -<<<<<<< Updated upstream "typescript": "5.2.2", "zustand": "^4.4.6" -======= - "typescript": "5.2.2" ->>>>>>> Stashed changes }, "devDependencies": { "prettier": "3.0.3" @@ -116,6 +111,54 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz", + "integrity": "sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==", + "dependencies": { + "@floating-ui/utils": "^0.2.1" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", + "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", + "dependencies": { + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.0" + } + }, + "node_modules/@floating-ui/react": { + "version": "0.26.9", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.9.tgz", + "integrity": "sha512-p86wynZJVEkEq2BBjY/8p2g3biQ6TlgT4o/3KgFKyTWoJLU1GZ8wpctwRqtkEl2tseYA+kw7dBAIDFcednfI5w==", + "dependencies": { + "@floating-ui/react-dom": "^2.0.8", + "@floating-ui/utils": "^0.2.1", + "tabbable": "^6.0.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz", + "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==", + "dependencies": { + "@floating-ui/dom": "^1.6.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", + "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -217,129 +260,6 @@ "node": ">= 10" } }, -<<<<<<< Updated upstream - "node_modules/@next/swc-darwin-x64": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.6.tgz", - "integrity": "sha512-6cgBfxg98oOCSr4BckWjLLgiVwlL3vlLj8hXg2b+nDgm4bC/qVXXLfpLB9FHdoDu4057hzywbxKvmYGmi7yUzA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.6.tgz", - "integrity": "sha512-txagBbj1e1w47YQjcKgSU4rRVQ7uF29YpnlHV5xuVUsgCUf2FmyfJ3CPjZUvpIeXCJAoMCFAoGnbtX86BK7+sg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.6.tgz", - "integrity": "sha512-cGd+H8amifT86ZldVJtAKDxUqeFyLWW+v2NlBULnLAdWsiuuN8TuhVBt8ZNpCqcAuoruoSWynvMWixTFcroq+Q==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.6.tgz", - "integrity": "sha512-Mc2b4xiIWKXIhBy2NBTwOxGD3nHLmq4keFk+d4/WL5fMsB8XdJRdtUlL87SqVCTSaf1BRuQQf1HvXZcy+rq3Nw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.6.tgz", - "integrity": "sha512-CFHvP9Qz98NruJiUnCe61O6GveKKHpJLloXbDSWRhqhkJdZD2zU5hG+gtVJR//tyW897izuHpM6Gtf6+sNgJPQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-arm64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.6.tgz", - "integrity": "sha512-aFv1ejfkbS7PUa1qVPwzDHjQWQtknzAZWGTKYIAaS4NMtBlk3VyA6AYn593pqNanlicewqyl2jUhQAaFV/qXsg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.6.tgz", - "integrity": "sha512-XqqpHgEIlBHvzwG8sp/JXMFkLAfGLqkbVsyN+/Ih1mR8INb6YCc2x/Mbwi6hsAgUnqQztz8cvEbHJUbSl7RHDg==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-x64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.6.tgz", - "integrity": "sha512-Cqfe1YmOS7k+5mGu92nl5ULkzpKuxJrP3+4AEuPmrpFZ3BHxTY3TnHmU1On3bFmFFs6FbTcdF58CCUProGpIGQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, -======= ->>>>>>> Stashed changes "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -385,8 +305,6 @@ "tslib": "^2.4.0" } }, -<<<<<<< Updated upstream -======= "node_modules/@tailwindcss/forms": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", @@ -398,7 +316,6 @@ "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" } }, ->>>>>>> Stashed changes "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -427,6 +344,16 @@ "csstype": "^3.0.2" } }, + "node_modules/@types/react-datepicker": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@types/react-datepicker/-/react-datepicker-6.0.2.tgz", + "integrity": "sha512-RnBAD9hO9GgSNZ2WjUZKltP3OkLxHNxmvFHyp8SC5A5qItPH20VWj/4krJ3iqGUiH1pqV/vRTOQKeJfEOqcXSw==", + "dependencies": { + "@floating-ui/react": "^0.26.2", + "@types/react": "*", + "date-fns": "^3.3.1" + } + }, "node_modules/@types/react-dom": { "version": "18.2.14", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.14.tgz", @@ -1001,6 +928,11 @@ "node": ">= 6" } }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" + }, "node_modules/client-only": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", @@ -1069,6 +1001,15 @@ "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==" }, + "node_modules/date-fns": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", + "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2641,8 +2582,6 @@ "node": ">=8.6" } }, -<<<<<<< Updated upstream -======= "node_modules/mini-svg-data-uri": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", @@ -2651,7 +2590,6 @@ "mini-svg-data-uri": "cli.js" } }, ->>>>>>> Stashed changes "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3232,6 +3170,22 @@ "node": ">=0.10.0" } }, + "node_modules/react-datepicker": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-6.2.0.tgz", + "integrity": "sha512-GzEOiE6yLfp9P6XNkOhXuYtZHzoAx3tirbi7/dj2WHlGM+NGE1lefceqGR0ZrYsYaqsNJhIJFTgwUpzVzA+mjw==", + "dependencies": { + "@floating-ui/react": "^0.26.2", + "classnames": "^2.2.6", + "date-fns": "^3.3.1", + "prop-types": "^15.7.2", + "react-onclickoutside": "^6.13.0" + }, + "peerDependencies": { + "react": "^16.9.0 || ^17 || ^18", + "react-dom": "^16.9.0 || ^17 || ^18" + } + }, "node_modules/react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -3249,6 +3203,19 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-onclickoutside": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.13.0.tgz", + "integrity": "sha512-ty8So6tcUpIb+ZE+1HAhbLROvAIJYyJe/1vRrrcmW+jLsaM+/powDRqxzo6hSh9CuRZGSL1Q8mvcF5WRD93a0A==", + "funding": { + "type": "individual", + "url": "https://github.com/Pomax/react-onclickoutside/blob/master/FUNDING.md" + }, + "peerDependencies": { + "react": "^15.5.x || ^16.x || ^17.x || ^18.x", + "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -3695,6 +3662,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, "node_modules/tailwindcss": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", @@ -3957,7 +3929,6 @@ "punycode": "^2.1.0" } }, -<<<<<<< Updated upstream "node_modules/use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", @@ -3966,8 +3937,6 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, -======= ->>>>>>> Stashed changes "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -4100,11 +4069,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, -<<<<<<< Updated upstream "node_modules/zustand": { - "version": "4.4.6", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.4.6.tgz", - "integrity": "sha512-Rb16eW55gqL4W2XZpJh0fnrATxYEG3Apl2gfHTyDSE965x/zxslTikpNch0JgNjJA9zK6gEFW8Fl6d1rTZaqgg==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.1.tgz", + "integrity": "sha512-XlauQmH64xXSC1qGYNv00ODaQ3B+tNPoy22jv2diYiP4eoDKr9LA+Bh5Bc3gplTrFdb6JVI+N4kc1DZ/tbtfPg==", "dependencies": { "use-sync-external-store": "1.2.0" }, @@ -4113,7 +4081,7 @@ }, "peerDependencies": { "@types/react": ">=16.8", - "immer": ">=9.0", + "immer": ">=9.0.6", "react": ">=16.8" }, "peerDependenciesMeta": { @@ -4126,126 +4094,6 @@ "react": { "optional": true } -======= - "node_modules/@next/swc-darwin-x64": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.6.tgz", - "integrity": "sha512-6cgBfxg98oOCSr4BckWjLLgiVwlL3vlLj8hXg2b+nDgm4bC/qVXXLfpLB9FHdoDu4057hzywbxKvmYGmi7yUzA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.6.tgz", - "integrity": "sha512-txagBbj1e1w47YQjcKgSU4rRVQ7uF29YpnlHV5xuVUsgCUf2FmyfJ3CPjZUvpIeXCJAoMCFAoGnbtX86BK7+sg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-arm64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.6.tgz", - "integrity": "sha512-cGd+H8amifT86ZldVJtAKDxUqeFyLWW+v2NlBULnLAdWsiuuN8TuhVBt8ZNpCqcAuoruoSWynvMWixTFcroq+Q==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-gnu": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.6.tgz", - "integrity": "sha512-Mc2b4xiIWKXIhBy2NBTwOxGD3nHLmq4keFk+d4/WL5fMsB8XdJRdtUlL87SqVCTSaf1BRuQQf1HvXZcy+rq3Nw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-linux-x64-musl": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.6.tgz", - "integrity": "sha512-CFHvP9Qz98NruJiUnCe61O6GveKKHpJLloXbDSWRhqhkJdZD2zU5hG+gtVJR//tyW897izuHpM6Gtf6+sNgJPQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-arm64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.6.tgz", - "integrity": "sha512-aFv1ejfkbS7PUa1qVPwzDHjQWQtknzAZWGTKYIAaS4NMtBlk3VyA6AYn593pqNanlicewqyl2jUhQAaFV/qXsg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-ia32-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.6.tgz", - "integrity": "sha512-XqqpHgEIlBHvzwG8sp/JXMFkLAfGLqkbVsyN+/Ih1mR8INb6YCc2x/Mbwi6hsAgUnqQztz8cvEbHJUbSl7RHDg==", - "cpu": [ - "ia32" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@next/swc-win32-x64-msvc": { - "version": "13.5.6", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.6.tgz", - "integrity": "sha512-Cqfe1YmOS7k+5mGu92nl5ULkzpKuxJrP3+4AEuPmrpFZ3BHxTY3TnHmU1On3bFmFFs6FbTcdF58CCUProGpIGQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" ->>>>>>> Stashed changes } } } diff --git a/frontend/package.json b/frontend/package.json index 1e3b842..1f0efa9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,6 +12,7 @@ "@tailwindcss/forms": "^0.5.7", "@types/node": "20.8.9", "@types/react": "18.2.33", + "@types/react-datepicker": "^6.0.2", "@types/react-dom": "18.2.14", "autoprefixer": "10.4.16", "eslint": "8.50.0", @@ -19,6 +20,7 @@ "next": "13.5.6", "postcss": "8.4.31", "react": "18.2.0", + "react-datepicker": "^6.2.0", "react-dom": "18.2.0", "tailwindcss": "3.3.3", "typescript": "5.2.2", diff --git a/frontend/src/app/components/DatePicker.tsx b/frontend/src/app/components/DatePicker.tsx new file mode 100644 index 0000000..91f2563 --- /dev/null +++ b/frontend/src/app/components/DatePicker.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import DatePicker from 'react-datepicker'; +import 'react-datepicker/dist/react-datepicker.css'; + +interface DatePickerComponentProps { + selectedDate: Date | null; + onChange: (date: Date ) => void; +} + +const DatePickerComponent: React.FC = (props) => { + return ( + + ); +} + +export default DatePickerComponent; diff --git a/frontend/src/app/components/RadioButton.tsx b/frontend/src/app/components/RadioButton.tsx index 4f24c11..185b6fc 100644 --- a/frontend/src/app/components/RadioButton.tsx +++ b/frontend/src/app/components/RadioButton.tsx @@ -1,14 +1,23 @@ +import React from 'react'; + interface RadioButtonProps { - value: string; + truth: boolean; + check: boolean; + change: (newValue: boolean) => void; } export default function RadioButton(props: RadioButtonProps) { - const { value } = props; + const { truth, check, change } = props; + + const handleChange = () => { + change(truth); // On change, pass the truth value to the change function + }; return ( ); diff --git a/frontend/src/app/form/Assessment.tsx b/frontend/src/app/form/Assessment.tsx index dfd7338..54beae6 100644 --- a/frontend/src/app/form/Assessment.tsx +++ b/frontend/src/app/form/Assessment.tsx @@ -45,7 +45,7 @@ function Assessment(props: AssessmentProps) {
- +
@@ -72,7 +72,7 @@ function Assessment(props: AssessmentProps) {
- Does the client need any other supplies (collars, leashes,bowls, etc)? + Does the client need any other supplies (collars, leashes, bowls, etc)?
diff --git a/frontend/src/app/form/Pet.tsx b/frontend/src/app/form/Pet.tsx index ea84043..d968bc9 100644 --- a/frontend/src/app/form/Pet.tsx +++ b/frontend/src/app/form/Pet.tsx @@ -36,19 +36,21 @@ function Pet(props: PetProps) {
Amount of Food Per Month
- - {props.num==1 &&
props.setFormPage("Pet2")} className='mt-5 text-right'> + +
+ {
props.setFormPage("Assessment")} className='mt-5'>
} - {props.num==2 &&
props.setFormPage("Pet3")} className='mt-5 text-right'> -
} - {props.num==3 &&
props.setFormPage("Assessment")} className='mt-5 text-right'> -
} +
) diff --git a/frontend/src/app/form/Submit.tsx b/frontend/src/app/form/Submit.tsx index e36ca98..d3df41a 100644 --- a/frontend/src/app/form/Submit.tsx +++ b/frontend/src/app/form/Submit.tsx @@ -3,19 +3,22 @@ import Button from '../components/Button'; import Checkbox from '../components/Checkbox'; import RadioButton from '../components/RadioButton'; import TextInput from '../components/TextInput'; +import DatePicker from '../components/DatePicker'; interface SubmitProps { name: string updated: boolean + selectedDate: Date setName: Dispatch>; setUpdated: Dispatch>; + setSelectedDate: Dispatch>; setFormPage: Dispatch>; } function Submit(props: SubmitProps) { - + return (
@@ -24,6 +27,10 @@ function Submit(props: SubmitProps) {
+
+ Date Delivered +
+
Is there any information that needs to be updated? @@ -33,7 +40,7 @@ function Submit(props: SubmitProps) {
- +
diff --git a/frontend/src/app/form/page.tsx b/frontend/src/app/form/page.tsx index f88f52e..c69ac64 100644 --- a/frontend/src/app/form/page.tsx +++ b/frontend/src/app/form/page.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react' import {ReactNode} from "react" import Link from "next/link" -import Client from './Client' +import Client from './client' import Pet from './Pet' import Button from '../components/Button' import Assessment from './Assessment' @@ -39,6 +39,7 @@ export default function DeliveryReportForm() { const [name,setName]=useState("") + const [selectedDate,setSelectedDate] = useState(new Date()) const [updated, setUpdated]=useState(false) useEffect(() => { @@ -69,7 +70,7 @@ export default function DeliveryReportForm() { {formPage=="Pet2" && } {formPage=="Pet3" && } {formPage === "Assessment" && } - {formPage=="Submit" && } + {formPage=="Submit" && } diff --git a/frontend/src/app/info/Pet.tsx b/frontend/src/app/info/Pet.tsx index 51bf63b..3b2fe53 100644 --- a/frontend/src/app/info/Pet.tsx +++ b/frontend/src/app/info/Pet.tsx @@ -100,7 +100,7 @@ function Pet(props: PetProps) {
- +
@@ -112,7 +112,7 @@ function Pet(props: PetProps) {
- +
@@ -124,7 +124,7 @@ function Pet(props: PetProps) {
- +
@@ -137,7 +137,7 @@ function Pet(props: PetProps) {
- +
@@ -149,7 +149,7 @@ function Pet(props: PetProps) {
- +
@@ -168,19 +168,24 @@ function Pet(props: PetProps) { Is there anything else you would like us to know about your pet? +
- {props.num==1 &&
props.setFormPage("Pet2")} className='mt-5 text-right'> -
} - {props.num==2 &&
props.setFormPage("Pet3")} className='mt-5 text-right'> -
} - {props.num==3 &&
props.setFormPage("Confirm")} className='mt-5 text-right'> -
} + +
+ ) }