From 0c047d56be6163ba6df6e0f7971734baa18225c2 Mon Sep 17 00:00:00 2001 From: Florian <88294294+fouteox@users.noreply.github.com> Date: Mon, 28 Nov 2022 15:36:07 +0100 Subject: [PATCH] Fix close modal with escape keydown and cleanup import react (#218) * React formatting * Coherence type for input * Fix close modal with escape key and cleanup import react * fix label * add id for label and try delete import react in ssr.jsx * fix React import and refactor Modal with native Portal in headlessui * fix space * tiny fix --- .../js/Components/ApplicationLogo.jsx | 2 - .../resources/js/Components/Checkbox.jsx | 2 - .../resources/js/Components/DangerButton.jsx | 2 - .../resources/js/Components/Dropdown.jsx | 4 +- .../resources/js/Components/InputLabel.jsx | 2 - .../resources/js/Components/Modal.jsx | 49 ++++++------------- .../resources/js/Components/NavLink.jsx | 1 - .../resources/js/Components/PrimaryButton.jsx | 2 - .../js/Components/ResponsiveNavLink.jsx | 1 - .../js/Components/SecondaryButton.jsx | 2 - .../resources/js/Components/TextInput.jsx | 5 +- .../js/Layouts/AuthenticatedLayout.jsx | 2 +- .../resources/js/Layouts/GuestLayout.jsx | 1 - .../js/Pages/Auth/ConfirmPassword.jsx | 3 +- .../js/Pages/Auth/ForgotPassword.jsx | 2 +- .../resources/js/Pages/Auth/Login.jsx | 4 +- .../resources/js/Pages/Auth/Register.jsx | 6 ++- .../resources/js/Pages/Auth/ResetPassword.jsx | 4 +- .../resources/js/Pages/Auth/VerifyEmail.jsx | 1 - .../resources/js/Pages/Dashboard.jsx | 1 - .../resources/js/Pages/Profile/Edit.jsx | 1 - .../Pages/Profile/Partials/DeleteUserForm.jsx | 2 +- .../Profile/Partials/UpdatePasswordForm.jsx | 2 +- .../Partials/UpdateProfileInformationForm.jsx | 1 - .../resources/js/Pages/Welcome.jsx | 1 - stubs/inertia-react/resources/js/app.jsx | 1 - stubs/inertia-react/resources/js/ssr.jsx | 1 - .../resources/views/app.blade.php | 1 - 28 files changed, 37 insertions(+), 69 deletions(-) diff --git a/stubs/inertia-react/resources/js/Components/ApplicationLogo.jsx b/stubs/inertia-react/resources/js/Components/ApplicationLogo.jsx index 57bc22233..21579606d 100644 --- a/stubs/inertia-react/resources/js/Components/ApplicationLogo.jsx +++ b/stubs/inertia-react/resources/js/Components/ApplicationLogo.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export default function ApplicationLogo({ className }) { return ( diff --git a/stubs/inertia-react/resources/js/Components/Checkbox.jsx b/stubs/inertia-react/resources/js/Components/Checkbox.jsx index 3325e700c..0a02f05f9 100644 --- a/stubs/inertia-react/resources/js/Components/Checkbox.jsx +++ b/stubs/inertia-react/resources/js/Components/Checkbox.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export default function Checkbox({ name, value, handleChange }) { return (
+ return ( + + -
-
-
+
-
{children} -
+
-
-
, - modalRoot + + ); } diff --git a/stubs/inertia-react/resources/js/Components/NavLink.jsx b/stubs/inertia-react/resources/js/Components/NavLink.jsx index 7b6a9e935..be7b1b312 100644 --- a/stubs/inertia-react/resources/js/Components/NavLink.jsx +++ b/stubs/inertia-react/resources/js/Components/NavLink.jsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Link } from '@inertiajs/inertia-react'; export default function NavLink({ href, active, children }) { diff --git a/stubs/inertia-react/resources/js/Components/PrimaryButton.jsx b/stubs/inertia-react/resources/js/Components/PrimaryButton.jsx index 2506b3708..0dfe55fbc 100644 --- a/stubs/inertia-react/resources/js/Components/PrimaryButton.jsx +++ b/stubs/inertia-react/resources/js/Components/PrimaryButton.jsx @@ -1,5 +1,3 @@ -import React from 'react'; - export default function PrimaryButton({ type = 'submit', className = '', processing, children, onClick }) { return (