fix: 🐛 fixes after re7
This commit is contained in:
parent
672af76d4b
commit
fc472db322
5 changed files with 93 additions and 39 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -73,17 +73,28 @@ export default function DesktopNav({
|
|||
{link.title}
|
||||
</NavigationMenuTrigger>
|
||||
<NavigationMenuContent className="z-50">
|
||||
<ul className="w-96 list-disc pl-5 space-y-0.5">
|
||||
{link.children.map((child) => {
|
||||
return (
|
||||
<ListItem
|
||||
href={child.href ?? ""}
|
||||
title={child.title}
|
||||
external={child.external}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
<div className="flex items-start gap-8 justify-between">
|
||||
<NavigationMenuLink
|
||||
asChild
|
||||
className={cn(
|
||||
navigationMenuTriggerStyle(),
|
||||
"text-sm font-semibold",
|
||||
)}
|
||||
>
|
||||
<Link href={link.href}>{link.title}</Link>
|
||||
</NavigationMenuLink>
|
||||
<ul className="w-max list-disc pl-5 space-y-0.5">
|
||||
{link.children.map((child) => {
|
||||
return (
|
||||
<ListItem
|
||||
href={child.href ?? ""}
|
||||
title={child.title}
|
||||
external={child.external}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function ConditionalLink({
|
|||
{title}
|
||||
</a>
|
||||
) : (
|
||||
<Link href={href ?? "#"} className="text-xl font-bold">
|
||||
<Link href={href ?? "#"} className={cn("text-xl font-bold", className)}>
|
||||
{title}
|
||||
</Link>
|
||||
);
|
||||
|
|
@ -94,15 +94,21 @@ export default function MobileNav({
|
|||
navLinks.map((link) => (
|
||||
<div key={link.title}>
|
||||
{link.children ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="link"
|
||||
onClick={() => setActiveMenu(link)}
|
||||
className="h-fit p-0 text-xl font-bold flex items-center justify-between text-primary-foreground"
|
||||
>
|
||||
{link.title}
|
||||
<ChevronRight />
|
||||
</Button>
|
||||
<div className="flex items-center justify-between">
|
||||
<Link
|
||||
href={link.href ?? "#"}
|
||||
className="text-xl font-bold"
|
||||
>
|
||||
{link.title}
|
||||
</Link>
|
||||
<Button
|
||||
size="icon"
|
||||
variant="outline"
|
||||
onClick={() => setActiveMenu(link)}
|
||||
>
|
||||
<ChevronRight />
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
<ConditionalLink {...link} />
|
||||
|
|
@ -119,17 +125,17 @@ export default function MobileNav({
|
|||
>
|
||||
{activeMenu && (
|
||||
<div className="flex flex-col items-start justify-start gap-8">
|
||||
<Button
|
||||
onClick={goBack}
|
||||
type="button"
|
||||
variant="link"
|
||||
className="h-fit p-0 text-xl font-bold flex items-center text-primary-foreground"
|
||||
>
|
||||
<>
|
||||
<div className="flex items-center gap-3">
|
||||
<Button onClick={goBack} size="icon" variant="outline">
|
||||
<ChevronLeft />
|
||||
</Button>
|
||||
<Link
|
||||
href={activeMenu.href}
|
||||
className="font-semibold text-xl"
|
||||
>
|
||||
{activeMenu.title}
|
||||
</>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
<ul className="list-disc pl-5 space-y-4">
|
||||
{activeMenu.children?.map((child) => (
|
||||
<li key={child.title}>
|
||||
|
|
|
|||
|
|
@ -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<HTMLFormElement>) => {
|
||||
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}
|
||||
>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 space-y-6 gap-5">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-5 gap-y-8 md:gap-y-10">
|
||||
<SimpleString
|
||||
value={data.name}
|
||||
setData={setData}
|
||||
|
|
@ -137,7 +164,7 @@ export default function ContactForm() {
|
|||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
required={false}
|
||||
name="entrepriseName"
|
||||
disabled={processing}
|
||||
placeholder={str(
|
||||
|
|
@ -149,6 +176,7 @@ export default function ContactForm() {
|
|||
.value()}
|
||||
/>
|
||||
<EnumSelect
|
||||
options={activitySectorEnum}
|
||||
selected={Number(data.activitySector)}
|
||||
setData={setData}
|
||||
label={str(
|
||||
|
|
@ -158,7 +186,7 @@ export default function ContactForm() {
|
|||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
required={false}
|
||||
name="activitySector"
|
||||
disabled={processing}
|
||||
placeholder={str(
|
||||
|
|
@ -171,6 +199,7 @@ export default function ContactForm() {
|
|||
/>
|
||||
<EnumSelect
|
||||
selected={Number(data.object)}
|
||||
options={objectEnum}
|
||||
setData={setData}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.object.label"),
|
||||
|
|
@ -215,9 +244,13 @@ export default function ContactForm() {
|
|||
{str(GetTranslation("validation.custom.contact_form.terms"))
|
||||
.ucFirst()
|
||||
.value()}{" "}
|
||||
<Link className="underline" href="/">
|
||||
Charte
|
||||
</Link>
|
||||
<DynamicPageResolver pageKey="pageCharteDeConfidentialite">
|
||||
{({ href, title }) => (
|
||||
<Link href={href} className="underline">
|
||||
{title}
|
||||
</Link>
|
||||
)}
|
||||
</DynamicPageResolver>
|
||||
.
|
||||
</>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -286,7 +286,7 @@ export default function Home() {
|
|||
text: "<strong>Lorem ipsum dolor sit amet consectetur adipisicing elit</strong>. 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,
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue