From fc472db322632ce18d1ee8f2f893e5d3e71f9616 Mon Sep 17 00:00:00 2001 From: K Muller Date: Tue, 21 Apr 2026 10:34:18 +0200 Subject: [PATCH] fix: :bug: fixes after re7 --- public/.htaccess | 4 ++ .../Components/Theme/Header/DesktopNav.tsx | 33 ++++++++----- .../Components/Theme/Header/MobileNav.tsx | 44 ++++++++++------- .../ts/front/Pages/Contact/ContactForm.tsx | 49 ++++++++++++++++--- resources/ts/front/Pages/Home.tsx | 2 +- 5 files changed, 93 insertions(+), 39 deletions(-) diff --git a/public/.htaccess b/public/.htaccess index b574a597..207e353b 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -18,6 +18,10 @@ RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] + # Redirect /index.php/anything to /anything + RewriteCond %{THE_REQUEST} /index\.php/([^\s?]*) [NC] + RewriteRule ^index\.php/(.*)$ /$1 [L,R=301,NC] + # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f diff --git a/resources/ts/front/Components/Theme/Header/DesktopNav.tsx b/resources/ts/front/Components/Theme/Header/DesktopNav.tsx index 584ee908..b5417b68 100644 --- a/resources/ts/front/Components/Theme/Header/DesktopNav.tsx +++ b/resources/ts/front/Components/Theme/Header/DesktopNav.tsx @@ -73,17 +73,28 @@ export default function DesktopNav({ {link.title} - +
+ + {link.title} + +
    + {link.children.map((child) => { + return ( + + ); + })} +
+
); diff --git a/resources/ts/front/Components/Theme/Header/MobileNav.tsx b/resources/ts/front/Components/Theme/Header/MobileNav.tsx index 893fcd3c..0fb7ea1c 100644 --- a/resources/ts/front/Components/Theme/Header/MobileNav.tsx +++ b/resources/ts/front/Components/Theme/Header/MobileNav.tsx @@ -35,7 +35,7 @@ function ConditionalLink({ {title} ) : ( - + {title} ); @@ -94,15 +94,21 @@ export default function MobileNav({ navLinks.map((link) => (
{link.children ? ( - +
+ + {link.title} + + +
) : ( // eslint-disable-next-line react/jsx-props-no-spreading @@ -119,17 +125,17 @@ export default function MobileNav({ > {activeMenu && (
- + {activeMenu.title} - - + +
    {activeMenu.children?.map((child) => (
  • diff --git a/resources/ts/front/Pages/Contact/ContactForm.tsx b/resources/ts/front/Pages/Contact/ContactForm.tsx index 941460c2..77225e7a 100644 --- a/resources/ts/front/Pages/Contact/ContactForm.tsx +++ b/resources/ts/front/Pages/Contact/ContactForm.tsx @@ -1,5 +1,5 @@ // * PACKAGES -import { Link, useForm } from "@inertiajs/react"; +import { Link, useForm, usePage } from "@inertiajs/react"; import { FormEvent } from "react"; // * BASE import SimpleString from "$/base/Inputs/SimpleString"; @@ -13,9 +13,16 @@ import Button from "$/uwil/Button"; import BackToHome from "$/uwil/BackToHome"; import str from "@/hooks/use-string"; import { GetTranslation } from "@/lib/utils"; +import DynamicPageResolver from "@/front/Components/DynamicPageResolver"; +import { LaravelEnum } from "@/types/global"; +import { route } from "ziggy-js"; +import { useToast } from "@/hooks/use-toast"; export default function ContactForm() { - const { data, setData, processing } = useForm({ + const { toast } = useToast(); + const activitySectorEnum = usePage().props.activitySectorEnum as LaravelEnum; + const objectEnum = usePage().props.objectEnum as LaravelEnum; + const { data, setData, processing, post, reset, errors } = useForm({ name: "", firstName: "", phone: "", @@ -30,6 +37,26 @@ export default function ContactForm() { const submit = (e: FormEvent) => { e.preventDefault(); + // console.log(data); + // post(route("front.contact.send"), { + // preserveScroll: true, + // onSuccess: () => { + // toast({ + // title: "Mail envoyé", + // variant: "default", + // description: "Votre message a bien été envoyé. Merci !", + // }); + // reset(); + // }, + // onError: (e) => { + // console.log(e, errors); + // toast({ + // title: "Erreur", + // variant: "destructive", + // description: "Une erreur est survenue. Veuillez réessayer.", + // }); + // }, + // }); }; return ( @@ -52,7 +79,7 @@ export default function ContactForm() { onSubmit={submit} data={data} > -
    +
    - Charte - + + {({ href, title }) => ( + + {title} + + )} + . } diff --git a/resources/ts/front/Pages/Home.tsx b/resources/ts/front/Pages/Home.tsx index dcdba74f..0de4f8ca 100644 --- a/resources/ts/front/Pages/Home.tsx +++ b/resources/ts/front/Pages/Home.tsx @@ -286,7 +286,7 @@ export default function Home() { text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Sequi placeat harum laboriosam facilis a odit sunt, vero doloribus voluptatum suscipit odio, esse.", }} button={{ - href: "#FIXME", + href: "https://recrutement.ldc.fr/fr/annonces?brands=2625", label: "Rejoignez-nous", placement: verticalPlacements.TOP, }}