From 5eaec8231557746c6b262ad0ded7b47e32ae717c Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Tue, 2 Aug 2022 14:17:41 +1000 Subject: [PATCH] Display validation errors alongside the fields --- .../js/Components/ValidationErrors.jsx | 17 ----------------- .../js/Pages/Auth/ConfirmPassword.jsx | 6 +++--- .../resources/js/Pages/Auth/ForgotPassword.jsx | 6 +++--- .../resources/js/Pages/Auth/Login.jsx | 8 +++++--- .../resources/js/Pages/Auth/Register.jsx | 12 +++++++++--- .../resources/js/Pages/Auth/ResetPassword.jsx | 10 +++++++--- .../js/Components/ValidationErrors.vue | 18 ------------------ .../js/Pages/Auth/ConfirmPassword.vue | 5 ++--- .../resources/js/Pages/Auth/ForgotPassword.vue | 5 ++--- .../resources/js/Pages/Auth/Login.vue | 6 +++--- .../resources/js/Pages/Auth/Register.vue | 8 +++++--- .../resources/js/Pages/Auth/ResetPassword.vue | 7 ++++--- 12 files changed, 43 insertions(+), 65 deletions(-) delete mode 100644 stubs/inertia-react/resources/js/Components/ValidationErrors.jsx delete mode 100644 stubs/inertia-vue/resources/js/Components/ValidationErrors.vue diff --git a/stubs/inertia-react/resources/js/Components/ValidationErrors.jsx b/stubs/inertia-react/resources/js/Components/ValidationErrors.jsx deleted file mode 100644 index 7153aaa43..000000000 --- a/stubs/inertia-react/resources/js/Components/ValidationErrors.jsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; - -export default function ValidationErrors({ errors }) { - return ( - Object.keys(errors).length > 0 && ( -
-
Whoops! Something went wrong.
- - -
- ) - ); -} diff --git a/stubs/inertia-react/resources/js/Pages/Auth/ConfirmPassword.jsx b/stubs/inertia-react/resources/js/Pages/Auth/ConfirmPassword.jsx index 4f76330da..2f46a267a 100644 --- a/stubs/inertia-react/resources/js/Pages/Auth/ConfirmPassword.jsx +++ b/stubs/inertia-react/resources/js/Pages/Auth/ConfirmPassword.jsx @@ -2,8 +2,8 @@ import React, { useEffect } from 'react'; import Button from '@/Components/Button'; import Guest from '@/Layouts/Guest'; import Input from '@/Components/Input'; +import InputError from '@/Components/InputError'; import Label from '@/Components/Label'; -import ValidationErrors from '@/Components/ValidationErrors'; import { Head, useForm } from '@inertiajs/inertia-react'; export default function ConfirmPassword() { @@ -35,8 +35,6 @@ export default function ConfirmPassword() { This is a secure area of the application. Please confirm your password before continuing. - -
diff --git a/stubs/inertia-react/resources/js/Pages/Auth/ForgotPassword.jsx b/stubs/inertia-react/resources/js/Pages/Auth/ForgotPassword.jsx index cfd760380..89c6c1d07 100644 --- a/stubs/inertia-react/resources/js/Pages/Auth/ForgotPassword.jsx +++ b/stubs/inertia-react/resources/js/Pages/Auth/ForgotPassword.jsx @@ -2,7 +2,7 @@ import React from 'react'; import Button from '@/Components/Button'; import Guest from '@/Layouts/Guest'; import Input from '@/Components/Input'; -import ValidationErrors from '@/Components/ValidationErrors'; +import InputError from '@/Components/InputError'; import { Head, useForm } from '@inertiajs/inertia-react'; export default function ForgotPassword({ status }) { @@ -31,8 +31,6 @@ export default function ForgotPassword({ status }) { {status &&
{status}
} - - + +