Merge branch 'fix-linters' into 'ovoteam-2026'
fix: :style: 0 lint error See merge request ldc-web/projets/ovoteam!9
This commit is contained in:
commit
433edf13c8
67 changed files with 1906 additions and 1687 deletions
|
|
@ -1 +0,0 @@
|
|||
[["1","2"],{"key":"3","value":"4"},{"key":"5","value":"6"},"/app/srcs/resources/sass/common.scss",{"size":59,"mtime":1773655918680,"data":"7"},"/app/srcs/resources/sass/front/app.scss",{"size":377,"mtime":1773655918680,"data":"8"},{"hashOfConfig":"9"},{"hashOfConfig":"9"},"1u1z2d5"]
|
||||
|
|
@ -27,7 +27,8 @@ class HandleInertiaRequests extends Middleware
|
|||
$dynamicPages = [];
|
||||
|
||||
foreach ($dynamicPageModels as $dynamicPageModel) {
|
||||
$pascalCase = str_replace(' ', '', ucwords(str_replace('-', ' ', $dynamicPageModel->id_key)));
|
||||
$pascalCase =
|
||||
str_replace(' ', '', ucwords(str_replace('-', ' ', $dynamicPageModel->id_key)));
|
||||
$dynamicPages["page{$pascalCase}"] = $dynamicPageModel;
|
||||
}
|
||||
|
||||
|
|
|
|||
5
package-lock.json
generated
5
package-lock.json
generated
|
|
@ -10,6 +10,7 @@
|
|||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@inertiajs/core": "^2.1.5",
|
||||
"@inertiajs/react": "^2.3.18",
|
||||
"@ldc-web/cookie-notice": "^6.1.1",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
"@tiptap/core": "^3.21.0",
|
||||
|
|
@ -65,7 +66,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@headlessui/react": "^2.2.9",
|
||||
"@ldc-web/cookie-notice": "^6.1.1",
|
||||
"@radix-ui/react-accordion": "^1.2.12",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
"@radix-ui/react-collapsible": "^1.1.12",
|
||||
|
|
@ -1792,8 +1792,7 @@
|
|||
"node_modules/@ldc-web/cookie-notice": {
|
||||
"version": "6.1.1",
|
||||
"resolved": "https://lab.s-web.fr/api/v4/projects/50/packages/npm/@ldc-web/cookie-notice/-/@ldc-web/cookie-notice-6.1.1.tgz",
|
||||
"integrity": "sha1-VzAHzvPedfR1OXVLIJXHwaWYeUA=",
|
||||
"dev": true
|
||||
"integrity": "sha1-VzAHzvPedfR1OXVLIJXHwaWYeUA="
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "0.2.12",
|
||||
|
|
|
|||
|
|
@ -15,11 +15,9 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@headlessui/react": "^2.2.9",
|
||||
"@ldc-web/cookie-notice": "^6.1.1",
|
||||
"@radix-ui/react-accordion": "^1.2.12",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
"@radix-ui/react-collapsible": "^1.1.12",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||
"@radix-ui/react-label": "^2.1.8",
|
||||
"@radix-ui/react-popover": "^1.1.15",
|
||||
|
|
@ -71,6 +69,8 @@
|
|||
"vite-plugin-stylelint": "^6.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ldc-web/cookie-notice": "^6.1.1",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@dnd-kit/core": "^6.3.1",
|
||||
"@dnd-kit/sortable": "^10.0.0",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
@use "./common/wysiwyg";
|
||||
|
||||
@use './common/wysiwyg';
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
$primaryForegroundFront: hsl(227 65% 19%);
|
||||
.tiptap {
|
||||
$primary-foreground-front: hsl(227deg 65% 19%);
|
||||
|
||||
color: $primaryForegroundFront;
|
||||
.tiptap {
|
||||
color: $primary-foreground-front;
|
||||
|
||||
h2 {
|
||||
@apply text-4xl font-bold uppercase mb-3;
|
||||
|
|
|
|||
|
|
@ -1,163 +1,161 @@
|
|||
/* Gotham - Black */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: url("&/fonts/Gotham/Gotham-Black.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Black.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - BlackItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 900;
|
||||
src: url("&/fonts/Gotham/Gotham-BlackItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-BlackItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Bold */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url("&/fonts/Gotham/Gotham-Bold.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Bold.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - BoldItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: url("&/fonts/Gotham/Gotham-BoldItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-BoldItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Book */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("&/fonts/Gotham/Gotham-Book.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Book.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - BookItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url("&/fonts/Gotham/Gotham-BookItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-BookItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Light */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: url("&/fonts/Gotham/Gotham-Light.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Light.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - LightItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 300;
|
||||
src: url("&/fonts/Gotham/Gotham-LightItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-LightItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Medium */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url("&/fonts/Gotham/Gotham-Medium.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Medium.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - MediumItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 500;
|
||||
src: url("&/fonts/Gotham/Gotham-MediumItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-MediumItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Thin */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 100;
|
||||
src: url("&/fonts/Gotham/Gotham-Thin.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Thin.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - ThinItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 100;
|
||||
src: url("&/fonts/Gotham/Gotham-ThinItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-ThinItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Ultra */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 950;
|
||||
src: url("&/fonts/Gotham/Gotham-Ultra.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-Ultra.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - UltraItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 950;
|
||||
src: url("&/fonts/Gotham/Gotham-UltraItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-UltraItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - Xlight */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: normal;
|
||||
font-weight: 200;
|
||||
src: url("/fonts/Gotham/Gotham-XLight.ttf") format("truetype");
|
||||
src: url('/fonts/Gotham/Gotham-XLight.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Gotham - XLightItalic */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Gotham";
|
||||
font-family: Gotham;
|
||||
font-style: italic;
|
||||
font-weight: 200;
|
||||
src: url("&/fonts/Gotham/Gotham-XLightItalic.ttf") format("truetype");
|
||||
src: url('&/fonts/Gotham/Gotham-XLightItalic.ttf') format('truetype');
|
||||
}
|
||||
|
||||
|
||||
// DELIUS
|
||||
/* Delius - Regular */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Delius";
|
||||
font-family: Delius;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("&/fonts/Delius/Delius-Regular.ttf") format("truetype");
|
||||
src: url('&/fonts/Delius/Delius-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
/* Delius - SwashCaps */
|
||||
@font-face {
|
||||
font-display: swap;
|
||||
font-family: "Delius Swash Caps";
|
||||
font-family: 'Delius Swash Caps';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("&/fonts/Delius/DeliusSwashCaps-Regular.ttf") format("truetype");
|
||||
src: url('&/fonts/Delius/DeliusSwashCaps-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
// * COMMON CSS.
|
||||
@use './../common';
|
||||
@use './fonts';
|
||||
@use './vendor/_cookie-notice';
|
||||
@use './vendor/cookie-notice';
|
||||
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border font-gotham;
|
||||
|
||||
--primary: 40 100% 64%;
|
||||
--primary-foreground: 227 65% 19%;
|
||||
--background: 0 0% 100%;
|
||||
|
|
@ -14,9 +16,7 @@
|
|||
--accent: 220 14% 96%;
|
||||
--accent-foreground: 227 51% 23%;
|
||||
--foreground: 227 65% 19%;
|
||||
|
||||
|
||||
|
||||
// No customize here
|
||||
--muted: 210 40% 96.1%;
|
||||
--muted-foreground: 215.4 16.3% 46.9%;
|
||||
--popover: 0 0% 100%;
|
||||
|
|
@ -25,9 +25,7 @@
|
|||
--card-foreground: 222.2 84% 4.9%;
|
||||
--border: 214.3 31.8% 91.4%;
|
||||
--input: 214.3 31.8% 91.4%;
|
||||
|
||||
|
||||
|
||||
// End no customize
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 210 40% 98%;
|
||||
--successive: 113 100% 38%;
|
||||
|
|
@ -40,10 +38,6 @@
|
|||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
* {
|
||||
@apply border-border font-gotham;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import axios from "axios";
|
|||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
import recaptcha from "./hooks/use-recaptcha";
|
||||
|
||||
|
||||
// @ts-expect-error Env is always present.
|
||||
const appName = import.meta.env.VITE_APP_NAME || "Laravel";
|
||||
|
||||
|
|
|
|||
|
|
@ -643,13 +643,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
onValueChange(defaultValues);
|
||||
}
|
||||
|
||||
const singleDefaultValue = defaultValues.length > 0 ? defaultValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? defaultValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
defaultValues.length > 0 ? defaultValues[0] : null;
|
||||
setData(name, multiple ? defaultValues : singleDefaultValue);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [defaultValues, onValueChange]);
|
||||
|
||||
|
|
@ -666,12 +662,7 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
onValueChange(values);
|
||||
}
|
||||
const singleDefaultValue = values.length > 0 ? values[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? values
|
||||
: singleDefaultValue
|
||||
);
|
||||
setData(name, multiple ? values : singleDefaultValue);
|
||||
},
|
||||
clear: () => {
|
||||
setSelectedValues([]);
|
||||
|
|
@ -876,13 +867,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
if (onModelChange) {
|
||||
onModelChange(newSelectedModels);
|
||||
}
|
||||
const singleDefaultValue = newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? newSelectedValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(name, multiple ? newSelectedValues : singleDefaultValue);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -904,13 +891,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
if (onModelChange) {
|
||||
onModelChange(newSelectedModels);
|
||||
}
|
||||
const singleDefaultValue = newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? newSelectedValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(name, multiple ? newSelectedValues : singleDefaultValue);
|
||||
if (closeOnSelect) {
|
||||
setIsPopoverOpen(false);
|
||||
}
|
||||
|
|
@ -943,13 +926,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
}
|
||||
setSelectedModels(newSelectedModels);
|
||||
|
||||
const singleDefaultValue = newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? newSelectedValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(name, multiple ? newSelectedValues : singleDefaultValue);
|
||||
} else {
|
||||
if (maxSelection && selectedValues.length >= maxSelection) {
|
||||
announce(`Maximum ${maxSelection} selection(s) allowed`, "assertive");
|
||||
|
|
@ -966,13 +945,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
onModelChange(newSelectedModels);
|
||||
}
|
||||
setSelectedModels(newSelectedModels);
|
||||
const singleDefaultValue = newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? newSelectedValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(name, multiple ? newSelectedValues : singleDefaultValue);
|
||||
}
|
||||
if (closeOnSelect) {
|
||||
setIsPopoverOpen(false);
|
||||
|
|
@ -1020,13 +995,9 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
if (onModelChange) {
|
||||
onModelChange(newSelectedModels);
|
||||
}
|
||||
const singleDefaultValue = newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? newSelectedValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
const singleDefaultValue =
|
||||
newSelectedValues.length > 0 ? newSelectedValues[0] : null;
|
||||
setData(name, multiple ? newSelectedValues : singleDefaultValue);
|
||||
};
|
||||
|
||||
const toggleAll = () => {
|
||||
|
|
@ -1057,12 +1028,7 @@ export const ModelSelect = forwardRef<ModelSelectRef, ModelSelectProps>(
|
|||
onModelChange(allOptions);
|
||||
}
|
||||
const singleDefaultValue = allValues.length > 0 ? allValues[0] : null;
|
||||
setData(
|
||||
name,
|
||||
multiple
|
||||
? allValues
|
||||
: singleDefaultValue
|
||||
);
|
||||
setData(name, multiple ? allValues : singleDefaultValue);
|
||||
}
|
||||
|
||||
if (closeOnSelect) {
|
||||
|
|
|
|||
|
|
@ -9,10 +9,16 @@ import { Link } from "@inertiajs/react";
|
|||
//* THEME
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const BreadcrumbsBase = ({ className, breadcrumbs }: { className?: string, breadcrumbs?: Array<{
|
||||
title: string;
|
||||
url: string;
|
||||
}> }) => {
|
||||
export default function BreadcrumbsBase({
|
||||
className,
|
||||
breadcrumbs,
|
||||
}: {
|
||||
className?: string;
|
||||
breadcrumbs?: Array<{
|
||||
title: string;
|
||||
url: string;
|
||||
}>;
|
||||
}) {
|
||||
return (
|
||||
breadcrumbs && (
|
||||
<Breadcrumb className={cn(className)}>
|
||||
|
|
@ -25,7 +31,7 @@ const BreadcrumbsBase = ({ className, breadcrumbs }: { className?: string, bread
|
|||
{breadcrumbIndex >= 1 && <BreadcrumbSeparator />}
|
||||
<BreadcrumbItem className="text-primary-foreground/70">
|
||||
{breadcrumbIndex !== breadcrumbs.length - 1 &&
|
||||
breadcrumb.url ? (
|
||||
breadcrumb.url ? (
|
||||
<Link
|
||||
href={breadcrumb.url}
|
||||
className="rounded-md text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||
|
|
@ -40,8 +46,6 @@ const BreadcrumbsBase = ({ className, breadcrumbs }: { className?: string, bread
|
|||
))}
|
||||
</BreadcrumbList>
|
||||
</Breadcrumb>
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
export default BreadcrumbsBase;
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ import { CarouselPropsWithNavigation } from "@/types/front";
|
|||
|
||||
type Props = CarouselPropsWithNavigation & {
|
||||
className?: string;
|
||||
}
|
||||
const Carousel = (props: Props) => {
|
||||
};
|
||||
export default function Carousel(props: Props) {
|
||||
const { className, ...carouselProps } = props;
|
||||
const { ref, isVisible } = useInView();
|
||||
|
||||
return (
|
||||
<div ref={ref} className={className}>
|
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||
{isVisible && <CarouselContent {...carouselProps} />}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default Carousel;
|
||||
|
|
|
|||
|
|
@ -1,40 +1,80 @@
|
|||
/** REACT */
|
||||
import { ReactNode, useMemo, useRef, useState } from "react";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
/** SWIPER PACKAGE */
|
||||
import { Swiper as SwiperType } from "swiper";
|
||||
import { PaginationOptions } from "swiper/types";
|
||||
import { Swiper, SwiperClass, SwiperSlide } from "swiper/react";
|
||||
import { Pagination } from "swiper/modules";
|
||||
import 'swiper/css';
|
||||
import 'swiper/css/navigation';
|
||||
import 'swiper/css/pagination';
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import "swiper/css/pagination";
|
||||
/** THEME */
|
||||
import ItemCard from "$/uwil/ItemCard";
|
||||
import { CarouselBreakpointsProps, CarouselPropsWithNavigation, SwiperButtonProps } from "@/types/front";
|
||||
import {
|
||||
CarouselBreakpointsProps,
|
||||
CarouselPropsWithNavigation,
|
||||
SwiperButtonProps,
|
||||
} from "@/types/front";
|
||||
import { bgColors } from "@/front/lib/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
||||
const { items, carousel, variant = bgColors.PRIMARY, prevBtn, nextBtn } = props;
|
||||
function NextButton({ swiperRef, disabled, icon }: SwiperButtonProps) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => swiperRef.current?.slideNext()}
|
||||
disabled={disabled}
|
||||
className="hidden md:block disabled:opacity-0"
|
||||
>
|
||||
{icon}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function PrevButton({ swiperRef, disabled, icon }: SwiperButtonProps) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => swiperRef.current?.slidePrev()}
|
||||
disabled={disabled}
|
||||
className="hidden md:block disabled:opacity-0"
|
||||
>
|
||||
{icon}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
const defaultSlidesPerView: Record<number, number> = {
|
||||
768: 2,
|
||||
1024: 3,
|
||||
1248: 4,
|
||||
};
|
||||
|
||||
export default function CarouselContent(props: CarouselPropsWithNavigation) {
|
||||
const {
|
||||
items,
|
||||
carousel,
|
||||
variant = bgColors.PRIMARY,
|
||||
prevBtn,
|
||||
nextBtn,
|
||||
} = props;
|
||||
const [isBeginning, setIsBeginning] = useState(true);
|
||||
const [isEnd, setIsEnd] = useState(false);
|
||||
|
||||
const swiperRef = useRef<SwiperType | null>(null);
|
||||
|
||||
const paginationDefaultVariant = variant === bgColors.PRIMARY ? "bg-background" : "bg-primary"
|
||||
const spaceBetween = carousel?.spaceBetween ?? 50;
|
||||
const slidesPerView = carousel?.slidesPerView ?? 1;
|
||||
const defaultPagination: PaginationOptions = {
|
||||
clickable: true,
|
||||
bulletClass: `inline-block w-3 h-3 rounded-full ${paginationDefaultVariant} mx-1`,
|
||||
bulletActiveClass: 'bg-primary-foreground w-5 h-5',
|
||||
};
|
||||
const defaultPagination = useMemo((): PaginationOptions => {
|
||||
const variantClass =
|
||||
variant === bgColors.PRIMARY ? "bg-background" : "bg-primary";
|
||||
|
||||
const defaultSlidesPerView: Record<number, number> = {
|
||||
768: 2,
|
||||
1024: 3,
|
||||
1248: 4
|
||||
};
|
||||
return {
|
||||
clickable: true,
|
||||
bulletClass: `inline-block w-3 h-3 rounded-full ${variantClass} mx-1`,
|
||||
bulletActiveClass: "bg-primary-foreground w-5 h-5",
|
||||
};
|
||||
}, [variant]);
|
||||
|
||||
const breakpoints = useMemo(() => {
|
||||
return Object.keys({
|
||||
|
|
@ -59,11 +99,9 @@ const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
|||
|
||||
return {
|
||||
...defaultPagination,
|
||||
...(typeof carousel?.pagination === 'object'
|
||||
? carousel.pagination
|
||||
: {}),
|
||||
...(typeof carousel?.pagination === "object" ? carousel.pagination : {}),
|
||||
};
|
||||
}, [carousel?.pagination, variant]);
|
||||
}, [carousel?.pagination, defaultPagination]);
|
||||
|
||||
const handleSwiper = (swiper: SwiperClass) => {
|
||||
swiperRef.current = swiper;
|
||||
|
|
@ -96,14 +134,11 @@ const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
|||
wrapperClass={cn("pb-20", carousel?.wrapperClass)}
|
||||
className="w-full"
|
||||
>
|
||||
{items.map((item, index) => {
|
||||
{items.map((item) => {
|
||||
return (
|
||||
<SwiperSlide
|
||||
key={index}
|
||||
className="justify-center !flex"
|
||||
>
|
||||
<SwiperSlide key={Math.random()} className="justify-center !flex">
|
||||
<ItemCard
|
||||
image={{lazyload: true, ...item.image}}
|
||||
image={{ lazyload: true, ...item.image }}
|
||||
title={item.title}
|
||||
subtitle={item.subtitle}
|
||||
description={item.description}
|
||||
|
|
@ -111,35 +146,10 @@ const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
|||
variant={variant}
|
||||
/>
|
||||
</SwiperSlide>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</Swiper>
|
||||
<NextButton icon={nextBtn} swiperRef={swiperRef} disabled={isEnd} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default CarouselContent;
|
||||
|
||||
const NextButton = ({ swiperRef, disabled, icon }: SwiperButtonProps) => {
|
||||
return (
|
||||
<button
|
||||
onClick={() => swiperRef.current?.slideNext()}
|
||||
disabled={disabled}
|
||||
className="hidden md:block disabled:opacity-0"
|
||||
>
|
||||
{icon}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
const PrevButton = ({ swiperRef, disabled, icon }: SwiperButtonProps) => {
|
||||
return (
|
||||
<button
|
||||
onClick={() => swiperRef.current?.slidePrev()}
|
||||
disabled={disabled}
|
||||
className="hidden md:block disabled:opacity-0"
|
||||
>
|
||||
{icon}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,12 +8,11 @@ type Props = {
|
|||
classes?: {
|
||||
onVisibleClasses?: string;
|
||||
onHiddenClasses?: string;
|
||||
generalClasses?: string
|
||||
}
|
||||
}
|
||||
|
||||
const GoToTopBase = (props: Props) => {
|
||||
generalClasses?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export default function GoToTopBase(props: Props) {
|
||||
const { threshold = 300, behavior = "smooth", children, classes } = props;
|
||||
|
||||
const [visible, setVisible] = useState<boolean>(false);
|
||||
|
|
@ -28,7 +27,7 @@ const GoToTopBase = (props: Props) => {
|
|||
return () => {
|
||||
window.removeEventListener("scroll", handleScroll);
|
||||
};
|
||||
}, []);
|
||||
}, [threshold]);
|
||||
|
||||
const scrollToTop = () => {
|
||||
window.scrollTo({
|
||||
|
|
@ -39,11 +38,17 @@ const GoToTopBase = (props: Props) => {
|
|||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={scrollToTop}
|
||||
className={cn(classes?.generalClasses, "z-10 p-0 fixed bottom-4 md:bottom-32 right-2 md:right-16 transition-all duration-300",
|
||||
visible ? `opacity-100 translate-y-0 ${classes?.onVisibleClasses}` : `opacity-0 translate-y-4 pointer-events-none ${classes?.onHiddenClasses}`)}>
|
||||
className={cn(
|
||||
classes?.generalClasses,
|
||||
"z-10 p-0 fixed bottom-4 md:bottom-32 right-2 md:right-16 transition-all duration-300",
|
||||
visible
|
||||
? `opacity-100 translate-y-0 ${classes?.onVisibleClasses}`
|
||||
: `opacity-0 translate-y-4 pointer-events-none ${classes?.onHiddenClasses}`,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default GoToTopBase;
|
||||
|
|
|
|||
|
|
@ -1,43 +1,47 @@
|
|||
/** OTHER */
|
||||
import * as React from "react"
|
||||
import * as React from "react";
|
||||
/** SHADCN */
|
||||
import { Checkbox } from "@/components/ui/checkbox"
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} from "@/components/ui/accordion"
|
||||
} from "@/components/ui/accordion";
|
||||
/** THEME */
|
||||
import { cn } from "@/lib/utils"
|
||||
import Button from "$/uwil/Button"
|
||||
import { fonts, sidePlacements } from "@/front/lib/constants"
|
||||
import { Trash, X } from "lucide-react"
|
||||
import { cn } from "@/lib/utils";
|
||||
import Button from "$/uwil/Button";
|
||||
import { fonts, sidePlacements } from "@/front/lib/constants";
|
||||
|
||||
export interface FilterOption {
|
||||
id: string
|
||||
label: string
|
||||
checked?: boolean
|
||||
id: string;
|
||||
label: string;
|
||||
checked?: boolean;
|
||||
}
|
||||
|
||||
interface FilterDropdownProps {
|
||||
/** Le texte du bouton */
|
||||
label?: string
|
||||
label?: string;
|
||||
/** Les options de filtre */
|
||||
options: FilterOption[]
|
||||
options: FilterOption[];
|
||||
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
|
||||
/** Callback quand les filtres changent */
|
||||
onChange?: (selectedIds: string[]) => void
|
||||
onChange?: (selectedIds: string[]) => void;
|
||||
/** Ouvrir au survol en plus du clic */
|
||||
openOnHover?: boolean
|
||||
openOnHover?: boolean;
|
||||
/** Délai avant fermeture au survol (ms) */
|
||||
hoverCloseDelay?: number
|
||||
hoverCloseDelay?: number;
|
||||
/** Classes additionnelles pour le bouton */
|
||||
className?: string
|
||||
className?: string;
|
||||
/** Value of the input */
|
||||
value: string[];
|
||||
isMobile?: boolean
|
||||
isMobile?: boolean;
|
||||
}
|
||||
|
||||
export function FilterDropdown({
|
||||
|
|
@ -48,12 +52,14 @@ export function FilterDropdown({
|
|||
hoverCloseDelay = 200,
|
||||
className,
|
||||
value,
|
||||
isMobile = false
|
||||
isMobile = false,
|
||||
}: FilterDropdownProps) {
|
||||
const [open, setOpen] = React.useState(false)
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const selected = new Set(value);
|
||||
const selectedCount = value.length;
|
||||
const closeTimeoutRef = React.useRef<NodeJS.Timeout | null>(null)
|
||||
const closeTimeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const handleCheckedChange = (id: string, checked: boolean) => {
|
||||
let next: string[];
|
||||
|
|
@ -68,30 +74,25 @@ export function FilterDropdown({
|
|||
};
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
if (!openOnHover) return
|
||||
if (!openOnHover) return;
|
||||
if (closeTimeoutRef.current) {
|
||||
clearTimeout(closeTimeoutRef.current)
|
||||
closeTimeoutRef.current = null
|
||||
clearTimeout(closeTimeoutRef.current);
|
||||
closeTimeoutRef.current = null;
|
||||
}
|
||||
setOpen(true)
|
||||
}
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
if (!openOnHover) return
|
||||
if (!openOnHover) return;
|
||||
closeTimeoutRef.current = setTimeout(() => {
|
||||
setOpen(false)
|
||||
}, hoverCloseDelay)
|
||||
}
|
||||
|
||||
setOpen(false);
|
||||
}, hoverCloseDelay);
|
||||
};
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<div className="flex gap-1 items-start">
|
||||
<Accordion
|
||||
type="single"
|
||||
collapsible
|
||||
className="w-full"
|
||||
>
|
||||
<Accordion type="single" collapsible className="w-full">
|
||||
<AccordionItem value={label}>
|
||||
<AccordionTrigger className="py-2 bg-primary rounded-full px-4 text-primary-foreground">
|
||||
<div className="flex gap-1 items-center">
|
||||
|
|
@ -108,6 +109,7 @@ export function FilterDropdown({
|
|||
{options.map((option) => (
|
||||
<label
|
||||
key={option.id}
|
||||
htmlFor={option.id}
|
||||
className="bg-primary hover:bg-primary/80 flex cursor-pointer items-center gap-3 rounded-full px-2 py-2 transition-colors"
|
||||
>
|
||||
<Checkbox
|
||||
|
|
@ -118,7 +120,13 @@ export function FilterDropdown({
|
|||
handleCheckedChange(option.id, checked === true)
|
||||
}
|
||||
/>
|
||||
<Label htmlFor={option.id} className={cn("cursor-pointer text-sm font-normal", fonts.DELIUS_SWASH)}>
|
||||
<Label
|
||||
htmlFor={option.id}
|
||||
className={cn(
|
||||
"cursor-pointer text-sm font-normal",
|
||||
fonts.DELIUS_SWASH,
|
||||
)}
|
||||
>
|
||||
{option.label}
|
||||
</Label>
|
||||
</label>
|
||||
|
|
@ -128,7 +136,7 @@ export function FilterDropdown({
|
|||
</AccordionItem>
|
||||
</Accordion>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
@ -139,11 +147,13 @@ export function FilterDropdown({
|
|||
className="inline-block"
|
||||
>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant={"default"} className={cn("gap-2", className)}
|
||||
<Button
|
||||
variant="default"
|
||||
className={cn("gap-2", className)}
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: sidePlacements.RIGHT,
|
||||
className: cn("transition-transform", open ? "rotate-90" : "")
|
||||
className: cn("transition-transform", open ? "rotate-90" : ""),
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
|
|
@ -163,6 +173,7 @@ export function FilterDropdown({
|
|||
<div className="flex flex-wrap gap-1">
|
||||
{options.map((option) => (
|
||||
<label
|
||||
htmlFor={option.id}
|
||||
key={option.id}
|
||||
className="bg-primary hover:bg-primary/80 flex cursor-pointer items-center gap-3 rounded-full px-2 py-2 transition-colors"
|
||||
>
|
||||
|
|
@ -174,7 +185,13 @@ export function FilterDropdown({
|
|||
handleCheckedChange(option.id, checked === true)
|
||||
}
|
||||
/>
|
||||
<Label htmlFor={option.id} className={cn("cursor-pointer text-sm font-normal", fonts.DELIUS_SWASH)}>
|
||||
<Label
|
||||
htmlFor={option.id}
|
||||
className={cn(
|
||||
"cursor-pointer text-sm font-normal",
|
||||
fonts.DELIUS_SWASH,
|
||||
)}
|
||||
>
|
||||
{option.label}
|
||||
</Label>
|
||||
</label>
|
||||
|
|
@ -195,5 +212,5 @@ export function FilterDropdown({
|
|||
</PopoverContent>
|
||||
</div>
|
||||
</Popover>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,27 +5,35 @@ import { useForm } from "@inertiajs/react";
|
|||
import { Button } from "@/components/ui/button";
|
||||
// * Other
|
||||
import InputError from "@/front/Components/Base/InputError";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group";
|
||||
|
||||
import {
|
||||
InputGroup,
|
||||
InputGroupAddon,
|
||||
InputGroupInput,
|
||||
} from "@/components/ui/input-group";
|
||||
|
||||
export default function SearchInput() {
|
||||
const { data, setData, processing, errors } = useForm({
|
||||
search: ""
|
||||
})
|
||||
search: "",
|
||||
});
|
||||
const submit = (e) => {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
return (
|
||||
<form onSubmit={submit}>
|
||||
<InputGroup className="rounded-full">
|
||||
<InputGroupInput value={data.search} onChange={(e) => setData("search", e.target.value)} disabled={processing} placeholder="Rechercher..." />
|
||||
<InputGroupAddon align={"inline-end"}>
|
||||
<Button variant={"ghost"} className="rounded-full w-7 py-0 h-7">
|
||||
<InputGroupInput
|
||||
value={data.search}
|
||||
onChange={(e) => setData("search", e.target.value)}
|
||||
disabled={processing}
|
||||
placeholder="Rechercher..."
|
||||
/>
|
||||
<InputGroupAddon align="inline-end">
|
||||
<Button variant="ghost" className="rounded-full w-7 py-0 h-7">
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
<InputError message={errors["search"]} />
|
||||
<InputError message={errors?.search} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ export default function SimpleCheckbox({
|
|||
disabled={disabled}
|
||||
className="rounded-full border-primary-foreground data-[state=checked]:bg-primary-foreground data-[state=checked]:text-primary"
|
||||
checked={value}
|
||||
onCheckedChange={(value) => {
|
||||
setData(name, Boolean(value))
|
||||
onCheckedChange={(v) => {
|
||||
setData(name, Boolean(v));
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor={id} className="text-start font-normal">
|
||||
|
|
@ -47,5 +47,5 @@ export default function SimpleCheckbox({
|
|||
</div>
|
||||
<InputError message={localErrors[name]} />
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,294 +0,0 @@
|
|||
import { Button as ShadcnButton } from "@/components/ui/button";
|
||||
import str from "@/hooks/use-string";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { FileCheck, Image, Trash, UploadIcon } from "lucide-react";
|
||||
import { ReactNode, useCallback, useEffect, useState } from "react";
|
||||
import { ErrorCode, FileWithPath, useDropzone } from "react-dropzone";
|
||||
import BtnOptionnalLinkWithTooltip from "../BtnOptionnalLinkWithTooltip";
|
||||
|
||||
type FileWithPreview = FileWithPath & {
|
||||
preview: string;
|
||||
};
|
||||
|
||||
type FileValidation = {
|
||||
validationRules?: {
|
||||
width: string | null;
|
||||
height: string | null;
|
||||
} | null;
|
||||
maxFileSize: string | null;
|
||||
allowedFormats: string | null;
|
||||
};
|
||||
|
||||
type SimpleImageProps = FileValidation & {
|
||||
name: string;
|
||||
value?: string | File | null;
|
||||
/** Original data is the data directly from the model, not in the form state */
|
||||
originalData?: string | undefined;
|
||||
/** Add custom event when refresh to the originalData */
|
||||
onRefreshFile?: () => void;
|
||||
label?: ReactNode | string;
|
||||
required?: boolean;
|
||||
fileName?: string;
|
||||
hasRefreshBtn?: boolean;
|
||||
parentErrors?: Record<string, string> | null;
|
||||
setData: (name: string, value: File | string | null) => void;
|
||||
reset: (name?: string) => void;
|
||||
hasFile?: (hasFile: boolean) => void;
|
||||
}
|
||||
export default function SimpleImage({
|
||||
value,
|
||||
setData,
|
||||
originalData,
|
||||
name = "defaultName",
|
||||
onRefreshFile,
|
||||
label = "defaultLabel",
|
||||
required = false,
|
||||
maxFileSize,
|
||||
validationRules,
|
||||
allowedFormats,
|
||||
reset,
|
||||
fileName = "image",
|
||||
hasRefreshBtn = true,
|
||||
hasFile,
|
||||
parentErrors,
|
||||
}: SimpleImageProps) {
|
||||
const { toast } = useToast();
|
||||
const [selectedFile, setSelectedFile] = useState<FileWithPreview | null>(null);
|
||||
const [accept, setAccept] = useState<Record<string, Array<string>>>({
|
||||
"image/*": [],
|
||||
});
|
||||
const [extensions, setExtensions] = useState<string>();
|
||||
const localMaxFileSize = maxFileSize
|
||||
? parseInt(maxFileSize, 10) * 1024
|
||||
: 50000;
|
||||
|
||||
// Fonction utilitaire pour formater la taille de fichier
|
||||
const formatFileSize = (bytes: number): string => {
|
||||
if (bytes === 0) return "0 Bytes";
|
||||
const k = 1024;
|
||||
const sizes = ["Bytes", "KB", "MB", "GB"];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
const currentSize = sizes[i];
|
||||
const currentBytes = parseFloat((bytes / k ** i).toFixed(2));
|
||||
return `${currentBytes} ${currentSize}`;
|
||||
};
|
||||
|
||||
const dropErrorMessages = {
|
||||
noFile: str(useTrans("front.image.toast.no_file"))
|
||||
.ucFirst()
|
||||
.value(),
|
||||
tooLarge: str(
|
||||
useTrans("front.image.toast.too_big", {
|
||||
params: {
|
||||
maxSize: formatFileSize(localMaxFileSize),
|
||||
},
|
||||
}),
|
||||
)
|
||||
.ucFirst()
|
||||
.value(),
|
||||
forbidden: str(
|
||||
useTrans("front.image.toast.forbidden_file"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value(),
|
||||
tooMany: str(useTrans("front.image.toast.too_many"))
|
||||
.ucFirst()
|
||||
.value(),
|
||||
default: str(
|
||||
useTrans("front.image.toast.defaultError"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value(),
|
||||
};
|
||||
|
||||
const onDrop = useCallback(
|
||||
(acceptedFiles: FileWithPath[]) => {
|
||||
const file = acceptedFiles[0];
|
||||
if (!file) {
|
||||
toast({
|
||||
title: "Oups !",
|
||||
description: dropErrorMessages.noFile,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const fileWithPreview = Object.assign(file, {
|
||||
preview: URL.createObjectURL(file),
|
||||
});
|
||||
|
||||
setSelectedFile(fileWithPreview);
|
||||
setData(name, file);
|
||||
},
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[maxFileSize, formatFileSize],
|
||||
);
|
||||
|
||||
const { getRootProps, getInputProps } = useDropzone({
|
||||
onDrop,
|
||||
accept,
|
||||
multiple: false,
|
||||
maxSize: localMaxFileSize,
|
||||
onDropRejected: (fileRejections) => {
|
||||
const rejection = fileRejections[0];
|
||||
const rejectionCode = rejection?.errors?.[0]?.code;
|
||||
if (rejectionCode === ErrorCode.FileTooLarge) {
|
||||
toast({
|
||||
title: "Oups !",
|
||||
description: `${dropErrorMessages.tooLarge} (${formatFileSize(rejection.file.size)}).`,
|
||||
});
|
||||
} else if (rejectionCode === ErrorCode.FileInvalidType) {
|
||||
toast({
|
||||
title: "Oups !",
|
||||
description: dropErrorMessages.forbidden,
|
||||
});
|
||||
} else if (rejectionCode === ErrorCode.TooManyFiles) {
|
||||
toast({
|
||||
title: "Oups !",
|
||||
description: dropErrorMessages.tooMany,
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
title: "Oups !",
|
||||
description: dropErrorMessages.default,
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Translations
|
||||
const transSelectImgZone = GetTranslation(
|
||||
"front.image.select_file_zone"
|
||||
);
|
||||
const transValidationAllFormats = str(
|
||||
useTrans("front.image.validation.all_formats"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value();
|
||||
const transCropperFileUploaded = useTrans(
|
||||
"front.image.state_file_uploaded",
|
||||
);
|
||||
const transCancel = useTrans("uwil-backend::back.cancel");
|
||||
const getTransValidationAllowedFormats = (targetExtensions: string) => {
|
||||
return str(
|
||||
GetTranslation(
|
||||
"front.image.validation.allowed_formats",
|
||||
{
|
||||
params: {
|
||||
formats: targetExtensions,
|
||||
},
|
||||
},
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value();
|
||||
};
|
||||
const transRulesWeight = GetTranslation(
|
||||
"front.image.validation.rules_weight",
|
||||
{
|
||||
params: {
|
||||
size: formatFileSize(localMaxFileSize).toString(),
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
const buildDropzoneAccept = (): Record<string, string[]> => {
|
||||
if (!allowedFormats) return {};
|
||||
|
||||
const currentExtensions = allowedFormats.split(",");
|
||||
setExtensions(allowedFormats);
|
||||
const mimeMap: Record<string, string> = {
|
||||
jpg: "image/jpeg",
|
||||
jpeg: "image/jpeg",
|
||||
png: "image/png",
|
||||
gif: "image/gif",
|
||||
pdf: "application/pdf",
|
||||
svg: "image/svg+xml",
|
||||
webp: "image/webp",
|
||||
};
|
||||
|
||||
const result: Record<string, Set<string>> = {};
|
||||
|
||||
currentExtensions.forEach((ext) => {
|
||||
const cleanExt = ext.trim().toLowerCase();
|
||||
const mime = mimeMap[cleanExt];
|
||||
if (mime) {
|
||||
if (!result[mime]) {
|
||||
result[mime] = new Set();
|
||||
}
|
||||
result[mime].add(`.${cleanExt}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Convert Set to Array for React Dropzone
|
||||
const currentAccept: Record<string, string[]> = {};
|
||||
Object.entries(result).forEach(([mime, extSet]) => {
|
||||
currentAccept[mime] = Array.from(extSet);
|
||||
});
|
||||
setAccept(currentAccept);
|
||||
return currentAccept;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
buildDropzoneAccept();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
{selectedFile ? (
|
||||
<div className="relative">
|
||||
<div
|
||||
className={cn(
|
||||
"text-sm flex justify-center border border-dashed overflow-hidden whitespace-normal [&_svg]:!size-auto [&_svg]:!shrink text-muted-foreground w-full h-36",
|
||||
)}
|
||||
>
|
||||
<div className="flex flex-col justify-center items-center">
|
||||
<FileCheck />
|
||||
<p className="text-center break-normal w-full mt-2">
|
||||
{str(transCropperFileUploaded).ucFirst().value()}
|
||||
</p>
|
||||
<small>{selectedFile.name}</small>
|
||||
</div>
|
||||
</div>
|
||||
<BtnOptionnalLinkWithTooltip
|
||||
className="absolute top-2 right-2"
|
||||
variant="destructive"
|
||||
content={<Trash className="w-4 h-4 m-auto" />}
|
||||
onClick={() => {
|
||||
setSelectedFile(null);
|
||||
setData(name, null);
|
||||
}}
|
||||
tooltipContent={str(transCancel).ucFirst().value()}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<ShadcnButton
|
||||
variant="ghost"
|
||||
type="button"
|
||||
className={cn(
|
||||
"relative rounded-full bg-muted w-[450px] h-[450px] flex border border-dashed overflow-hidden whitespace-normal [&_svg]:!pointer-events-auto [&_svg]:size-36 [&_svg]:!shrink text-muted-foreground",
|
||||
// { "border-destructive": localErrors[name] },
|
||||
)}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...getRootProps()}
|
||||
>
|
||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||
<input name={"file"} {...getInputProps()} />
|
||||
<div className="flex flex-col justify-center items-center absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
|
||||
<Image className="text-background stroke-[1.5px]" />
|
||||
<p className="text-center break-normal w-full mt-2">
|
||||
{transSelectImgZone}
|
||||
</p>
|
||||
<small>
|
||||
{extensions
|
||||
? getTransValidationAllowedFormats(extensions)
|
||||
: transValidationAllFormats}
|
||||
. {str(transRulesWeight).ucFirst().value()}
|
||||
</small>
|
||||
</div>
|
||||
</ShadcnButton>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -11,61 +11,29 @@ import InputError from "$/base/InputError";
|
|||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
|
||||
interface CustomData {
|
||||
"g-recaptcha-response"?: string;
|
||||
}
|
||||
|
||||
type Props<TFormData> = {
|
||||
onSubmit: (e: FormEvent<HTMLFormElement>) => void;
|
||||
data: TFormData & CustomData;
|
||||
children: React.ReactNode;
|
||||
footer?: React.ReactNode;
|
||||
banner?: BannerClassName
|
||||
classNames?: {
|
||||
wrapperClassName?: string;
|
||||
formClassName?: string;
|
||||
}
|
||||
};
|
||||
|
||||
type BannerClassName = {
|
||||
classNames?: {
|
||||
wrapperClassName?: string;
|
||||
btnClassName?: string;
|
||||
}
|
||||
}
|
||||
export default function RecaptchaForm<TFormData>({ onSubmit, classNames, banner, data, children, footer }: Props<TFormData>) {
|
||||
const { getToken, formRef, enabled } = useRecaptcha();
|
||||
const { errors } = usePage().props;
|
||||
const recaptchaKey = usePage().props.recaptchaKey as string;
|
||||
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
if (!enabled) return;
|
||||
const token = getToken();
|
||||
data["g-recaptcha-response"] = token;
|
||||
onSubmit(e);
|
||||
};
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={cn(classNames?.wrapperClassName)}>
|
||||
<RecaptchaNotice banner={banner} />
|
||||
<form
|
||||
className={cn(classNames?.formClassName)}
|
||||
ref={formRef} onSubmit={handleSubmit} data-recaptcha-key={recaptchaKey} inert={!enabled}>
|
||||
{children}
|
||||
{enabled && (
|
||||
<>
|
||||
<InputError
|
||||
message={errors["g-recaptcha-response"]}
|
||||
/>
|
||||
<div className="r_captcha flex justify-center mt-8" />
|
||||
</>
|
||||
)}
|
||||
{footer}
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
type Props<TFormData> = {
|
||||
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
|
||||
onSubmit: (e: FormEvent<HTMLFormElement>) => void;
|
||||
data: TFormData & CustomData;
|
||||
children: React.ReactNode;
|
||||
footer?: React.ReactNode;
|
||||
banner?: BannerClassName;
|
||||
classNames?: {
|
||||
wrapperClassName?: string;
|
||||
formClassName?: string;
|
||||
};
|
||||
};
|
||||
|
||||
function RecaptchaNotice({ banner }: { banner?: BannerClassName }) {
|
||||
const { enabled } = useRecaptcha();
|
||||
|
|
@ -75,7 +43,7 @@ function RecaptchaNotice({ banner }: { banner?: BannerClassName }) {
|
|||
const label = useTrans("cookie-notice.custom.recaptcha.accept");
|
||||
|
||||
const handleAccept = () => {
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error External library
|
||||
window.WebCookieNotice?.acceptCookie("recaptcha");
|
||||
};
|
||||
|
||||
|
|
@ -84,7 +52,10 @@ function RecaptchaNotice({ banner }: { banner?: BannerClassName }) {
|
|||
return (
|
||||
<div
|
||||
data-cookie-name="recaptcha"
|
||||
className={cn("cn-cookie-activate flex flex-col rounded-lg border border-destructive/50 bg-card text-card-foreground shadow-sm gap-4 mb-4 p-6", banner?.classNames?.wrapperClassName)}
|
||||
className={cn(
|
||||
"cn-cookie-activate flex flex-col rounded-lg border border-destructive/50 bg-card text-card-foreground shadow-sm gap-4 mb-4 p-6",
|
||||
banner?.classNames?.wrapperClassName,
|
||||
)}
|
||||
>
|
||||
<p className="text-2xl font-semibold leading-none tracking-tight flex flex-row w-full items-start">
|
||||
<InfoIcon className="mr-1" />
|
||||
|
|
@ -94,10 +65,56 @@ function RecaptchaNotice({ banner }: { banner?: BannerClassName }) {
|
|||
<small className="text-success fw-normal fs-5">{warning}</small>
|
||||
<Button
|
||||
className={cn(banner?.classNames?.btnClassName)}
|
||||
id="recaptcha-accept" type="button" onClick={handleAccept}>
|
||||
id="recaptcha-accept"
|
||||
type="button"
|
||||
onClick={handleAccept}
|
||||
>
|
||||
{label}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function RecaptchaForm<TFormData>({
|
||||
onSubmit,
|
||||
classNames,
|
||||
banner,
|
||||
data,
|
||||
children,
|
||||
footer,
|
||||
}: Props<TFormData>) {
|
||||
const { getToken, formRef, enabled } = useRecaptcha();
|
||||
const { errors } = usePage().props;
|
||||
const recaptchaKey = usePage().props.recaptchaKey as string;
|
||||
const handleSubmit = (e: FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
if (!enabled) return;
|
||||
const token = getToken();
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
data["g-recaptcha-response"] = token;
|
||||
onSubmit(e);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={cn(classNames?.wrapperClassName)}>
|
||||
<RecaptchaNotice banner={banner} />
|
||||
<form
|
||||
className={cn(classNames?.formClassName)}
|
||||
ref={formRef}
|
||||
onSubmit={handleSubmit}
|
||||
data-recaptcha-key={recaptchaKey}
|
||||
inert={!enabled}
|
||||
>
|
||||
{children}
|
||||
{enabled && (
|
||||
<>
|
||||
<InputError message={errors["g-recaptcha-response"]} />
|
||||
<div className="r_captcha flex justify-center mt-8" />
|
||||
</>
|
||||
)}
|
||||
{footer}
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Loader } from "lucide-react";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { VideoProviderName } from "@/front/lib/constants";
|
||||
import { useCookieNotice } from "@/hooks/use-cookie-notice";
|
||||
import useCookieNotice from "@/hooks/use-cookie-notice";
|
||||
|
||||
type Props = {
|
||||
service: VideoProviderName;
|
||||
|
|
@ -11,37 +11,52 @@ type Props = {
|
|||
iframeContainerClassName?: string;
|
||||
};
|
||||
|
||||
const VideoEmbedWithConsent = ({
|
||||
function NoStatusComponent({
|
||||
loading,
|
||||
service,
|
||||
accept,
|
||||
}: {
|
||||
loading: boolean;
|
||||
service: VideoProviderName;
|
||||
accept: () => void;
|
||||
}) {
|
||||
const warning = GetTranslation(`cookie-notice.custom.${service}.warning`);
|
||||
const acceptLabel = GetTranslation(`cookie-notice.custom.${service}.accept`);
|
||||
return loading ? (
|
||||
<div className="py-48 flex justify-center">
|
||||
<Loader className="size-8 text-primary-foreground/40 animate-spin" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="py-48 flex gap-2 justify-center flex-col md:flex-row">
|
||||
<p>{warning}</p>
|
||||
<button
|
||||
className="underline font-bold hover:opacity-80 transition"
|
||||
type="button"
|
||||
onClick={accept}
|
||||
>
|
||||
{acceptLabel}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function VideoEmbedWithConsent({
|
||||
service,
|
||||
embedUrl,
|
||||
title,
|
||||
className = "",
|
||||
iframeContainerClassName = ""
|
||||
}: Props) => {
|
||||
iframeContainerClassName = "",
|
||||
}: Props) {
|
||||
const { status, loading, accept } = useCookieNotice(service);
|
||||
|
||||
const warning = GetTranslation(`cookie-notice.custom.${service}.warning`);
|
||||
const acceptLabel = GetTranslation(`cookie-notice.custom.${service}.accept`);
|
||||
|
||||
return (
|
||||
<div className={`video-inlaid text-center ${className}`}>
|
||||
{!status ? (
|
||||
loading ? (
|
||||
<div className="py-48 flex justify-center">
|
||||
<Loader className="size-8 text-primary-foreground/40 animate-spin" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="py-48 flex gap-2 justify-center flex-col md:flex-row">
|
||||
<p>{warning}</p>
|
||||
<button
|
||||
className="underline font-bold hover:opacity-80 transition"
|
||||
type="button"
|
||||
onClick={accept}
|
||||
>
|
||||
{acceptLabel}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
<NoStatusComponent
|
||||
loading={loading}
|
||||
service={service}
|
||||
accept={accept}
|
||||
/>
|
||||
) : (
|
||||
<div className={cn("h-[81vh]", iframeContainerClassName)}>
|
||||
<iframe
|
||||
|
|
@ -57,6 +72,4 @@ const VideoEmbedWithConsent = ({
|
|||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoEmbedWithConsent;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ export default function DynamicPageResolver({
|
|||
children,
|
||||
}: {
|
||||
pageKey: PageKey;
|
||||
children: (data: { href: string; title: string; page: DynamicPageModel }) => React.ReactNode;
|
||||
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
|
||||
children: (data: {
|
||||
href: string;
|
||||
title: string;
|
||||
page: DynamicPageModel;
|
||||
}) => React.ReactNode;
|
||||
}) {
|
||||
const dynamicPages = usePage().props.dynamicPages as DynamicPages;
|
||||
const { locale } = usePage().props.appEnv as AppEnv;
|
||||
|
|
@ -23,7 +28,6 @@ export default function DynamicPageResolver({
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
const page = dynamicPages[pageKey];
|
||||
|
||||
if (!page) return null;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
/** SHADCN */
|
||||
import { ButtonProps } from "@/components/ui/button";
|
||||
/** THEME */
|
||||
import { BgColorName, bgColors, VerticalPlacementName, verticalPlacements } from "@/front/lib/constants";
|
||||
import Button from "$/uwil/Button"
|
||||
import {
|
||||
BgColorName,
|
||||
bgColors,
|
||||
VerticalPlacementName,
|
||||
verticalPlacements,
|
||||
} from "@/front/lib/constants";
|
||||
import Button from "$/uwil/Button";
|
||||
import { CustomButtonVariant, TextProps } from "@/types/front";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
|
|
@ -66,14 +71,12 @@ type Props = {
|
|||
* }}
|
||||
* />
|
||||
*/
|
||||
const ActionSection = (props: Props) => {
|
||||
|
||||
export default function ActionSection(props: Props) {
|
||||
const { button, variant = bgColors.PRIMARY, text } = props;
|
||||
|
||||
const placement = button.placement ?? verticalPlacements.BOTTOM;
|
||||
const btnVariant = variant === bgColors.PRIMARY ? "inverted" : "default";
|
||||
|
||||
|
||||
return (
|
||||
<div className={cn("text-center py-20", variant)}>
|
||||
<div className="max-w-7xl mx-auto px-4 md:px-0 space-y-6">
|
||||
|
|
@ -82,35 +85,36 @@ const ActionSection = (props: Props) => {
|
|||
variant={button.variant ?? btnVariant}
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: "right"
|
||||
placement: "right",
|
||||
}}
|
||||
link={{
|
||||
label: button.label,
|
||||
href: button.href
|
||||
href: button.href,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
<p className={cn("text-2xl", text.font)} dangerouslySetInnerHTML={{
|
||||
__html: text.text
|
||||
}} />
|
||||
<p
|
||||
className={cn("text-2xl", text.font)}
|
||||
// eslint-disable-next-line react/no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: text.text,
|
||||
}}
|
||||
/>
|
||||
{placement === verticalPlacements.BOTTOM && (
|
||||
<Button
|
||||
variant={button.variant ?? btnVariant}
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: "right"
|
||||
placement: "right",
|
||||
}}
|
||||
link={{
|
||||
label: button.label,
|
||||
href: button.href
|
||||
href: button.href,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default ActionSection;
|
||||
|
|
|
|||
|
|
@ -6,15 +6,17 @@ import { GetTranslation } from "@/lib/utils";
|
|||
export default function BackToHome() {
|
||||
return (
|
||||
<Button
|
||||
variant={"tertiary"}
|
||||
variant="tertiary"
|
||||
link={{
|
||||
href: "/",
|
||||
label: str(GetTranslation('front.back_to_your_website')).ucFirst().value()
|
||||
label: str(GetTranslation("front.back_to_your_website"))
|
||||
.ucFirst()
|
||||
.value(),
|
||||
}}
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: sidePlacements.LEFT
|
||||
placement: sidePlacements.LEFT,
|
||||
}}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,18 +8,16 @@ type Props = {
|
|||
breadcrumbs?: Array<{
|
||||
title: string;
|
||||
url: string;
|
||||
}>
|
||||
}
|
||||
const Breadcrumbs = (props: Props) => {
|
||||
}>;
|
||||
};
|
||||
export default function Breadcrumbs(props: Props) {
|
||||
const { breadcrumbs, className } = props;
|
||||
const pageBreadcrumbs = usePage().props.breadcrumbs as Array<{
|
||||
title: string;
|
||||
url: string;
|
||||
}>;
|
||||
console.log(usePage().props)
|
||||
const breadcrumbsLocal = pageBreadcrumbs ?? breadcrumbs;
|
||||
return (
|
||||
<BreadcrumbsBase className={className} breadcrumbs={breadcrumbsLocal} />
|
||||
)
|
||||
);
|
||||
}
|
||||
export default Breadcrumbs;
|
||||
|
|
|
|||
|
|
@ -1,33 +1,39 @@
|
|||
import { Button as ShadcnButton, ButtonProps } from "@/components/ui/button"
|
||||
import { FontName, fonts, iconMap, sidePlacements } from "@/front/lib/constants";
|
||||
import { Button as ShadcnButton, ButtonProps } from "@/components/ui/button";
|
||||
import {
|
||||
FontName,
|
||||
fonts,
|
||||
iconMap,
|
||||
sidePlacements,
|
||||
} from "@/front/lib/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { CustomButtonVariant, IconConfig } from "@/types/front";
|
||||
import { Link } from "@inertiajs/react";
|
||||
|
||||
type CustomSize = "xs";
|
||||
|
||||
type ThemeButtonProps = Omit<ButtonProps, "variant" | "size"> & {
|
||||
variant?: ButtonProps["variant"] | CustomButtonVariant;
|
||||
size?: ButtonProps['size'] | CustomSize;
|
||||
icon?: IconConfig
|
||||
isBold?: boolean
|
||||
size?: ButtonProps["size"] | CustomSize;
|
||||
icon?: IconConfig;
|
||||
isBold?: boolean;
|
||||
font?: FontName;
|
||||
link?: {
|
||||
href: string,
|
||||
label: string
|
||||
}
|
||||
}
|
||||
href: string;
|
||||
label: string;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
type CustomSize = "xs";
|
||||
const customVariantSizes: Record<CustomSize, string> = {
|
||||
xs: "h-7 px-3 text-sm",
|
||||
}
|
||||
};
|
||||
|
||||
const customVariantStyles: Record<CustomButtonVariant, string> = {
|
||||
tertiary: "bg-primary-foreground text-background hover:bg-primary-foreground/90",
|
||||
inverted: "bg-background hover:bg-secondary/90"
|
||||
}
|
||||
tertiary:
|
||||
"bg-primary-foreground text-background hover:bg-primary-foreground/90",
|
||||
inverted: "bg-background hover:bg-secondary/90",
|
||||
};
|
||||
|
||||
const Button = ({
|
||||
export default function Button({
|
||||
icon,
|
||||
isBold = true,
|
||||
font = fonts.GOTHAM,
|
||||
|
|
@ -38,18 +44,19 @@ const Button = ({
|
|||
asChild,
|
||||
link,
|
||||
...props
|
||||
}: ThemeButtonProps) => {
|
||||
const Icon = icon ? iconMap[icon.icon] : undefined
|
||||
}: ThemeButtonProps) {
|
||||
const Icon = icon ? iconMap[icon.icon] : undefined;
|
||||
|
||||
const customVariant =
|
||||
variant && variant in customVariantStyles
|
||||
? customVariantStyles[variant as CustomButtonVariant]
|
||||
: ""
|
||||
: "";
|
||||
|
||||
const getSizeClasses = (size?: ButtonProps['size'] | CustomSize) => {
|
||||
if (size && size in customVariantSizes) return customVariantSizes[size as CustomSize]
|
||||
return "h-8 px-5"
|
||||
}
|
||||
const getSizeClasses = () => {
|
||||
if (size && size in customVariantSizes)
|
||||
return customVariantSizes[size as CustomSize];
|
||||
return "h-8 px-5";
|
||||
};
|
||||
|
||||
const iconClassName = icon?.className ?? "";
|
||||
if (link && link.href && link.label) {
|
||||
|
|
@ -57,23 +64,31 @@ const Button = ({
|
|||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn(
|
||||
'rounded-full w-fit',
|
||||
"rounded-full w-fit",
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
getSizeClasses(size),
|
||||
customVariant
|
||||
getSizeClasses(),
|
||||
customVariant,
|
||||
)}
|
||||
asChild
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
{...props}
|
||||
>
|
||||
<Link href={link.href} className="flex items-center justify-center gap-2">
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
<Link
|
||||
href={link.href}
|
||||
className="flex items-center justify-center gap-2"
|
||||
>
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
{link.label}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
</Link>
|
||||
</ShadcnButton>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (asChild) {
|
||||
|
|
@ -81,20 +96,25 @@ const Button = ({
|
|||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn(
|
||||
'rounded-full w-fit',
|
||||
"rounded-full w-fit",
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
getSizeClasses(size),
|
||||
customVariant
|
||||
getSizeClasses(),
|
||||
customVariant,
|
||||
)}
|
||||
asChild
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
{...props}
|
||||
>
|
||||
<div>
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
{children}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
</div>
|
||||
</ShadcnButton>
|
||||
);
|
||||
|
|
@ -103,19 +123,24 @@ const Button = ({
|
|||
return (
|
||||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn('rounded-full w-fit',
|
||||
className={cn(
|
||||
"rounded-full w-fit",
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
getSizeClasses(size),
|
||||
getSizeClasses(),
|
||||
customVariant,
|
||||
)}
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
{...props}
|
||||
>
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
{children}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && (
|
||||
<Icon className={cn(iconClassName)} />
|
||||
)}
|
||||
</ShadcnButton>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default Button;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable react/function-component-definition */
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ReactNode, forwardRef } from "react";
|
||||
|
||||
|
|
@ -16,7 +17,7 @@ const Container = forwardRef<HTMLDivElement, Props>(
|
|||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Container.displayName = "Container";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,18 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
export default function CookieNoticeLink({ className } : { className?: string;}) {
|
||||
export default function CookieNoticeLink({
|
||||
className,
|
||||
}: {
|
||||
className?: string;
|
||||
}) {
|
||||
const handleCookieLink = () => {
|
||||
const cookieButton = document.getElementById('cn-cookie-btn');
|
||||
cookieButton?.click()
|
||||
}
|
||||
const cookieButton = document.getElementById("cn-cookie-btn");
|
||||
cookieButton?.click();
|
||||
};
|
||||
|
||||
return <button type="button" onClick={handleCookieLink} className={cn(className)}>Gestion des cookies</button>
|
||||
return (
|
||||
<button type="button" onClick={handleCookieLink} className={cn(className)}>
|
||||
Gestion des cookies
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,31 @@
|
|||
// * PACKAGES
|
||||
import { Link } from "@inertiajs/react";
|
||||
import { route } from "ziggy-js";
|
||||
//* BASE
|
||||
import DynamicPageResolver from "../DynamicPageResolver";
|
||||
import { bgColors, verticalPlacements } from "@/front/lib/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
// * THEME
|
||||
import Logo from "./Logo";
|
||||
import SocialNetworks from "./SocialNetworks";
|
||||
import { cn } from "@/lib/utils";
|
||||
import ActionSection from "$/uwil/ActionSection";
|
||||
import { bgColors, verticalPlacements } from "@/front/lib/constants";
|
||||
import { route } from "ziggy-js";
|
||||
import DynamicPageResolver from "../DynamicPageResolver";
|
||||
import CookieNoticeLink from "$/uwil/CookieNoticeLink";
|
||||
|
||||
const Footer = () => {
|
||||
export default function Footer() {
|
||||
const hoverLink = "hover:text-primary-foreground/80";
|
||||
|
||||
|
||||
return (
|
||||
<section>
|
||||
<ActionSection
|
||||
text={{
|
||||
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."
|
||||
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: route('front.contact-us'),
|
||||
href: route("front.contact-us"),
|
||||
label: "Nous contacter",
|
||||
placement: verticalPlacements.BOTTOM,
|
||||
}} variant={bgColors.PRIMARY}
|
||||
}}
|
||||
variant={bgColors.PRIMARY}
|
||||
/>
|
||||
<div className="flex flex-col gap-8 justify-center items-center py-20">
|
||||
<Logo className="w-[128px] flex justify-center" />
|
||||
|
|
@ -31,12 +34,16 @@ const Footer = () => {
|
|||
<ul className="flex flex-col gap-3 md:gap-0 md:flex-row items-center justify-around font-medium">
|
||||
<DynamicPageResolver pageKey="pageMentionsLegales">
|
||||
{({ href, title }) => (
|
||||
<Link href={href} className={cn(hoverLink)}>{title}</Link>
|
||||
<Link href={href} className={cn(hoverLink)}>
|
||||
{title}
|
||||
</Link>
|
||||
)}
|
||||
</DynamicPageResolver>
|
||||
<DynamicPageResolver pageKey="pageCharteDeConfidentialite">
|
||||
{({ href, title }) => (
|
||||
<Link href={href} className={cn(hoverLink)}>{title}</Link>
|
||||
<Link href={href} className={cn(hoverLink)}>
|
||||
{title}
|
||||
</Link>
|
||||
)}
|
||||
</DynamicPageResolver>
|
||||
<li>
|
||||
|
|
@ -49,6 +56,5 @@ const Footer = () => {
|
|||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default Footer;
|
||||
|
|
|
|||
|
|
@ -1,30 +1,62 @@
|
|||
import GoToTopBase from "../Base/GoToTopBase";
|
||||
import GoToTopBase from "$/base/GoToTopBase";
|
||||
|
||||
const GoToTop = () => {
|
||||
export default function GoToTop() {
|
||||
return (
|
||||
<GoToTopBase
|
||||
children={
|
||||
<svg width="71" height="83" viewBox="0 0 71 83" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_d_113_2)">
|
||||
<path d="M67 43.5897C67 61.2912 52.897 75 35.5 75C18.103 75 4 61.2912 4 43.5897C4 25.8883 18.103 0 35.5 0C52.897 0 67 25.8883 67 43.5897Z" fill="#FFC647" />
|
||||
<path d="M48.7901 36.0465L37.3473 24.6647C37.1297 24.4575 36.8731 24.2951 36.5924 24.187C36.0356 23.9597 35.4115 23.9605 34.8553 24.1892C34.5748 24.298 34.3187 24.461 34.1016 24.6687L22.6873 36.079C22.4744 36.2917 22.3057 36.5442 22.1907 36.822C22.0757 37.0998 22.0167 37.3975 22.0171 37.698C22.0179 38.305 22.2604 38.8868 22.6913 39.3154C23.1223 39.7441 23.7063 39.9844 24.315 39.9837C24.9237 39.9829 25.5072 39.7411 25.937 39.3114L33.4476 31.7807L33.4693 49.0798C33.47 49.6843 33.7116 50.2637 34.1408 50.6906C34.5699 51.1175 35.1516 51.3569 35.7578 51.3561C36.364 51.3554 36.9451 51.1145 37.3732 50.6866C37.8014 50.2586 38.0415 49.6786 38.0407 49.0741L38.0191 31.775L45.5485 39.287C45.7612 39.5003 46.0142 39.6696 46.2929 39.7849C46.5716 39.9003 46.8704 39.9595 47.1722 39.9591C47.4739 39.9588 47.7726 39.8988 48.051 39.7828C48.3294 39.6667 48.5819 39.4968 48.7942 39.2829C49.0081 39.0708 49.1779 38.8185 49.2936 38.5406C49.4093 38.2627 49.4686 37.9647 49.4683 37.6639C49.4679 37.363 49.4078 37.0652 49.2914 36.7876C49.175 36.51 49.0046 36.2581 48.7901 36.0465Z" fill="#111F51" />
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_113_2" x="0" y="0" width="71" height="83" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
|
||||
<feOffset dy="4" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_113_2" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_113_2" result="shape" />
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
}
|
||||
/>
|
||||
|
||||
)
|
||||
<GoToTopBase>
|
||||
<svg
|
||||
width="71"
|
||||
height="83"
|
||||
viewBox="0 0 71 83"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g filter="url(#filter0_d_113_2)">
|
||||
<path
|
||||
d="M67 43.5897C67 61.2912 52.897 75 35.5 75C18.103 75 4 61.2912 4 43.5897C4 25.8883 18.103 0 35.5 0C52.897 0 67 25.8883 67 43.5897Z"
|
||||
fill="#FFC647"
|
||||
/>
|
||||
<path
|
||||
d="M48.7901 36.0465L37.3473 24.6647C37.1297 24.4575 36.8731 24.2951 36.5924 24.187C36.0356 23.9597 35.4115 23.9605 34.8553 24.1892C34.5748 24.298 34.3187 24.461 34.1016 24.6687L22.6873 36.079C22.4744 36.2917 22.3057 36.5442 22.1907 36.822C22.0757 37.0998 22.0167 37.3975 22.0171 37.698C22.0179 38.305 22.2604 38.8868 22.6913 39.3154C23.1223 39.7441 23.7063 39.9844 24.315 39.9837C24.9237 39.9829 25.5072 39.7411 25.937 39.3114L33.4476 31.7807L33.4693 49.0798C33.47 49.6843 33.7116 50.2637 34.1408 50.6906C34.5699 51.1175 35.1516 51.3569 35.7578 51.3561C36.364 51.3554 36.9451 51.1145 37.3732 50.6866C37.8014 50.2586 38.0415 49.6786 38.0407 49.0741L38.0191 31.775L45.5485 39.287C45.7612 39.5003 46.0142 39.6696 46.2929 39.7849C46.5716 39.9003 46.8704 39.9595 47.1722 39.9591C47.4739 39.9588 47.7726 39.8988 48.051 39.7828C48.3294 39.6667 48.5819 39.4968 48.7942 39.2829C49.0081 39.0708 49.1779 38.8185 49.2936 38.5406C49.4093 38.2627 49.4686 37.9647 49.4683 37.6639C49.4679 37.363 49.4078 37.0652 49.2914 36.7876C49.175 36.51 49.0046 36.2581 48.7901 36.0465Z"
|
||||
fill="#111F51"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter
|
||||
id="filter0_d_113_2"
|
||||
x="0"
|
||||
y="0"
|
||||
width="71"
|
||||
height="83"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset dy="4" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_113_2"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_113_2"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
</GoToTopBase>
|
||||
);
|
||||
}
|
||||
export default GoToTop;
|
||||
|
|
|
|||
|
|
@ -7,17 +7,40 @@ import {
|
|||
NavigationMenuList,
|
||||
NavigationMenuTrigger,
|
||||
navigationMenuTriggerStyle,
|
||||
} from "@/components/ui/navigation-menu"
|
||||
import { Link } from "@inertiajs/react"
|
||||
|
||||
} from "@/components/ui/navigation-menu";
|
||||
import { Link } from "@inertiajs/react";
|
||||
import React from "react";
|
||||
//* THEME
|
||||
import Logo from "$/uwil/Logo"
|
||||
import SocialNetworks from "$/uwil/SocialNetworks"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { FrontNavLinkProps } from "@/types/front"
|
||||
import SearchInput from "../../Base/Inputs/SearchInput"
|
||||
import Logo from "$/uwil/Logo";
|
||||
import SocialNetworks from "$/uwil/SocialNetworks";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { FrontNavLinkProps } from "@/types/front";
|
||||
import SearchInput from "../../Base/Inputs/SearchInput";
|
||||
|
||||
const DesktopNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
||||
function ListItem({
|
||||
title,
|
||||
href,
|
||||
...props
|
||||
}: React.ComponentPropsWithoutRef<"li"> & { href: string }) {
|
||||
return (
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
<li {...props}>
|
||||
<NavigationMenuLink asChild>
|
||||
<Link href={href}>
|
||||
<div className="flex flex-col gap-1 text-sm py-1.5">
|
||||
<div className="leading-none font-medium">{title}</div>
|
||||
</div>
|
||||
</Link>
|
||||
</NavigationMenuLink>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default function DesktopNav({
|
||||
navLinks,
|
||||
}: {
|
||||
navLinks: FrontNavLinkProps[];
|
||||
}) {
|
||||
return (
|
||||
<div className="hidden lg:block">
|
||||
<div className="flex items-center justify-between my-3 pr-3">
|
||||
|
|
@ -34,53 +57,41 @@ const DesktopNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
if (link.children) {
|
||||
return (
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuTrigger className="text-md font-bold uppercase">{link.title}</NavigationMenuTrigger>
|
||||
<NavigationMenuTrigger className="text-md font-bold uppercase">
|
||||
{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} />
|
||||
)
|
||||
<ListItem
|
||||
href={child.href ?? ""}
|
||||
title={child.title}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuLink asChild className={cn(navigationMenuTriggerStyle(), "text-md font-bold")}>
|
||||
<Link href={link.href}>{link.title}</Link>
|
||||
</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
)
|
||||
);
|
||||
}
|
||||
return (
|
||||
<NavigationMenuItem>
|
||||
<NavigationMenuLink
|
||||
asChild
|
||||
className={cn(
|
||||
navigationMenuTriggerStyle(),
|
||||
"text-md font-bold",
|
||||
)}
|
||||
>
|
||||
<Link href={link.href}>{link.title}</Link>
|
||||
</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
);
|
||||
})}
|
||||
</NavigationMenuList>
|
||||
</NavigationMenu>
|
||||
</nav>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default DesktopNav;
|
||||
|
||||
function ListItem({
|
||||
title,
|
||||
href,
|
||||
...props
|
||||
}: React.ComponentPropsWithoutRef<"li"> & { href: string }) {
|
||||
return (
|
||||
<li {...props}>
|
||||
<NavigationMenuLink asChild>
|
||||
<Link href={href}>
|
||||
<div className="flex flex-col gap-1 text-sm py-1.5">
|
||||
<div className="leading-none font-medium">{title}</div>
|
||||
</div>
|
||||
</Link>
|
||||
</NavigationMenuLink>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,12 @@ import { Button } from "@/components/ui/button";
|
|||
import { Link } from "@inertiajs/react";
|
||||
import { Search } from "lucide-react";
|
||||
|
||||
const GoToSearchPage = () => {
|
||||
export default function GoToSearchPage() {
|
||||
return (
|
||||
<Button variant={"ghost"} className="cursor-pointor [&_svg]:size-7" asChild>
|
||||
<Link href={"#FIXME"}><Search /></Link>
|
||||
<Button variant="ghost" className="cursor-pointor [&_svg]:size-7" asChild>
|
||||
<Link href="#FIXME">
|
||||
<Search />
|
||||
</Link>
|
||||
</Button>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default GoToSearchPage;
|
||||
|
|
|
|||
|
|
@ -5,15 +5,8 @@ import DesktopNav from "$/uwil/Header/DesktopNav";
|
|||
import { route } from "ziggy-js";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
|
||||
|
||||
|
||||
const Header = () => {
|
||||
|
||||
const commitmentLinks = [
|
||||
"gamme",
|
||||
"made-in-france",
|
||||
"expertise"
|
||||
]
|
||||
export default function Header() {
|
||||
const commitmentLinks = ["gamme", "made-in-france", "expertise"];
|
||||
|
||||
const navLinks: FrontNavLinkProps[] = [
|
||||
{
|
||||
|
|
@ -22,9 +15,9 @@ const Header = () => {
|
|||
children: commitmentLinks.map((com) => {
|
||||
return {
|
||||
title: GetTranslation(`front.${com}`),
|
||||
href: route(`front.${com}`)
|
||||
}
|
||||
})
|
||||
href: route(`front.${com}`),
|
||||
};
|
||||
}),
|
||||
},
|
||||
{
|
||||
title: "Recettes",
|
||||
|
|
@ -36,20 +29,18 @@ const Header = () => {
|
|||
},
|
||||
{
|
||||
title: "Nous contacter",
|
||||
href: route('front.contact-us')
|
||||
href: route("front.contact-us"),
|
||||
},
|
||||
{
|
||||
title: "Nous rejoindre",
|
||||
href: ""
|
||||
href: "",
|
||||
},
|
||||
|
||||
]
|
||||
];
|
||||
|
||||
return (
|
||||
<header className="bg-background w-full md:container md:mx-auto px-4 md:px-5 lg:pb-5">
|
||||
<DesktopNav navLinks={navLinks}/>
|
||||
<DesktopNav navLinks={navLinks} />
|
||||
<MobileNav navLinks={navLinks} />
|
||||
</header>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default Header;
|
||||
|
|
|
|||
|
|
@ -19,12 +19,17 @@ import {
|
|||
import Logo from "$/uwil/Logo";
|
||||
import SocialNetworks from "$/uwil/SocialNetworks";
|
||||
|
||||
const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
||||
export default function MobileNav({
|
||||
navLinks,
|
||||
}: {
|
||||
navLinks: FrontNavLinkProps[];
|
||||
}) {
|
||||
const [activeMenu, setActiveMenu] = useState<FrontNavLinkProps | null>(null);
|
||||
const goBack = () => setActiveMenu(null);
|
||||
const headerClasses = "h-[65px] flex flex-row items-center justify-between relative"
|
||||
const headerClasses =
|
||||
"h-[65px] flex flex-row items-center justify-between relative";
|
||||
return (
|
||||
<div className={cn('lg:hidden', headerClasses)}>
|
||||
<div className={cn("lg:hidden", headerClasses)}>
|
||||
<GoToSearchPage />
|
||||
<Sheet>
|
||||
<SheetTrigger asChild>
|
||||
|
|
@ -42,7 +47,11 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
<Logo className="block w-[38px] h-auto" />
|
||||
<div className="flex items-center gap-1">
|
||||
<GoToSearchPage />
|
||||
<Button variant={"ghost"} className="cursor-pointor [&_svg]:size-7" asChild>
|
||||
<Button
|
||||
variant="ghost"
|
||||
className="cursor-pointor [&_svg]:size-7"
|
||||
asChild
|
||||
>
|
||||
<SheetPrimitive.Close className="ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
||||
<X />
|
||||
<span className="sr-only">Close</span>
|
||||
|
|
@ -56,7 +65,7 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
<div
|
||||
className={cn(
|
||||
"absolute inset-0 flex flex-col gap-6 transition-transform duration-300",
|
||||
activeMenu ? "-translate-x-full" : "translate-x-0"
|
||||
activeMenu ? "-translate-x-full" : "translate-x-0",
|
||||
)}
|
||||
>
|
||||
{!activeMenu &&
|
||||
|
|
@ -87,12 +96,13 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
<div
|
||||
className={cn(
|
||||
"absolute inset-0 transition-transform duration-300",
|
||||
activeMenu ? "translate-x-0" : "translate-x-full"
|
||||
activeMenu ? "translate-x-0" : "translate-x-full",
|
||||
)}
|
||||
>
|
||||
{activeMenu && (
|
||||
<div className="flex flex-col items-start justify-start gap-8">
|
||||
<Button onClick={goBack}
|
||||
<Button
|
||||
onClick={goBack}
|
||||
type="button"
|
||||
variant="link"
|
||||
className="h-fit p-0 text-xl font-bold flex items-center text-primary-foreground"
|
||||
|
|
@ -117,15 +127,12 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<SheetFooter className="absolute bottom-0 left-0 right-0 h-16 bg-primary" />
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
|
||||
<Logo className="translate-y-1/2 absolute bottom-0 left-1/2 -translate-x-1/2 w-[79px] h-auto z-10" />
|
||||
</div >
|
||||
)
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default MobileNav;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import Image from "$/uwil/Image"
|
||||
import Image from "$/uwil/Image";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ImageProps, TextProps } from "@/types/front"
|
||||
import { ImageProps, TextProps } from "@/types/front";
|
||||
|
||||
type HeroImageProps = {
|
||||
image: ImageProps;
|
||||
title: TextProps;
|
||||
description: TextProps;
|
||||
}
|
||||
};
|
||||
|
||||
const HeroImage = (props: HeroImageProps) => {
|
||||
export default function HeroImage(props: HeroImageProps) {
|
||||
const { image, title, description } = props;
|
||||
return (
|
||||
<section className="relative">
|
||||
|
|
@ -18,19 +18,13 @@ const HeroImage = (props: HeroImageProps) => {
|
|||
image={{
|
||||
src: image.src,
|
||||
alt: image.alt,
|
||||
title: image.title
|
||||
title: image.title,
|
||||
}}
|
||||
/>
|
||||
<div className="bg-background rounded-l-3xl z-1 absolute bottom-0 -translate-y-[75px] right-0 w-[85%] md:w-[55%] p-10">
|
||||
<p className={cn("font-bold text-3xl", title.font)}>
|
||||
{title.text}
|
||||
</p>
|
||||
<p className={cn("mt-4", description.font)}>
|
||||
{description.text}
|
||||
</p>
|
||||
<p className={cn("font-bold text-3xl", title.font)}>{title.text}</p>
|
||||
<p className={cn("mt-4", description.font)}>{description.text}</p>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default HeroImage;
|
||||
|
|
|
|||
|
|
@ -3,55 +3,68 @@ import Button from "./Button";
|
|||
import { fonts } from "@/front/lib/constants";
|
||||
import { ImageProps } from "@/types/front";
|
||||
|
||||
type ImageAction = {
|
||||
label: string;
|
||||
href: string;
|
||||
};
|
||||
|
||||
type ThemeImageProps = {
|
||||
shape?: "square" | "rounded";
|
||||
image: ImageProps;
|
||||
size?: string;
|
||||
action?: ImageAction
|
||||
}
|
||||
action?: ImageAction;
|
||||
};
|
||||
|
||||
type ImageAction = {
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
|
||||
const Image = ({
|
||||
export default function Image({
|
||||
shape = "rounded",
|
||||
image,
|
||||
action,
|
||||
size = "w-32 h-32",
|
||||
}: ThemeImageProps) => {
|
||||
|
||||
}: ThemeImageProps) {
|
||||
const customShape = shape === "square" ? "rounded-none" : "rounded-full";
|
||||
const lazyload = image.lazyload ? "lazy" : "eager"
|
||||
const lazyload = image.lazyload ? "lazy" : "eager";
|
||||
return (
|
||||
<div className={cn(size, customShape, "relative z-1 overflow-hidden group flex justify-center items-center")}>
|
||||
<img loading={lazyload} className={cn("object-cover", customShape, size)} src={image.src} alt={image.alt} title={image?.title ?? image.alt} srcSet={image.src} />
|
||||
<div
|
||||
className={cn(
|
||||
size,
|
||||
customShape,
|
||||
"relative z-1 overflow-hidden group flex justify-center items-center",
|
||||
)}
|
||||
>
|
||||
<img
|
||||
loading={lazyload}
|
||||
className={cn("object-cover", customShape, size)}
|
||||
src={image.src}
|
||||
alt={image.alt}
|
||||
title={image?.title ?? image.alt}
|
||||
srcSet={image.src}
|
||||
/>
|
||||
{action && (
|
||||
<>
|
||||
<div
|
||||
className={cn(
|
||||
"absolute inset-0 bg-black opacity-0 transition-opacity duration-300",
|
||||
"group-hover:opacity-30"
|
||||
"group-hover:opacity-30",
|
||||
)}
|
||||
/>
|
||||
<div
|
||||
className={cn(
|
||||
"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity duration-300",
|
||||
"group-hover:opacity-100"
|
||||
"group-hover:opacity-100",
|
||||
)}
|
||||
>
|
||||
<Button size="xs" font={fonts.DELIUS_SWASH} isBold={false}
|
||||
<Button
|
||||
size="xs"
|
||||
font={fonts.DELIUS_SWASH}
|
||||
isBold={false}
|
||||
link={{
|
||||
label: action.label,
|
||||
href: action.href
|
||||
href: action.href,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default Image;
|
||||
|
|
|
|||
|
|
@ -12,11 +12,10 @@ import {
|
|||
DrawerHeader,
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from "@/components/ui/drawer"
|
||||
} from "@/components/ui/drawer";
|
||||
|
||||
type FiltersState = Record<string, string[]>;
|
||||
|
||||
|
||||
export default function Filters() {
|
||||
const { isMobile } = useDeviceType();
|
||||
const [filters, setFilters] = useState<FiltersState>({
|
||||
|
|
@ -27,7 +26,7 @@ export default function Filters() {
|
|||
values.map((value) => ({
|
||||
key,
|
||||
value,
|
||||
}))
|
||||
})),
|
||||
);
|
||||
const handleFilterChange = (key: string, values: string[]) => {
|
||||
setFilters((prev) => ({
|
||||
|
|
@ -41,13 +40,14 @@ export default function Filters() {
|
|||
[key]: prev[key].filter((v) => v !== value),
|
||||
}));
|
||||
};
|
||||
|
||||
const clearAllFilters = () => {
|
||||
setFilters((prev) => {
|
||||
const cleared: typeof prev = {};
|
||||
|
||||
for (const key in prev) {
|
||||
cleared[key] = [];
|
||||
}
|
||||
Object.keys(prev).forEach((key) => {
|
||||
cleared[key as keyof typeof prev] = [];
|
||||
});
|
||||
|
||||
return cleared;
|
||||
});
|
||||
|
|
@ -63,7 +63,7 @@ export default function Filters() {
|
|||
<DrawerDescription>
|
||||
<div className="space-y-4">
|
||||
<FilterDropdown
|
||||
key={"tech"}
|
||||
key="tech"
|
||||
value={filters.tech}
|
||||
label="Technologie"
|
||||
onChange={(values) => handleFilterChange("tech", values)}
|
||||
|
|
@ -72,7 +72,7 @@ export default function Filters() {
|
|||
{ id: "ambiant", label: "Ambiant" },
|
||||
{ id: "surgele", label: "Surgelé" },
|
||||
]}
|
||||
openOnHover={true}
|
||||
openOnHover
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
<FilterDropdown
|
||||
|
|
@ -84,7 +84,7 @@ export default function Filters() {
|
|||
{ id: "oeufs-durs", label: "Oeufs durs" },
|
||||
]}
|
||||
value={filters.category}
|
||||
openOnHover={true}
|
||||
openOnHover
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -92,8 +92,8 @@ export default function Filters() {
|
|||
</DrawerHeader>
|
||||
<DrawerFooter className="block max-w-2xl mx-auto space-y-3">
|
||||
<Button
|
||||
onClick={clearAllFilters}
|
||||
variant={"tertiary"}
|
||||
onClick={() => {}}
|
||||
variant="tertiary"
|
||||
className="uppercase w-full !h-10"
|
||||
>
|
||||
Appliquer
|
||||
|
|
@ -102,7 +102,7 @@ export default function Filters() {
|
|||
<Button
|
||||
className="uppercase w-full !h-10"
|
||||
onClick={clearAllFilters}
|
||||
variant={"default"}
|
||||
variant="default"
|
||||
>
|
||||
Effacer la sélection
|
||||
</Button>
|
||||
|
|
@ -110,14 +110,14 @@ export default function Filters() {
|
|||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center gap-4">
|
||||
<FilterDropdown
|
||||
key={"tech"}
|
||||
key="tech"
|
||||
value={filters.tech}
|
||||
label="Technologie"
|
||||
onChange={(values) => handleFilterChange("tech", values)}
|
||||
|
|
@ -126,7 +126,7 @@ export default function Filters() {
|
|||
{ id: "ambiant", label: "Ambiant" },
|
||||
{ id: "surgele", label: "Surgelé" },
|
||||
]}
|
||||
openOnHover={true}
|
||||
openOnHover
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
<FilterDropdown
|
||||
|
|
@ -138,7 +138,7 @@ export default function Filters() {
|
|||
{ id: "oeufs-durs", label: "Oeufs durs" },
|
||||
]}
|
||||
value={filters.category}
|
||||
openOnHover={true}
|
||||
openOnHover
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -148,12 +148,12 @@ export default function Filters() {
|
|||
<Button
|
||||
key={`${key}-${value}`}
|
||||
onClick={() => removeFilter(key, value)}
|
||||
variant={"tertiary"}
|
||||
variant="tertiary"
|
||||
className={simpleWeights.NORMAL}
|
||||
font={fonts.DELIUS_SWASH}
|
||||
icon={{
|
||||
icon: "x",
|
||||
placement: "left"
|
||||
placement: "left",
|
||||
}}
|
||||
>
|
||||
{value}
|
||||
|
|
@ -162,6 +162,7 @@ export default function Filters() {
|
|||
</div>
|
||||
<div className="flex justify-start">
|
||||
<button
|
||||
type="button"
|
||||
onClick={clearAllFilters}
|
||||
className="px-4 py-2 bg-secondary text-primary-foreground rounded w-fit"
|
||||
>
|
||||
|
|
@ -169,5 +170,5 @@ export default function Filters() {
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,17 @@ import { bgColors, fonts, simpleWeights } from "@/front/lib/constants";
|
|||
import { cn } from "@/lib/utils";
|
||||
import { ThemeItemCardProps } from "@/types/front";
|
||||
|
||||
const ItemCard = ({
|
||||
export default function ItemCard({
|
||||
button,
|
||||
title,
|
||||
image,
|
||||
description,
|
||||
variant,
|
||||
size,
|
||||
subtitle
|
||||
}: ThemeItemCardProps) => {
|
||||
|
||||
const width = (size && size.width) ? size.width : "w-[97%] md:w-72 lg:w-72";
|
||||
const height = (size && size.height) ? size.height : "aspect-square";
|
||||
subtitle,
|
||||
}: ThemeItemCardProps) {
|
||||
const width = size && size.width ? size.width : "w-[97%] md:w-72 lg:w-72";
|
||||
const height = size && size.height ? size.height : "aspect-square";
|
||||
|
||||
const titleFont = title?.font ?? fonts.DELIUS_SWASH;
|
||||
const titleWeight = title?.weight ?? simpleWeights.NORMAL;
|
||||
|
|
@ -26,7 +25,9 @@ const ItemCard = ({
|
|||
const btnVariant = variant === bgColors.PRIMARY ? "inverted" : "default";
|
||||
|
||||
return (
|
||||
<div className={`flex flex-col items-center justify-center ${width} inline-block`}>
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center ${width} inline-block`}
|
||||
>
|
||||
<Image
|
||||
size={`${width} ${height}`}
|
||||
image={image}
|
||||
|
|
@ -34,45 +35,54 @@ const ItemCard = ({
|
|||
action={
|
||||
button
|
||||
? {
|
||||
href: button.href,
|
||||
label: button.label,
|
||||
}
|
||||
href: button.href,
|
||||
label: button.label,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="w-full mt-6 text-center px-10 md:px-0">
|
||||
{title?.text && (
|
||||
<h4 className={cn('text-xl md:text-3xl', titleFont, titleWeight)}>
|
||||
<h4 className={cn("text-xl md:text-3xl", titleFont, titleWeight)}>
|
||||
{title.text}
|
||||
</h4>
|
||||
)}
|
||||
{subtitle?.text && (
|
||||
<h5 className={cn("text-2xl", subtitle?.font ?? fonts.DELIUS_SWASH, subtitle?.weight ?? "font-normal")}>{subtitle.text}</h5>
|
||||
<h5
|
||||
className={cn(
|
||||
"text-2xl",
|
||||
subtitle?.font ?? fonts.DELIUS_SWASH,
|
||||
subtitle?.weight ?? "font-normal",
|
||||
)}
|
||||
>
|
||||
{subtitle.text}
|
||||
</h5>
|
||||
)}
|
||||
{description?.text && (
|
||||
<p dangerouslySetInnerHTML={{
|
||||
__html: description.text
|
||||
}} className={cn(descriptionFont, descriptionWeight, "pt-4")} />
|
||||
<p
|
||||
// eslint-disable-next-line react/no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: description.text,
|
||||
}}
|
||||
className={cn(descriptionFont, descriptionWeight, "pt-4")}
|
||||
/>
|
||||
)}
|
||||
{button?.href && button?.label && (
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: "right"
|
||||
placement: "right",
|
||||
}}
|
||||
className="mt-5"
|
||||
link={{
|
||||
href: button.href,
|
||||
label: button.label
|
||||
label: button.label,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ItemCard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
const ListSectionTitle = () => {
|
||||
export default function ListSectionTitle() {
|
||||
return (
|
||||
<div className="flex items-center justify-start gap-20 mb-6">
|
||||
<h3 className={cn('text-5xl font-bold')}>Recettes</h3>
|
||||
<h3 className={cn("text-5xl font-bold")}>Recettes</h3>
|
||||
<p className=" opacity-[60%] text-2xl">(12/150)</p>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default ListSectionTitle;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,17 @@ import { Link } from "@inertiajs/react";
|
|||
|
||||
type Props = {
|
||||
className?: string;
|
||||
}
|
||||
const Logo = (props: Props) => {
|
||||
};
|
||||
export default function Logo(props: Props) {
|
||||
const { className } = props;
|
||||
return (
|
||||
<Link href={"/"} className={className}><img className="w-full h-auto" src="/assets/img/logo.svg" alt="Logo Ovoteam" title="Logo Ovoteam" /></Link>
|
||||
)
|
||||
<Link href="/" className={className}>
|
||||
<img
|
||||
className="w-full h-auto"
|
||||
src="/assets/img/logo.svg"
|
||||
alt="Logo Ovoteam"
|
||||
title="Logo Ovoteam"
|
||||
/>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
export default Logo;
|
||||
|
|
|
|||
|
|
@ -1,56 +1,62 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
type RowType = {
|
||||
label?: string;
|
||||
value: string;
|
||||
subRow?: RowType;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
rows: Row[];
|
||||
rows: RowType[];
|
||||
/** On which value is based all the values
|
||||
* @example "Pour 100g"
|
||||
*/
|
||||
baseValue: string;
|
||||
}
|
||||
};
|
||||
|
||||
type Row = {
|
||||
label?: string;
|
||||
value: string;
|
||||
subRow?: Row;
|
||||
function Row({ row, index }: { row: RowType; index?: number }) {
|
||||
const isEven = index !== undefined && index % 2 === 0;
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={cn(
|
||||
"col-span-9 text-start pl-3 py-4",
|
||||
isEven && "bg-primary-foreground text-primary",
|
||||
)}
|
||||
>
|
||||
<div className="font-bold">{row.label}</div>
|
||||
{row.subRow && <div>{row.subRow?.label ?? ""}</div>}
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
"col-span-3 text-end pr-3 py-4",
|
||||
isEven && "bg-primary-foreground text-primary",
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
<div className="font-bold">{row.value}</div>
|
||||
{row.subRow && <div>{row.subRow?.value ?? ""}</div>}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default function NutritionalValueList({ rows, baseValue }: Props) {
|
||||
return (
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<Row row={{
|
||||
value: baseValue
|
||||
}} />
|
||||
<Row
|
||||
row={{
|
||||
value: baseValue,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="grid grid-cols-12">
|
||||
{rows.map((row, index) => {
|
||||
return (
|
||||
<Row row={row} index={index} />
|
||||
)
|
||||
return <Row row={row} index={index} />;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const Row = ({ row, index }: { row: Row, index?: number }) => {
|
||||
const isEven = index !== undefined && index % 2 === 0;
|
||||
return (
|
||||
<>
|
||||
<div className={cn("col-span-9 text-start pl-3 py-4", isEven && "bg-primary-foreground text-primary")}>
|
||||
<div className="font-bold">{row.label}</div>
|
||||
{row.subRow && (
|
||||
<div>{row.subRow?.label ?? ""}</div>
|
||||
)}
|
||||
</div>
|
||||
<div className={cn("col-span-3 text-end pr-3 py-4", isEven && "bg-primary-foreground text-primary")}>
|
||||
<div>
|
||||
<div className="font-bold">{row.value}</div>
|
||||
{row.subRow && (
|
||||
<div>{row.subRow?.value ?? ""}</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,26 @@
|
|||
import Breadcrumbs from "$/uwil/Breadcrumbs"
|
||||
import Breadcrumbs from "$/uwil/Breadcrumbs";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { TextProps } from "@/types/front"
|
||||
import { TextProps } from "@/types/front";
|
||||
import Section from "$/uwil/Section";
|
||||
import { bgColors } from "@/front/lib/constants";
|
||||
|
||||
type PageHeaderProps = {
|
||||
title: TextProps;
|
||||
description: TextProps;
|
||||
}
|
||||
const PageHeader = (props: PageHeaderProps) => {
|
||||
};
|
||||
export default function PageHeader(props: PageHeaderProps) {
|
||||
const { title, description } = props;
|
||||
return (
|
||||
<Section variant={bgColors.PRIMARY} className="text-start" containerClassName="space-y-0 md:px-4">
|
||||
<Section
|
||||
variant={bgColors.PRIMARY}
|
||||
className="text-start"
|
||||
containerClassName="space-y-0 md:px-4"
|
||||
>
|
||||
<Breadcrumbs />
|
||||
<h1 className={cn("uppercase text-4xl font-bold mt-4", title.font)}>{title.text}</h1>
|
||||
<h1 className={cn("uppercase text-4xl font-bold mt-4", title.font)}>
|
||||
{title.text}
|
||||
</h1>
|
||||
<p className={cn("mt-4", description.font)}>{description.text}</p>
|
||||
</Section>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default PageHeader;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
import { BgColorName, bgColors, sidePlacements, VerticalPlacementName, verticalPlacements } from "../../lib/constants";
|
||||
import {
|
||||
BgColorName,
|
||||
bgColors,
|
||||
sidePlacements,
|
||||
VerticalPlacementName,
|
||||
verticalPlacements,
|
||||
} from "../../lib/constants";
|
||||
import { ButtonProps, IconConfig, TextProps } from "@/types/front";
|
||||
import { forwardRef, ReactNode } from "react";
|
||||
import Container from "./Container";
|
||||
|
|
@ -9,8 +15,8 @@ import { Link } from "@inertiajs/react";
|
|||
export type ButtonSectionProps = ButtonProps & {
|
||||
/** Button vertical placement (top or bottom). Default: bottom */
|
||||
placement?: VerticalPlacementName;
|
||||
icon?: IconConfig
|
||||
}
|
||||
icon?: IconConfig;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
variant?: BgColorName;
|
||||
|
|
@ -21,12 +27,21 @@ type Props = {
|
|||
className?: string;
|
||||
containerClassName?: string;
|
||||
button?: ButtonSectionProps;
|
||||
|
||||
}
|
||||
};
|
||||
const Section = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
||||
const { variant = bgColors.BACKGROUND, title, subtitle, description, children, className, button, containerClassName } = props;
|
||||
const {
|
||||
variant = bgColors.BACKGROUND,
|
||||
title,
|
||||
subtitle,
|
||||
description,
|
||||
children,
|
||||
className,
|
||||
button,
|
||||
containerClassName,
|
||||
} = props;
|
||||
const btnVariant = variant === bgColors.BACKGROUND ? "default" : "inverted";
|
||||
const btnPlacement = (button && button.placement) ?? verticalPlacements.BOTTOM;
|
||||
const btnPlacement =
|
||||
(button && button.placement) ?? verticalPlacements.BOTTOM;
|
||||
return (
|
||||
<section ref={ref} className={cn(variant, "text-center py-20", className)}>
|
||||
<Container className={cn(containerClassName)}>
|
||||
|
|
@ -34,33 +49,66 @@ const Section = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|||
<div className="mb-5">
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
placement: button.icon.placement ?? sidePlacements.RIGHT,
|
||||
},
|
||||
})}
|
||||
asChild><Link href={button.href}>{button.label}</Link></Button>
|
||||
asChild
|
||||
>
|
||||
<Link href={button.href}>{button.label}</Link>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{(title || subtitle || description) && (
|
||||
<Container className={cn("space-y-5 mb-12")}>
|
||||
{title && <h2 className={cn("text-5xl max-w-5xl mx-auto uppercase", title.font, title.weight ?? "font-bold")}>{title.text}</h2>}
|
||||
{subtitle && <h3 className={cn("text-3xl mx-auto max-w-2xl uppercase", subtitle.font, subtitle.weight ?? "font-bold")}>{subtitle.text}</h3>}
|
||||
{description && <p className={cn("mx-auto max-w-3xl", description.font, description.weight ?? "font-normal")}>{description.text}</p>}
|
||||
{title && (
|
||||
<h2
|
||||
className={cn(
|
||||
"text-5xl max-w-5xl mx-auto uppercase",
|
||||
title.font,
|
||||
title.weight ?? "font-bold",
|
||||
)}
|
||||
>
|
||||
{title.text}
|
||||
</h2>
|
||||
)}
|
||||
{subtitle && (
|
||||
<h3
|
||||
className={cn(
|
||||
"text-3xl mx-auto max-w-2xl uppercase",
|
||||
subtitle.font,
|
||||
subtitle.weight ?? "font-bold",
|
||||
)}
|
||||
>
|
||||
{subtitle.text}
|
||||
</h3>
|
||||
)}
|
||||
{description && (
|
||||
<p
|
||||
className={cn(
|
||||
"mx-auto max-w-3xl",
|
||||
description.font,
|
||||
description.weight ?? "font-normal",
|
||||
)}
|
||||
>
|
||||
{description.text}
|
||||
</p>
|
||||
)}
|
||||
</Container>
|
||||
)}
|
||||
<div>
|
||||
{children}
|
||||
</div>
|
||||
<div>{children}</div>
|
||||
{btnPlacement === verticalPlacements.BOTTOM && button && (
|
||||
<div className="mt-5">
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
link={{
|
||||
href: button.href,
|
||||
label: button.label
|
||||
label: button.label,
|
||||
}}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
|
|
@ -72,6 +120,6 @@ const Section = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|||
)}
|
||||
</Container>
|
||||
</section>
|
||||
)
|
||||
})
|
||||
);
|
||||
});
|
||||
export default Section;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/** THEME */
|
||||
import { CarouselProps, TextProps } from "@/types/front";
|
||||
import Section, { ButtonSectionProps } from "$/uwil/Section"
|
||||
import Section, { ButtonSectionProps } from "$/uwil/Section";
|
||||
import { BgColorName } from "@/front/lib/constants";
|
||||
import Carousel from "$/base/Carousel/Carousel";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
|
@ -12,7 +12,7 @@ type CarouselSectionProps = CarouselProps & {
|
|||
variant?: BgColorName;
|
||||
button?: ButtonSectionProps;
|
||||
sectionClassName?: string;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* CarouselSection
|
||||
|
|
@ -50,88 +50,177 @@ type CarouselSectionProps = CarouselProps & {
|
|||
* carousel={{ slidesPerView: 1 }}
|
||||
* />
|
||||
*/
|
||||
const CarouselSection = (props: CarouselSectionProps) => {
|
||||
const { title, subtitle, description, variant, button, items, carousel, sectionClassName } = props;
|
||||
export default function CarouselSection(props: CarouselSectionProps) {
|
||||
const {
|
||||
title,
|
||||
subtitle,
|
||||
description,
|
||||
variant,
|
||||
button,
|
||||
items,
|
||||
carousel,
|
||||
sectionClassName,
|
||||
} = props;
|
||||
const buttonProps = button
|
||||
? {
|
||||
button: {
|
||||
href: button.href,
|
||||
label: button.label,
|
||||
...(button.icon
|
||||
? {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
}
|
||||
button: {
|
||||
href: button.href,
|
||||
label: button.label,
|
||||
...(button.icon
|
||||
? {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
}
|
||||
: {};
|
||||
return (
|
||||
<Section
|
||||
className={cn(sectionClassName)}
|
||||
containerClassName="px-0"
|
||||
variant={variant}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(title && {
|
||||
title: {
|
||||
text: title.text,
|
||||
font: title.font,
|
||||
weight: title.weight
|
||||
}
|
||||
weight: title.weight,
|
||||
},
|
||||
})}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(description && {
|
||||
description: {
|
||||
text: description.text,
|
||||
font: description.font,
|
||||
weight: description.weight
|
||||
}
|
||||
weight: description.weight,
|
||||
},
|
||||
})}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(subtitle && {
|
||||
subtitle: {
|
||||
text: subtitle.text,
|
||||
font: subtitle.font,
|
||||
weight: subtitle.weight
|
||||
}
|
||||
weight: subtitle.weight,
|
||||
},
|
||||
})}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...buttonProps}
|
||||
>
|
||||
<Carousel
|
||||
prevBtn={
|
||||
<svg width="55" height="67" viewBox="0 0 55 67" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
width="55"
|
||||
height="67"
|
||||
viewBox="0 0 55 67"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g filter="url(#filter0_d_7429_6669)">
|
||||
<path className="stroke-primary-foreground" d="M27.5 1.5C33.1912 1.5 38.674 6.01701 42.8438 12.7158C46.971 19.3463 49.5 27.6486 49.5 34.291C49.4998 47.448 39.5909 57.5 27.5 57.5C15.4091 57.5 5.50021 47.448 5.5 34.291C5.5 27.6486 8.029 19.3463 12.1562 12.7158C16.326 6.01701 21.8088 1.5 27.5 1.5Z" stroke-width="3" />
|
||||
<path className="fill-primary-foreground" d="M25.5072 21.7103L16.9811 30.6752C16.8259 30.8457 16.7042 31.0468 16.623 31.2669C16.4525 31.7034 16.4525 32.193 16.623 32.6295C16.7042 32.8496 16.8259 33.0507 16.9811 33.2212L25.5072 42.1861C25.6662 42.3533 25.8549 42.4859 26.0627 42.5763C26.2704 42.6668 26.4931 42.7134 26.7179 42.7134C27.172 42.7134 27.6075 42.5237 27.9286 42.1861C28.2497 41.8485 28.4301 41.3905 28.4301 40.9131C28.4301 40.4356 28.2497 39.9777 27.9286 39.6401L22.3014 33.7412L35.244 33.7412C35.6962 33.7412 36.13 33.5523 36.4498 33.216C36.7695 32.8798 36.9492 32.4237 36.9492 31.9482C36.9492 31.4727 36.7695 31.0166 36.4498 30.6804C36.13 30.3441 35.6962 30.1552 35.244 30.1552L22.3014 30.1552L27.9286 24.2564C28.0884 24.0897 28.2153 23.8914 28.3019 23.6729C28.3884 23.4544 28.433 23.22 28.433 22.9833C28.433 22.7467 28.3884 22.5123 28.3019 22.2938C28.2153 22.0753 28.0884 21.877 27.9286 21.7103C27.7701 21.5423 27.5815 21.4089 27.3737 21.3179C27.1659 21.2268 26.943 21.18 26.7179 21.18C26.4928 21.18 26.2699 21.2268 26.0621 21.3179C25.8543 21.4089 25.6657 21.5423 25.5072 21.7103Z" />
|
||||
<path
|
||||
className="stroke-primary-foreground"
|
||||
d="M27.5 1.5C33.1912 1.5 38.674 6.01701 42.8438 12.7158C46.971 19.3463 49.5 27.6486 49.5 34.291C49.4998 47.448 39.5909 57.5 27.5 57.5C15.4091 57.5 5.50021 47.448 5.5 34.291C5.5 27.6486 8.029 19.3463 12.1562 12.7158C16.326 6.01701 21.8088 1.5 27.5 1.5Z"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<path
|
||||
className="fill-primary-foreground"
|
||||
d="M25.5072 21.7103L16.9811 30.6752C16.8259 30.8457 16.7042 31.0468 16.623 31.2669C16.4525 31.7034 16.4525 32.193 16.623 32.6295C16.7042 32.8496 16.8259 33.0507 16.9811 33.2212L25.5072 42.1861C25.6662 42.3533 25.8549 42.4859 26.0627 42.5763C26.2704 42.6668 26.4931 42.7134 26.7179 42.7134C27.172 42.7134 27.6075 42.5237 27.9286 42.1861C28.2497 41.8485 28.4301 41.3905 28.4301 40.9131C28.4301 40.4356 28.2497 39.9777 27.9286 39.6401L22.3014 33.7412L35.244 33.7412C35.6962 33.7412 36.13 33.5523 36.4498 33.216C36.7695 32.8798 36.9492 32.4237 36.9492 31.9482C36.9492 31.4727 36.7695 31.0166 36.4498 30.6804C36.13 30.3441 35.6962 30.1552 35.244 30.1552L22.3014 30.1552L27.9286 24.2564C28.0884 24.0897 28.2153 23.8914 28.3019 23.6729C28.3884 23.4544 28.433 23.22 28.433 22.9833C28.433 22.7467 28.3884 22.5123 28.3019 22.2938C28.2153 22.0753 28.0884 21.877 27.9286 21.7103C27.7701 21.5423 27.5815 21.4089 27.3737 21.3179C27.1659 21.2268 26.943 21.18 26.7179 21.18C26.4928 21.18 26.2699 21.2268 26.0621 21.3179C25.8543 21.4089 25.6657 21.5423 25.5072 21.7103Z"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_7429_6669" x="0" y="0" width="55" height="67" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
|
||||
<filter
|
||||
id="filter0_d_7429_6669"
|
||||
x="0"
|
||||
y="0"
|
||||
width="55"
|
||||
height="67"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset dy="4" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_7429_6669" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_7429_6669" result="shape" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_7429_6669"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_7429_6669"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
}
|
||||
nextBtn={
|
||||
<svg width="56" height="67" viewBox="0 0 56 67" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
width="56"
|
||||
height="67"
|
||||
viewBox="0 0 56 67"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g filter="url(#filter0_d_7429_6696)">
|
||||
<path className="stroke-primary-foreground" d="M28 1.5C33.8446 1.5 39.4518 6.03781 43.7051 12.7285C47.9196 19.3584 50.5 27.6561 50.5 34.291C50.4998 47.4178 40.3963 57.5 28 57.5C15.6037 57.5 5.50021 47.4178 5.5 34.291C5.5 27.6561 8.08039 19.3584 12.2949 12.7285C16.5482 6.03781 22.1554 1.5 28 1.5Z" stroke-width="3" />
|
||||
<path className="fill-primary-foreground" d="M28.4461 42.1832L37.1536 33.2184C37.3121 33.0478 37.4364 32.8468 37.5193 32.6267C37.6934 32.1902 37.6934 31.7005 37.5193 31.264C37.4364 31.0439 37.3121 30.8429 37.1536 30.6723L28.4461 21.7075C28.2837 21.5403 28.0909 21.4077 27.8788 21.3172C27.6666 21.2267 27.4392 21.1802 27.2096 21.1802C26.7458 21.1802 26.3011 21.3699 25.9731 21.7075C25.6452 22.0451 25.461 22.503 25.461 22.9805C25.461 23.458 25.6452 23.9159 25.9731 24.2535L31.7201 30.1524L18.5021 30.1524C18.0402 30.1524 17.5973 30.3413 17.2707 30.6775C16.9441 31.0138 16.7606 31.4698 16.7606 31.9453C16.7606 32.4209 16.9441 32.8769 17.2707 33.2132C17.5973 33.5494 18.0402 33.7383 18.5021 33.7383L31.7201 33.7383L25.9731 39.6372C25.8099 39.8039 25.6804 40.0022 25.5919 40.2207C25.5035 40.4392 25.458 40.6735 25.458 40.9102C25.458 41.1469 25.5035 41.3813 25.5919 41.5997C25.6804 41.8182 25.8099 42.0165 25.9731 42.1832C26.135 42.3513 26.3276 42.4847 26.5399 42.5757C26.7521 42.6667 26.9797 42.7136 27.2096 42.7136C27.4395 42.7136 27.6671 42.6667 27.8793 42.5757C28.0916 42.4847 28.2842 42.3513 28.4461 42.1832Z" />
|
||||
<path
|
||||
className="stroke-primary-foreground"
|
||||
d="M28 1.5C33.8446 1.5 39.4518 6.03781 43.7051 12.7285C47.9196 19.3584 50.5 27.6561 50.5 34.291C50.4998 47.4178 40.3963 57.5 28 57.5C15.6037 57.5 5.50021 47.4178 5.5 34.291C5.5 27.6561 8.08039 19.3584 12.2949 12.7285C16.5482 6.03781 22.1554 1.5 28 1.5Z"
|
||||
strokeWidth="3"
|
||||
/>
|
||||
<path
|
||||
className="fill-primary-foreground"
|
||||
d="M28.4461 42.1832L37.1536 33.2184C37.3121 33.0478 37.4364 32.8468 37.5193 32.6267C37.6934 32.1902 37.6934 31.7005 37.5193 31.264C37.4364 31.0439 37.3121 30.8429 37.1536 30.6723L28.4461 21.7075C28.2837 21.5403 28.0909 21.4077 27.8788 21.3172C27.6666 21.2267 27.4392 21.1802 27.2096 21.1802C26.7458 21.1802 26.3011 21.3699 25.9731 21.7075C25.6452 22.0451 25.461 22.503 25.461 22.9805C25.461 23.458 25.6452 23.9159 25.9731 24.2535L31.7201 30.1524L18.5021 30.1524C18.0402 30.1524 17.5973 30.3413 17.2707 30.6775C16.9441 31.0138 16.7606 31.4698 16.7606 31.9453C16.7606 32.4209 16.9441 32.8769 17.2707 33.2132C17.5973 33.5494 18.0402 33.7383 18.5021 33.7383L31.7201 33.7383L25.9731 39.6372C25.8099 39.8039 25.6804 40.0022 25.5919 40.2207C25.5035 40.4392 25.458 40.6735 25.458 40.9102C25.458 41.1469 25.5035 41.3813 25.5919 41.5997C25.6804 41.8182 25.8099 42.0165 25.9731 42.1832C26.135 42.3513 26.3276 42.4847 26.5399 42.5757C26.7521 42.6667 26.9797 42.7136 27.2096 42.7136C27.4395 42.7136 27.6671 42.6667 27.8793 42.5757C28.0916 42.4847 28.2842 42.3513 28.4461 42.1832Z"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_7429_6696" x="0" y="0" width="56" height="67" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
|
||||
<filter
|
||||
id="filter0_d_7429_6696"
|
||||
x="0"
|
||||
y="0"
|
||||
width="56"
|
||||
height="67"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset dy="4" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_7429_6696" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_7429_6696" result="shape" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_7429_6696"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_7429_6696"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
|
@ -140,7 +229,6 @@ const CarouselSection = (props: CarouselSectionProps) => {
|
|||
carousel={carousel}
|
||||
variant={variant}
|
||||
/>
|
||||
</Section >
|
||||
)
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
export default CarouselSection;
|
||||
|
|
|
|||
|
|
@ -58,19 +58,27 @@ type TripleColSectionProps = {
|
|||
* />
|
||||
*/
|
||||
export default function TripleColSection(props: TripleColSectionProps) {
|
||||
const { title, cols, button, variant = bgColors.BACKGROUND, className } = props;
|
||||
const {
|
||||
title,
|
||||
cols,
|
||||
button,
|
||||
variant = bgColors.BACKGROUND,
|
||||
className,
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<Section
|
||||
className={cn("text-center", className)}
|
||||
variant={variant}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(title && {
|
||||
title: {
|
||||
text: title.text,
|
||||
font: title.font,
|
||||
weight: title.weight,
|
||||
}
|
||||
},
|
||||
})}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...(button && {
|
||||
button: {
|
||||
icon: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable */
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
|
|
@ -22,7 +23,7 @@ const SheetOverlay = React.forwardRef<
|
|||
<SheetPrimitive.Overlay
|
||||
className={cn(
|
||||
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
||||
className
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
ref={ref}
|
||||
|
|
@ -36,20 +37,23 @@ const sheetVariants = cva(
|
|||
variants: {
|
||||
side: {
|
||||
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
||||
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
||||
bottom:
|
||||
"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
||||
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
||||
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
||||
right:
|
||||
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
side: "right",
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
interface SheetContentProps
|
||||
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||
VariantProps<typeof sheetVariants> {
|
||||
extends
|
||||
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||
VariantProps<typeof sheetVariants> {
|
||||
showCloseButton?: boolean;
|
||||
showOverlay?: boolean;
|
||||
}
|
||||
|
|
@ -57,24 +61,36 @@ interface SheetContentProps
|
|||
const SheetContent = React.forwardRef<
|
||||
React.ElementRef<typeof SheetPrimitive.Content>,
|
||||
SheetContentProps
|
||||
>(({ side = "right", className, showCloseButton = true, showOverlay = true, children, ...props }, ref) => (
|
||||
<SheetPortal>
|
||||
{showOverlay && (<SheetOverlay />)}
|
||||
<SheetPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(sheetVariants({ side }), className)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
{showCloseButton && (
|
||||
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
||||
<X className="h-4 w-4" />
|
||||
<span className="sr-only">Close</span>
|
||||
</SheetPrimitive.Close>
|
||||
)}
|
||||
</SheetPrimitive.Content>
|
||||
</SheetPortal>
|
||||
));
|
||||
>(
|
||||
(
|
||||
{
|
||||
side = "right",
|
||||
className,
|
||||
showCloseButton = true,
|
||||
showOverlay = true,
|
||||
children,
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
) => (
|
||||
<SheetPortal>
|
||||
{showOverlay && <SheetOverlay />}
|
||||
<SheetPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(sheetVariants({ side }), className)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
{showCloseButton && (
|
||||
<SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary">
|
||||
<X className="h-4 w-4" />
|
||||
<span className="sr-only">Close</span>
|
||||
</SheetPrimitive.Close>
|
||||
)}
|
||||
</SheetPrimitive.Content>
|
||||
</SheetPortal>
|
||||
),
|
||||
);
|
||||
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
||||
|
||||
const SheetHeader = ({
|
||||
|
|
@ -84,7 +100,7 @@ const SheetHeader = ({
|
|||
<div
|
||||
className={cn(
|
||||
"flex flex-col space-y-2 text-center sm:text-left",
|
||||
className
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
|
|
@ -98,7 +114,7 @@ const SheetFooter = ({
|
|||
<div
|
||||
className={cn(
|
||||
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
||||
className
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,53 +1,92 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
type Props = {
|
||||
type IconProps = {
|
||||
size?: string;
|
||||
};
|
||||
|
||||
type Props = IconProps & {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
function InstagramIcon(props: IconProps) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg
|
||||
width="auto"
|
||||
height={size ?? "22"}
|
||||
viewBox="0 0 22 22"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11 1.98C13.9333 1.98 14.2817 1.98917 15.4458 2.04417C18.425 2.18167 19.8183 3.59333 19.9558 6.55417C20.0108 7.71833 20.02 8.06667 20.02 11C20.02 13.9333 20.0108 14.2817 19.9558 15.4458C19.8183 18.4067 18.4342 19.8183 15.4458 19.9558C14.2817 20.0108 13.9425 20.02 11 20.02C8.0575 20.02 7.71833 20.0108 6.55417 19.9558C3.56583 19.8183 2.18167 18.3975 2.04417 15.4458C1.98917 14.2817 1.98 13.9425 1.98 11C1.98 8.0575 1.98917 7.71833 2.04417 6.55417C2.18167 3.59333 3.56583 2.18167 6.55417 2.04417C7.71833 1.98917 8.0575 1.98 11 1.98ZM11 0C8.01167 0 7.63583 0.00916667 6.4625 0.0641667C2.475 0.2475 0.2475 2.46583 0.0641667 6.4625C0.00916667 7.63583 0 8.01167 0 11C0 13.9883 0.00916667 14.3642 0.0641667 15.5375C0.2475 19.5342 2.46583 21.7525 6.4625 21.9358C7.63583 21.9908 8.01167 22 11 22C13.9883 22 14.3642 21.9908 15.5375 21.9358C19.525 21.7525 21.7525 19.5342 21.9358 15.5375C21.9908 14.3642 22 13.9883 22 11C22 8.01167 21.9908 7.63583 21.9358 6.4625C21.7525 2.475 19.5342 0.2475 15.5375 0.0641667C14.3642 0.00916667 13.9883 0 11 0ZM11 5.35333C7.88333 5.35333 5.35333 7.88333 5.35333 11C5.35333 14.1167 7.88333 16.6467 11 16.6467C14.1167 16.6467 16.6467 14.1167 16.6467 11C16.6467 7.88333 14.1167 5.35333 11 5.35333ZM11 14.6667C8.97417 14.6667 7.33333 13.0258 7.33333 11C7.33333 8.97417 8.97417 7.33333 11 7.33333C13.0258 7.33333 14.6667 8.97417 14.6667 11C14.6667 13.0258 13.0258 14.6667 11 14.6667ZM16.8758 3.80417C16.1425 3.80417 15.5558 4.39083 15.5558 5.12417C15.5558 5.8575 16.1517 6.44417 16.8758 6.44417C17.6 6.44417 18.1958 5.8575 18.1958 5.12417C18.1958 4.39083 17.6092 3.80417 16.8758 3.80417Z"
|
||||
fill="#111F51"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
const SocialNetworks = (props: Props) => {
|
||||
|
||||
function FacebookIcon(props: IconProps) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg
|
||||
width="auto"
|
||||
height={size ?? "22"}
|
||||
viewBox="0 0 12 22"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M0.374552 11.7172H2.92063V21.6452C2.92063 21.8413 3.08845 22 3.29518 22H7.6124C7.81942 22 7.98695 21.841 7.98695 21.6452V11.7639H10.914C11.1041 11.7639 11.2644 11.6286 11.2862 11.4496L11.7307 7.7946C11.7429 7.69395 11.7092 7.5933 11.6384 7.51795C11.5673 7.44233 11.4656 7.39915 11.3588 7.39915H7.98724V5.10812C7.98724 4.4176 8.37979 4.06725 9.15445 4.06725H11.3588C11.5658 4.06725 11.7333 3.9083 11.7333 3.7125V0.3575C11.7333 0.161425 11.5655 0.00275 11.3588 0.00275H8.32085C8.29936 0.00165 8.25175 0 8.18177 0C7.65479 0 5.82239 0.0978999 4.37499 1.35905C2.77139 2.7566 2.99438 4.4297 3.04751 4.71982V7.39887H0.374552C0.167532 7.39887 0 7.55783 0 7.75363V11.3619C0 11.558 0.167822 11.7172 0.374552 11.7172Z"
|
||||
fill="#111F51"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function LinkedinIcon(props: IconProps) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg
|
||||
width="auto"
|
||||
height={size ?? "22"}
|
||||
viewBox="0 0 24 22"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M18.5778 0H4.88889C2.19022 0 0 2.05333 0 4.58333V17.4167C0 19.9467 2.19022 22 4.88889 22H18.5778C21.2764 22 23.4667 19.9467 23.4667 17.4167V4.58333C23.4667 2.05333 21.2764 0 18.5778 0ZM7.82222 17.4167H4.88889V7.33333H7.82222V17.4167ZM6.35556 6.16917C5.40711 6.16917 4.64444 5.445 4.64444 4.55583C4.64444 3.66667 5.40711 2.9425 6.35556 2.9425C7.304 2.9425 8.06667 3.66667 8.06667 4.55583C8.06667 5.445 7.304 6.16917 6.35556 6.16917ZM19.5556 17.4167H16.6222V12.2833C16.6222 9.19417 12.7111 9.4325 12.7111 12.2833V17.4167H9.77778V7.33333H12.7111V8.95583C14.08 6.58167 19.5556 6.4075 19.5556 11.2292V17.4258V17.4167Z"
|
||||
fill="#111F51"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
export default function SocialNetworks(props: Props) {
|
||||
const { size, className } = props;
|
||||
return (
|
||||
<div className={cn('flex items-center gap-4', className)}>
|
||||
<a target="_blank" href="https://www.instagram.com/ovoteamproo">
|
||||
<div className={cn("flex items-center gap-4", className)}>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href="https://www.instagram.com/ovoteamproo"
|
||||
>
|
||||
<InstagramIcon size={size} />
|
||||
</a>
|
||||
<a target="_blank" href="https://www.linkedin.com/company/ovoteam">
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href="https://www.linkedin.com/company/ovoteam"
|
||||
>
|
||||
<LinkedinIcon size={size} />
|
||||
</a>
|
||||
<a target="_blank" href="https://www.facebook.com/ovoteampro">
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
href="https://www.facebook.com/ovoteampro"
|
||||
>
|
||||
<FacebookIcon size={size} />
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default SocialNetworks;
|
||||
|
||||
function InstagramIcon(props: Props) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg width="auto" height={size ?? "22"} viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M11 1.98C13.9333 1.98 14.2817 1.98917 15.4458 2.04417C18.425 2.18167 19.8183 3.59333 19.9558 6.55417C20.0108 7.71833 20.02 8.06667 20.02 11C20.02 13.9333 20.0108 14.2817 19.9558 15.4458C19.8183 18.4067 18.4342 19.8183 15.4458 19.9558C14.2817 20.0108 13.9425 20.02 11 20.02C8.0575 20.02 7.71833 20.0108 6.55417 19.9558C3.56583 19.8183 2.18167 18.3975 2.04417 15.4458C1.98917 14.2817 1.98 13.9425 1.98 11C1.98 8.0575 1.98917 7.71833 2.04417 6.55417C2.18167 3.59333 3.56583 2.18167 6.55417 2.04417C7.71833 1.98917 8.0575 1.98 11 1.98ZM11 0C8.01167 0 7.63583 0.00916667 6.4625 0.0641667C2.475 0.2475 0.2475 2.46583 0.0641667 6.4625C0.00916667 7.63583 0 8.01167 0 11C0 13.9883 0.00916667 14.3642 0.0641667 15.5375C0.2475 19.5342 2.46583 21.7525 6.4625 21.9358C7.63583 21.9908 8.01167 22 11 22C13.9883 22 14.3642 21.9908 15.5375 21.9358C19.525 21.7525 21.7525 19.5342 21.9358 15.5375C21.9908 14.3642 22 13.9883 22 11C22 8.01167 21.9908 7.63583 21.9358 6.4625C21.7525 2.475 19.5342 0.2475 15.5375 0.0641667C14.3642 0.00916667 13.9883 0 11 0ZM11 5.35333C7.88333 5.35333 5.35333 7.88333 5.35333 11C5.35333 14.1167 7.88333 16.6467 11 16.6467C14.1167 16.6467 16.6467 14.1167 16.6467 11C16.6467 7.88333 14.1167 5.35333 11 5.35333ZM11 14.6667C8.97417 14.6667 7.33333 13.0258 7.33333 11C7.33333 8.97417 8.97417 7.33333 11 7.33333C13.0258 7.33333 14.6667 8.97417 14.6667 11C14.6667 13.0258 13.0258 14.6667 11 14.6667ZM16.8758 3.80417C16.1425 3.80417 15.5558 4.39083 15.5558 5.12417C15.5558 5.8575 16.1517 6.44417 16.8758 6.44417C17.6 6.44417 18.1958 5.8575 18.1958 5.12417C18.1958 4.39083 17.6092 3.80417 16.8758 3.80417Z" fill="#111F51" />
|
||||
</svg>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
function FacebookIcon(props: Props) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg width="auto" height={size ?? "22"} viewBox="0 0 12 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0.374552 11.7172H2.92063V21.6452C2.92063 21.8413 3.08845 22 3.29518 22H7.6124C7.81942 22 7.98695 21.841 7.98695 21.6452V11.7639H10.914C11.1041 11.7639 11.2644 11.6286 11.2862 11.4496L11.7307 7.7946C11.7429 7.69395 11.7092 7.5933 11.6384 7.51795C11.5673 7.44233 11.4656 7.39915 11.3588 7.39915H7.98724V5.10812C7.98724 4.4176 8.37979 4.06725 9.15445 4.06725H11.3588C11.5658 4.06725 11.7333 3.9083 11.7333 3.7125V0.3575C11.7333 0.161425 11.5655 0.00275 11.3588 0.00275H8.32085C8.29936 0.00165 8.25175 0 8.18177 0C7.65479 0 5.82239 0.0978999 4.37499 1.35905C2.77139 2.7566 2.99438 4.4297 3.04751 4.71982V7.39887H0.374552C0.167532 7.39887 0 7.55783 0 7.75363V11.3619C0 11.558 0.167822 11.7172 0.374552 11.7172Z" fill="#111F51" />
|
||||
</svg>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
function LinkedinIcon(props: Props) {
|
||||
const { size } = props;
|
||||
return (
|
||||
<svg width="auto" height={size ?? "22"} viewBox="0 0 24 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.5778 0H4.88889C2.19022 0 0 2.05333 0 4.58333V17.4167C0 19.9467 2.19022 22 4.88889 22H18.5778C21.2764 22 23.4667 19.9467 23.4667 17.4167V4.58333C23.4667 2.05333 21.2764 0 18.5778 0ZM7.82222 17.4167H4.88889V7.33333H7.82222V17.4167ZM6.35556 6.16917C5.40711 6.16917 4.64444 5.445 4.64444 4.55583C4.64444 3.66667 5.40711 2.9425 6.35556 2.9425C7.304 2.9425 8.06667 3.66667 8.06667 4.55583C8.06667 5.445 7.304 6.16917 6.35556 6.16917ZM19.5556 17.4167H16.6222V12.2833C16.6222 9.19417 12.7111 9.4325 12.7111 12.2833V17.4167H9.77778V7.33333H12.7111V8.95583C14.08 6.58167 19.5556 6.4075 19.5556 11.2292V17.4258V17.4167Z" fill="#111F51" />
|
||||
</svg>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,18 +4,18 @@ import { cn } from "@/lib/utils";
|
|||
import { Separator } from "@/components/ui/separator";
|
||||
import { fonts } from "@/front/lib/constants";
|
||||
|
||||
type Props = {
|
||||
cols: TripleColType[]
|
||||
}
|
||||
|
||||
export type TripleColType = {
|
||||
image: ImageProps;
|
||||
title: TextProps;
|
||||
subtitle?: TextProps;
|
||||
description: TextProps;
|
||||
}
|
||||
};
|
||||
|
||||
const TripleCol = (props: Props) => {
|
||||
type Props = {
|
||||
cols: TripleColType[];
|
||||
};
|
||||
|
||||
export default function TripleCol(props: Props) {
|
||||
const { cols } = props;
|
||||
|
||||
const width = "w-72 lg:w-56";
|
||||
|
|
@ -24,7 +24,7 @@ const TripleCol = (props: Props) => {
|
|||
return (
|
||||
<div className="grid md:grid-cols-3 grid-cols-1 md:gap-8">
|
||||
{cols.map((col, index) => {
|
||||
const isLast = index === (cols.length - 1)
|
||||
const isLast = index === cols.length - 1;
|
||||
return (
|
||||
<div className="text-center flex flex-col items-center md:gap-5">
|
||||
<Image
|
||||
|
|
@ -33,20 +33,39 @@ const TripleCol = (props: Props) => {
|
|||
shape="rounded"
|
||||
/>
|
||||
<div>
|
||||
<h4 className={cn("text-2xl uppercase", col.title.font, col.title.weight ?? "font-bold ")}>{col.title.text}</h4>
|
||||
<h4
|
||||
className={cn(
|
||||
"text-2xl uppercase",
|
||||
col.title.font,
|
||||
col.title.weight ?? "font-bold ",
|
||||
)}
|
||||
>
|
||||
{col.title.text}
|
||||
</h4>
|
||||
{col.subtitle && (
|
||||
<h5 className={cn("text-2xl", col.subtitle.font ?? fonts.DELIUS_SWASH, col.subtitle.weight ?? "font-normal")}>{col.subtitle.text}</h5>
|
||||
<h5
|
||||
className={cn(
|
||||
"text-2xl",
|
||||
col.subtitle.font ?? fonts.DELIUS_SWASH,
|
||||
col.subtitle.weight ?? "font-normal",
|
||||
)}
|
||||
>
|
||||
{col.subtitle.text}
|
||||
</h5>
|
||||
)}
|
||||
</div>
|
||||
<p className={cn(col.title.font, col.title.weight ?? "font-normal ")}>{col.description.text}</p>
|
||||
<p
|
||||
className={cn(col.title.font, col.title.weight ?? "font-normal ")}
|
||||
>
|
||||
{col.description.text}
|
||||
</p>
|
||||
|
||||
{!isLast && (
|
||||
<Separator className="md:hidden w-[70%] bg-primary h-3 my-12" />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
export default TripleCol;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
import { videoProvider } from "@/front/lib/constants";
|
||||
import VideoEmbedWithConsent from "$/base/VideoEmbedWithConsent";
|
||||
|
||||
const VideoBanner = () => {
|
||||
|
||||
export default function VideoBanner() {
|
||||
return (
|
||||
<VideoEmbedWithConsent
|
||||
service={videoProvider.YOUTUBE}
|
||||
title="Hero Banner"
|
||||
embedUrl="https://www.youtube.com/embed/vAqG5-NYBMI?autoplay=1&mute=1&controls=0&loop=1&playlist=vAqG5-NYBMI"
|
||||
/>
|
||||
service={videoProvider.YOUTUBE}
|
||||
title="Hero Banner"
|
||||
embedUrl="https://www.youtube.com/embed/vAqG5-NYBMI?autoplay=1&mute=1&controls=0&loop=1&playlist=vAqG5-NYBMI"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoBanner;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,9 +42,7 @@ export default function AppLayout({ children }: AppLayoutProps) {
|
|||
<Header />
|
||||
<Toaster />
|
||||
<RecaptchaProvider>
|
||||
<TooltipProvider>
|
||||
{children}
|
||||
</TooltipProvider>
|
||||
<TooltipProvider>{children}</TooltipProvider>
|
||||
</RecaptchaProvider>
|
||||
<GoToTop />
|
||||
<Footer />
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ export default function Commitment() {
|
|||
<Head title={useTrans("front.homepage")} />
|
||||
<PageHeader
|
||||
title={{
|
||||
text: "Ovoteam s'engage"
|
||||
text: "Ovoteam s'engage",
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?",
|
||||
}}
|
||||
/>
|
||||
<TripleColSection
|
||||
|
|
@ -28,46 +28,47 @@ export default function Commitment() {
|
|||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
button={{
|
||||
href: route('front.made-in-france'),
|
||||
label: "En savoir plus"
|
||||
href: route("front.made-in-france"),
|
||||
label: "En savoir plus",
|
||||
}}
|
||||
variant="bg-background"
|
||||
/>
|
||||
|
|
@ -78,166 +79,167 @@ export default function Commitment() {
|
|||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
button={{
|
||||
href: route('front.gamme'),
|
||||
label: "En savoir plus"
|
||||
href: route("front.gamme"),
|
||||
label: "En savoir plus",
|
||||
}}
|
||||
variant={bgColors.PRIMARY}
|
||||
/>
|
||||
<CarouselSection
|
||||
variant={bgColors.BACKGROUND}
|
||||
title={{
|
||||
text: "Expertise depuis 1963"
|
||||
text: "Expertise depuis 1963",
|
||||
}}
|
||||
button={{
|
||||
href: route('front.expertise'),
|
||||
href: route("front.expertise"),
|
||||
label: "En savoir plus",
|
||||
icon: {
|
||||
icon: "chevron-right"
|
||||
}
|
||||
icon: "chevron-right",
|
||||
},
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam."
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam.",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</AppLayout>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
// * PACKAGES
|
||||
import { Link, useForm } from "@inertiajs/react";
|
||||
import { route } from "ziggy-js";
|
||||
import { FormEvent } from "react";
|
||||
// * BASE
|
||||
import SimpleString from "$/base/Inputs/SimpleString";
|
||||
|
|
@ -15,9 +14,8 @@ import BackToHome from "$/uwil/BackToHome";
|
|||
import str from "@/hooks/use-string";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
|
||||
|
||||
export default function ContactForm() {
|
||||
const { data, setData, processing, post } = useForm({
|
||||
const { data, setData, processing } = useForm({
|
||||
name: "",
|
||||
firstName: "",
|
||||
phone: "",
|
||||
|
|
@ -32,110 +30,195 @@ export default function ContactForm() {
|
|||
|
||||
const submit = (e: FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
console.log("formulaire pas encore relié à un backend");
|
||||
return;
|
||||
post(route("post"), {
|
||||
onSuccess: () => { },
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Section
|
||||
className="max-w-4xl mx-auto"
|
||||
>
|
||||
<Section className="max-w-4xl mx-auto">
|
||||
<RecaptchaForm
|
||||
footer={
|
||||
<div className="mt-8 flex flex-col justify-center items-center">
|
||||
<Button
|
||||
variant={"default"}
|
||||
variant="default"
|
||||
type="submit"
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: "right"
|
||||
placement: "right",
|
||||
}}
|
||||
>Envoyer ma demande</Button>
|
||||
>
|
||||
Envoyer ma demande
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
onSubmit={submit} data={data}>
|
||||
onSubmit={submit}
|
||||
data={data}
|
||||
>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 space-y-6 gap-5">
|
||||
<SimpleString
|
||||
value={data.name}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.last_name.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.last_name.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="name"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.last_name.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.last_name.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.firstName}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.first_name.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.first_name.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="firstName"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.first_name.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.first_name.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.phone}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.phone.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.phone.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="phone"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.phone.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.phone.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.mail}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.mail.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.mail.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="mail"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.mail.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation("validation.custom.contact_form.mail.placeholder"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.entrepriseName}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.entreprise_name.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.entreprise_name.label",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="entrepriseName"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.entreprise_name.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.entreprise_name.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<EnumSelect
|
||||
selected={Number(data.activitySector)}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.activity_sector.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.activity_sector.label",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="activitySector"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.activity_sector.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.activity_sector.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
/>
|
||||
<EnumSelect
|
||||
selected={Number(data.object)}
|
||||
setData={setData}
|
||||
label={str(GetTranslation('validation.custom.contact_form.object.label')).ucFirst().value()}
|
||||
required={true}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.object.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
name="object"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.object.placeholder')).ucFirst().value()}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.object.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
className="md:col-span-2"
|
||||
/>
|
||||
<SimpleTextarea
|
||||
label={str(GetTranslation('validation.custom.contact_form.message.label')).ucFirst().value()}
|
||||
name={"message"}
|
||||
label={str(
|
||||
GetTranslation("validation.custom.contact_form.message.label"),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
name="message"
|
||||
setData={setData}
|
||||
className="md:col-span-2"
|
||||
disabled={processing}
|
||||
placeholder={str(GetTranslation('validation.custom.contact_form.message.placeholder')).ucFirst().value()}
|
||||
required={true}
|
||||
placeholder={str(
|
||||
GetTranslation(
|
||||
"validation.custom.contact_form.message.placeholder",
|
||||
),
|
||||
)
|
||||
.ucFirst()
|
||||
.value()}
|
||||
required
|
||||
value={data.message}
|
||||
/>
|
||||
<SimpleCheckbox
|
||||
label={
|
||||
<>
|
||||
{str(GetTranslation('validation.custom.contact_form.terms')).ucFirst().value()} <Link className="underline" href={"/"}>Charte</Link>.
|
||||
{str(GetTranslation("validation.custom.contact_form.terms"))
|
||||
.ucFirst()
|
||||
.value()}{" "}
|
||||
<Link className="underline" href="/">
|
||||
Charte
|
||||
</Link>
|
||||
.
|
||||
</>
|
||||
}
|
||||
name="terms"
|
||||
|
|
@ -144,14 +227,14 @@ export default function ContactForm() {
|
|||
className="md:col-span-2"
|
||||
/>
|
||||
<SimpleCheckbox
|
||||
label={str(GetTranslation('validation.custom.contact_form.optin')).ucFirst().value()}
|
||||
label={str(GetTranslation("validation.custom.contact_form.optin"))
|
||||
.ucFirst()
|
||||
.value()}
|
||||
name="optin"
|
||||
setData={setData}
|
||||
value={data.optin}
|
||||
className="md:col-span-2"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
<p className="font-semibold text-sm pt-8">* champs obligatoires</p>
|
||||
</RecaptchaForm>
|
||||
|
|
@ -159,5 +242,5 @@ export default function ContactForm() {
|
|||
<BackToHome />
|
||||
</div>
|
||||
</Section>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,30 +9,29 @@ import ContactForm from "./ContactForm";
|
|||
import Image from "@/front/Components/Theme/Image";
|
||||
|
||||
export default function ContactUs() {
|
||||
|
||||
return (
|
||||
<AppLayout>
|
||||
<Head title={useTrans("front.homepage")} />
|
||||
<PageHeader
|
||||
title={{
|
||||
text: "Nous contacter"
|
||||
text: "Nous contacter",
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?",
|
||||
}}
|
||||
/>
|
||||
<div className="mt-20">
|
||||
<Image
|
||||
size={`mx-auto w-[97%] md:w-72 lg:w-72 aspect-square`}
|
||||
size="mx-auto w-[97%] md:w-72 lg:w-72 aspect-square"
|
||||
image={{
|
||||
src: "/assets/img/elephant.jpg",
|
||||
alt: "ALT",
|
||||
title: "TITLE"
|
||||
title: "TITLE",
|
||||
}}
|
||||
shape="rounded"
|
||||
/>
|
||||
</div>
|
||||
<ContactForm />
|
||||
</AppLayout>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,52 +10,108 @@ import HeroImage from "$/uwil/HeroImage";
|
|||
import ListSectionTitle from "$/uwil/ListSectionTitle";
|
||||
import PageHeader from "$/uwil/PageHeader";
|
||||
import TripleColSection from "@/front/Components/Theme/Sections/TripleColSection";
|
||||
import { bgColors, fonts, sidePlacements, simpleWeights, verticalPlacements } from "../lib/constants";
|
||||
import {
|
||||
bgColors,
|
||||
fonts,
|
||||
sidePlacements,
|
||||
simpleWeights,
|
||||
verticalPlacements,
|
||||
} from "../lib/constants";
|
||||
import Section from "$/uwil/Section";
|
||||
import CarouselSection from "../Components/Theme/Sections/CarouselSection";
|
||||
import NutritionalValueList from "../Components/Theme/NutritionalValueList";
|
||||
/** OTHER */
|
||||
import { useState } from "react";
|
||||
import React, { useState } from "react";
|
||||
import { Link } from "@inertiajs/react";
|
||||
import Filters from "../Components/Theme/Inputs/Filters";
|
||||
|
||||
const Demo = () => {
|
||||
function CopyButton({ code }: { code: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopy = async () => {
|
||||
await navigator.clipboard.writeText(code);
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 1500);
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleCopy}
|
||||
className="text-xs px-3 py-1 rounded bg-muted hover:bg-muted/70 transition"
|
||||
>
|
||||
{copied ? "Copié ✓" : "Copier"}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function DemoSection({
|
||||
title,
|
||||
code,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
code?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<section className="space-y-4 py-10 border-b border-border">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-3xl font-bold">{title}</h2>
|
||||
{code && <CopyButton code={code} />}
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Demo() {
|
||||
return (
|
||||
<Section>
|
||||
<Link href='/' className="underline text-blue-500">Retour à la home</Link>
|
||||
<Link href="/" className="underline text-blue-500">
|
||||
Retour à la home
|
||||
</Link>
|
||||
<div className="space-y-4 relative">
|
||||
{/* BUTTONS */}
|
||||
<DemoSection title="Boutons"
|
||||
<DemoSection
|
||||
title="Boutons"
|
||||
code={`<Button variant="default">
|
||||
En savoir plus
|
||||
</Button>`}
|
||||
>
|
||||
<div className="flex gap-2 items-center flex-wrap">
|
||||
<Button variant="default">
|
||||
En savoir plus
|
||||
</Button>
|
||||
<Button variant="default">En savoir plus</Button>
|
||||
<Button variant="default" isBold={false} font={fonts.DELIUS_SWASH}>
|
||||
En savoir plus
|
||||
</Button>
|
||||
|
||||
<Button variant={"tertiary"} icon={{
|
||||
icon: "chevron-right",
|
||||
placement: sidePlacements.RIGHT
|
||||
}}>
|
||||
<Button
|
||||
variant="tertiary"
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: sidePlacements.RIGHT,
|
||||
}}
|
||||
>
|
||||
En savoir plus
|
||||
</Button>
|
||||
|
||||
<Button variant="default" icon={{
|
||||
icon: "x",
|
||||
placement: sidePlacements.LEFT
|
||||
}}>
|
||||
<Button
|
||||
variant="default"
|
||||
icon={{
|
||||
icon: "x",
|
||||
placement: sidePlacements.LEFT,
|
||||
}}
|
||||
>
|
||||
En savoir plus
|
||||
</Button>
|
||||
<Button variant="inverted" icon={{
|
||||
icon: "chevron-left",
|
||||
placement: sidePlacements.LEFT
|
||||
}}>
|
||||
<Button
|
||||
variant="inverted"
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: sidePlacements.LEFT,
|
||||
}}
|
||||
>
|
||||
En savoir plus
|
||||
</Button>
|
||||
</div>
|
||||
|
|
@ -63,7 +119,8 @@ const Demo = () => {
|
|||
</DemoSection>
|
||||
|
||||
{/* LISTES */}
|
||||
<DemoSection title="Cartes & Listes"
|
||||
<DemoSection
|
||||
title="Cartes & Listes"
|
||||
code={`<ListSectionTitle />
|
||||
<div className="inline-grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-10 lg:gap-16">
|
||||
{["1", "2", "3", "4"].map((item) => {
|
||||
|
|
@ -108,47 +165,48 @@ const Demo = () => {
|
|||
>
|
||||
<ListSectionTitle />
|
||||
<div className="inline-grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 md:gap-10 lg:gap-16">
|
||||
{["1", "2", "3", "4"].map((item) => {
|
||||
{["1", "2", "3", "4"].map(() => {
|
||||
return (
|
||||
<div>
|
||||
<ItemCard
|
||||
image={{
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
title={{
|
||||
text: "Oeuf poché moulé",
|
||||
}}
|
||||
button={{
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
href: "/ddd",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
})}
|
||||
<ItemCard
|
||||
image={{
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
title={{
|
||||
text: "Oeuf poché moulé",
|
||||
font: fonts.GOTHAM,
|
||||
weight: simpleWeights.BOLD
|
||||
weight: simpleWeights.BOLD,
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem Ipsum blablabla bla blabla blabl",
|
||||
font: fonts.GOTHAM,
|
||||
weight: simpleWeights.NORMAL
|
||||
weight: simpleWeights.NORMAL,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Sections d'action"
|
||||
<DemoSection
|
||||
title="Sections d'action"
|
||||
code={`
|
||||
<ActionSection
|
||||
text={{
|
||||
|
|
@ -165,7 +223,7 @@ const Demo = () => {
|
|||
>
|
||||
<ActionSection
|
||||
text={{
|
||||
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."
|
||||
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",
|
||||
|
|
@ -177,19 +235,19 @@ const Demo = () => {
|
|||
<ActionSection
|
||||
text={{
|
||||
font: fonts.DELIUS_SWASH,
|
||||
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."
|
||||
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",
|
||||
label: "Nous contacter",
|
||||
placement: verticalPlacements.BOTTOM,
|
||||
|
||||
}}
|
||||
variant={bgColors.PRIMARY}
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Breadcrumbs"
|
||||
<DemoSection
|
||||
title="Breadcrumbs"
|
||||
code={`
|
||||
<Breadcrumbs
|
||||
breadcrumbs={[
|
||||
|
|
@ -208,16 +266,18 @@ const Demo = () => {
|
|||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
url: "/",
|
||||
},
|
||||
{
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
url: "",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Header"
|
||||
<DemoSection
|
||||
title="Header"
|
||||
code={`
|
||||
<PageHeader
|
||||
title={{
|
||||
|
|
@ -234,16 +294,17 @@ const Demo = () => {
|
|||
<PageHeader
|
||||
title={{
|
||||
text: "Ovoteam s'engage",
|
||||
font: fonts.DELIUS_SWASH
|
||||
font: fonts.DELIUS_SWASH,
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?",
|
||||
font: fonts.DELIUS_SWASH
|
||||
font: fonts.DELIUS_SWASH,
|
||||
}}
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Hero avec image et texte"
|
||||
<DemoSection
|
||||
title="Hero avec image et texte"
|
||||
code={`
|
||||
<HeroImage
|
||||
title={{
|
||||
|
|
@ -269,27 +330,26 @@ const Demo = () => {
|
|||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum.",
|
||||
font: fonts.DELIUS_SWASH
|
||||
font: fonts.DELIUS_SWASH,
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Barre de navigation"
|
||||
code={`<Header />`}
|
||||
>
|
||||
<DemoSection title="Barre de navigation" code="<Header />">
|
||||
<Header />
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Footer" code={`<Footer />`}>
|
||||
<DemoSection title="Footer" code="<Footer />">
|
||||
<Footer />
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Section à 3 colonnes"
|
||||
<DemoSection
|
||||
title="Section à 3 colonnes"
|
||||
code={`
|
||||
<TripleColSection
|
||||
title={{
|
||||
|
|
@ -353,56 +413,57 @@ const Demo = () => {
|
|||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie"
|
||||
text: "Hôtellerie",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
button={{
|
||||
href: "#FIXME",
|
||||
label: "En savoir plus"
|
||||
label: "En savoir plus",
|
||||
}}
|
||||
variant="bg-background"
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
|
||||
<DemoSection title="Carousel"
|
||||
<DemoSection
|
||||
title="Carousel"
|
||||
code={`
|
||||
<CarouselSection
|
||||
carousel={{
|
||||
|
|
@ -506,9 +567,9 @@ const Demo = () => {
|
|||
carousel={{
|
||||
breakpoints: {
|
||||
1024: {
|
||||
slidesPerView: 4
|
||||
}
|
||||
}
|
||||
slidesPerView: 4,
|
||||
},
|
||||
},
|
||||
}}
|
||||
variant={bgColors.BACKGROUND}
|
||||
items={[
|
||||
|
|
@ -516,91 +577,92 @@ const Demo = () => {
|
|||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: "Voir le produit",
|
||||
href: "/ddd"
|
||||
}
|
||||
}
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Composant section avec custom children"
|
||||
<DemoSection
|
||||
title="Composant section avec custom children"
|
||||
code={`
|
||||
<Section
|
||||
title={{
|
||||
|
|
@ -638,15 +700,16 @@ const Demo = () => {
|
|||
href: "FIMXE",
|
||||
label: "Label",
|
||||
icon: {
|
||||
icon: "chevron-right"
|
||||
}
|
||||
icon: "chevron-right",
|
||||
},
|
||||
}}
|
||||
>
|
||||
sss
|
||||
</Section>
|
||||
</DemoSection>
|
||||
|
||||
<DemoSection title="Valeurs nutritionnelles"
|
||||
<DemoSection
|
||||
title="Valeurs nutritionnelles"
|
||||
code={`
|
||||
<Section>
|
||||
<NutritionalValueList
|
||||
|
|
@ -685,22 +748,23 @@ const Demo = () => {
|
|||
value: "114Kj",
|
||||
subRow: {
|
||||
label: "dont sucres",
|
||||
value: "0.5g"
|
||||
value: "0.5g",
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Energie",
|
||||
value: "114Kj"
|
||||
value: "114Kj",
|
||||
},
|
||||
{
|
||||
label: "Energie",
|
||||
value: "114Kj"
|
||||
value: "114Kj",
|
||||
},
|
||||
{
|
||||
label: "Energie",
|
||||
value: "114Kj"
|
||||
}
|
||||
]} />
|
||||
value: "114Kj",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
</DemoSection>
|
||||
|
||||
|
|
@ -709,48 +773,5 @@ const Demo = () => {
|
|||
</DemoSection>
|
||||
</div>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
export default Demo;
|
||||
|
||||
|
||||
function CopyButton({ code }: { code: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopy = async () => {
|
||||
await navigator.clipboard.writeText(code);
|
||||
setCopied(true);
|
||||
setTimeout(() => setCopied(false), 1500);
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
onClick={handleCopy}
|
||||
className="text-xs px-3 py-1 rounded bg-muted hover:bg-muted/70 transition"
|
||||
>
|
||||
{copied ? "Copié ✓" : "Copier"}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function DemoSection({
|
||||
title,
|
||||
code,
|
||||
children,
|
||||
}: {
|
||||
title: string;
|
||||
code?: string;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<section className="space-y-4 py-10 border-b border-border">
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 className="text-3xl font-bold">{title}</h2>
|
||||
{code && <CopyButton code={code} />}
|
||||
</div>
|
||||
|
||||
<div className="space-y-6">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,10 +210,10 @@ export default function DynamicPageDefault({
|
|||
<Head title={currentLocaleTitle} />
|
||||
<PageHeader
|
||||
title={{
|
||||
text: currentLocaleTitle
|
||||
text: currentLocaleTitle,
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo mollitia minus cum obcaecati necessitatibus? Molestias, harum. Sapiente eos ipsa ullam esse laborum id libero consectetur voluptate labore eaque. Optio, corporis?",
|
||||
}}
|
||||
/>
|
||||
<Section className="text-start tiptap">
|
||||
|
|
|
|||
|
|
@ -13,21 +13,21 @@ import { Separator } from "@/components/ui/separator";
|
|||
import BackToHome from "$/uwil/BackToHome";
|
||||
|
||||
export default function Expertise() {
|
||||
const { isMobile } = useDeviceType()
|
||||
const { isMobile } = useDeviceType();
|
||||
return (
|
||||
<AppLayout>
|
||||
<Head title={useTrans("front.homepage")} />
|
||||
<HeroImage
|
||||
title={{
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus."
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus.",
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum."
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum.",
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
|
|
@ -35,109 +35,110 @@ export default function Expertise() {
|
|||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
url: "/",
|
||||
},
|
||||
{
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
url: "",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<CarouselSection
|
||||
variant={bgColors.BACKGROUND}
|
||||
title={{
|
||||
text: "Les dates marquantes de la marque"
|
||||
text: "Les dates marquantes de la marque",
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
text: "description",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
|
@ -162,73 +163,73 @@ export default function Expertise() {
|
|||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2
|
||||
slidesPerView: 2,
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 3
|
||||
slidesPerView: 3,
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 3
|
||||
}
|
||||
}
|
||||
slidesPerView: 3,
|
||||
},
|
||||
},
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
text: "Hôtellerie, Restauration rapide",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
text: "Hôtellerie, Restauration rapide",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
text: "Hôtellerie, Restauration rapide",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
|
@ -236,10 +237,10 @@ export default function Expertise() {
|
|||
|
||||
<Section
|
||||
subtitle={{
|
||||
text: "Les industries agroalimentaires"
|
||||
text: "Les industries agroalimentaires",
|
||||
}}
|
||||
description={{
|
||||
text: "Expertise technique dans la séparation du blanc d'oeuf. Expertise microbiologique pour des produits Haute Qualité Spéciale. Une réponse performante pour des applications très diverses, répondant aux cahiers des charges les plus exigeants."
|
||||
text: "Expertise technique dans la séparation du blanc d'oeuf. Expertise microbiologique pour des produits Haute Qualité Spéciale. Une réponse performante pour des applications très diverses, répondant aux cahiers des charges les plus exigeants.",
|
||||
}}
|
||||
>
|
||||
<CarouselSection
|
||||
|
|
@ -250,64 +251,64 @@ export default function Expertise() {
|
|||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2
|
||||
slidesPerView: 2,
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 3
|
||||
slidesPerView: 3,
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 3
|
||||
}
|
||||
}
|
||||
slidesPerView: 3,
|
||||
},
|
||||
},
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
|
@ -315,10 +316,10 @@ export default function Expertise() {
|
|||
<Separator className="mx-auto w-[70%] md:w-[65%] bg-primary h-3 my-12" />
|
||||
<Section
|
||||
subtitle={{
|
||||
text: "Grandes et moyennes surfaces"
|
||||
text: "Grandes et moyennes surfaces",
|
||||
}}
|
||||
description={{
|
||||
text: "Société pionnière dans l'introduction des ovoproduits en GMS en France en 2025, offrant aux consommateurs une solution pratique à l'origine pour la restauration: des oeufs élaborés, prêts à l'emploi, pour gagner du temps et simplifier la préparation."
|
||||
text: "Société pionnière dans l'introduction des ovoproduits en GMS en France en 2025, offrant aux consommateurs une solution pratique à l'origine pour la restauration: des oeufs élaborés, prêts à l'emploi, pour gagner du temps et simplifier la préparation.",
|
||||
}}
|
||||
>
|
||||
<CarouselSection
|
||||
|
|
@ -329,53 +330,53 @@ export default function Expertise() {
|
|||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
}
|
||||
}
|
||||
spaceBetween: 0,
|
||||
},
|
||||
},
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
weight: "font-bold",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo "
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo ",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
|
|
@ -383,5 +384,5 @@ export default function Expertise() {
|
|||
<BackToHome />
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,15 +14,15 @@ export default function Expertise() {
|
|||
<Head title={useTrans("front.homepage")} />
|
||||
<HeroImage
|
||||
title={{
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus."
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus.",
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum."
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum.",
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
|
|
@ -30,37 +30,52 @@ export default function Expertise() {
|
|||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
url: "/",
|
||||
},
|
||||
{
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
url: "",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-5"
|
||||
>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-5">
|
||||
<div className="order-1 md:order-2 p-3 flex items-center justify-center">
|
||||
<Image
|
||||
size={`w-[90%] aspect-square`}
|
||||
size="w-[90%] aspect-square"
|
||||
image={{
|
||||
alt: "ALT",
|
||||
src: "/assets/img/elephant.jpg",
|
||||
lazyload: true,
|
||||
title: "TITLE"
|
||||
title: "TITLE",
|
||||
}}
|
||||
shape="rounded"
|
||||
/>
|
||||
</div>
|
||||
<div className="order-2 md:order-1 text-start space-y-6 flex flex-col items-center justify-center p-3">
|
||||
<p className="text-3xl font-semibold">De la sélection du pousson à la ponte, jusqu'à la production et la livraison du produit fini, nous nous assurons d'une qualité et d'une sécurité optimale.</p>
|
||||
<p>Nous nous engageons dans un travail d'amélioration constant de 3 piliers clé: la santé des animaux, leur habitat et le respect de leur bien-être.
|
||||
<br />
|
||||
Notre démarche s'appuie sur 200 points de contrôle répartis en 5 chapitres: conception, bio sécurité, entretien, conduite de l'élevage et documentation.
|
||||
<p className="text-3xl font-semibold">
|
||||
De la sélection du pousson à la ponte, jusqu’à la production et la
|
||||
livraison du produit fini, nous nous assurons d’une qualité et
|
||||
d’une sécurité optimale.
|
||||
</p>
|
||||
<p>
|
||||
Nous nous engageons dans un travail d’amélioration constant de 3
|
||||
piliers clé: la santé des animaux, leur habitat et le respect de
|
||||
leur bien-être.
|
||||
<br />
|
||||
Notre démarche s’appuie sur 200 points de contrôle répartis en 5
|
||||
chapitres: conception, bio sécurité, entretien, conduite de
|
||||
l’élevage et documentation.
|
||||
</p>
|
||||
<p className="text-3xl uppercase text-primary font-semibold">
|
||||
En 2025, nous nous engageons à proposer des solutions en élevage
|
||||
alternatif sur la totalité de nos gammes.
|
||||
</p>
|
||||
<p className="text-3xl uppercase text-primary font-semibold">
|
||||
En 2028, nous nous engageons à dépasser 90% de nos volumes en
|
||||
oeufs issus d’élevages alternatifs.
|
||||
</p>
|
||||
<p className="text-3xl uppercase text-primary font-semibold">En 2025, nous nous engageons à proposer des solutions en élevage alternatif sur la totalité de nos gammes.</p>
|
||||
<p className="text-3xl uppercase text-primary font-semibold">En 2028, nous nous engageons à dépasser 90% de nos volumes en oeufs issus d'élevages alternatifs.</p>
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
|
|
@ -68,42 +83,43 @@ export default function Expertise() {
|
|||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
variant="bg-background"
|
||||
/>
|
||||
|
|
@ -111,5 +127,5 @@ export default function Expertise() {
|
|||
<BackToHome />
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// * Packages
|
||||
import { Head, usePage } from "@inertiajs/react";
|
||||
import { Head } from "@inertiajs/react";
|
||||
import { route } from "ziggy-js";
|
||||
// * Other
|
||||
import AppLayout from "@/front/Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
|
|
@ -10,8 +11,7 @@ import TripleColSection from "$/uwil/Sections/TripleColSection";
|
|||
import CarouselSection from "$/uwil/Sections/CarouselSection";
|
||||
import ActionSection from "$/uwil/ActionSection";
|
||||
import VideoBanner from "$/uwil/VideoBanner";
|
||||
import { peekCarouselOptions } from "../lib/carousels";
|
||||
import { route } from "ziggy-js";
|
||||
import { usePeekCarouselOptions } from "../lib/carousels";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
|
|
@ -19,160 +19,164 @@ export default function Home() {
|
|||
<Head title={useTrans("front.homepage")} />
|
||||
<VideoBanner />
|
||||
<CarouselSection
|
||||
carousel={peekCarouselOptions()}
|
||||
carousel={usePeekCarouselOptions()}
|
||||
variant={bgColors.PRIMARY}
|
||||
title={{
|
||||
text: GetTranslation('front.ovoteam_product')
|
||||
text: GetTranslation("front.ovoteam_product"),
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum fringilla ante vel dignissim. Donec in porta turpis. Duis euismod, dui eget pretium tincidunt, tortor mi fringilla metus, vitae sodales purus felis eget libero. Sed in nibh non massa ultricies volutpat at sed quam. Vivamus at lacinia metus, tristique lacinia est"
|
||||
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum fringilla ante vel dignissim. Donec in porta turpis. Duis euismod, dui eget pretium tincidunt, tortor mi fringilla metus, vitae sodales purus felis eget libero. Sed in nibh non massa ultricies volutpat at sed quam. Vivamus at lacinia metus, tristique lacinia est",
|
||||
}}
|
||||
button={{
|
||||
href: "FIXME",
|
||||
label: str(GetTranslation('front.see.all_products')).ucFirst().value(),
|
||||
label: str(GetTranslation("front.see.all_products"))
|
||||
.ucFirst()
|
||||
.value(),
|
||||
icon: {
|
||||
icon: "chevron-right"
|
||||
}
|
||||
icon: "chevron-right",
|
||||
},
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
}
|
||||
label: str(GetTranslation("front.see.product")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<TripleColSection
|
||||
title={{
|
||||
text: GetTranslation('front.ovoteam_commit'),
|
||||
text: GetTranslation("front.ovoteam_commit"),
|
||||
}}
|
||||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie"
|
||||
text: "Hôtellerie",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
button={{
|
||||
href: route("front.engage"),
|
||||
label: str(GetTranslation('front.discover_our_commit')).ucFirst().value()
|
||||
label: str(GetTranslation("front.discover_our_commit"))
|
||||
.ucFirst()
|
||||
.value(),
|
||||
}}
|
||||
variant="bg-background"
|
||||
/>
|
||||
|
|
@ -180,109 +184,109 @@ export default function Home() {
|
|||
<CarouselSection
|
||||
variant={bgColors.PRIMARY}
|
||||
title={{
|
||||
text: GetTranslation('front.ovoteam_recipe')
|
||||
text: GetTranslation("front.ovoteam_recipe"),
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum fringilla ante vel dignissim. Donec in porta turpis. Duis euismod, dui eget pretium tincidunt, tortor mi fringilla metus, vitae sodales purus felis eget libero. Sed in nibh non massa ultricies volutpat at sed quam. Vivamus at lacinia metus, tristique lacinia est"
|
||||
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis bibendum fringilla ante vel dignissim. Donec in porta turpis. Duis euismod, dui eget pretium tincidunt, tortor mi fringilla metus, vitae sodales purus felis eget libero. Sed in nibh non massa ultricies volutpat at sed quam. Vivamus at lacinia metus, tristique lacinia est",
|
||||
}}
|
||||
button={{
|
||||
href: "FIXME",
|
||||
label: str(GetTranslation('front.see.all_recipes')).ucFirst().value(),
|
||||
label: str(GetTranslation("front.see.all_recipes")).ucFirst().value(),
|
||||
icon: {
|
||||
icon: "chevron-right"
|
||||
}
|
||||
icon: "chevron-right",
|
||||
},
|
||||
}}
|
||||
carousel={peekCarouselOptions()}
|
||||
carousel={usePeekCarouselOptions()}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
title: {
|
||||
text: "Oeuf poché moulé",
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.recipe')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
}
|
||||
label: str(GetTranslation("front.see.recipe")).ucFirst().value(),
|
||||
href: "/ddd",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<ActionSection
|
||||
text={{
|
||||
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."
|
||||
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",
|
||||
|
|
|
|||
|
|
@ -15,15 +15,15 @@ export default function MadeInFrance() {
|
|||
<Head title={useTrans("front.homepage")} />
|
||||
<HeroImage
|
||||
title={{
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus."
|
||||
text: "Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt unde esse est maiores tempora, sequi, soluta officiis quae aliquid sit ducimus.",
|
||||
}}
|
||||
description={{
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum."
|
||||
text: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Alias commodi esse quas, ad dicta cumque est nemo officia repellat eum neque vel quos optio consectetur odit voluptatum laudantium itaque. Facere. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus, quaerat. Illum odit vero voluptatibus eveniet minus. Repudiandae minus commodi temporibus voluptatibus quos quidem ut excepturi praesentium doloremque autem, eos laborum.",
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
src: "/assets/img/elephant.jpg",
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
|
|
@ -31,11 +31,12 @@ export default function MadeInFrance() {
|
|||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
url: "/",
|
||||
},
|
||||
{
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
url: "",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
|
|
@ -46,42 +47,43 @@ export default function MadeInFrance() {
|
|||
cols={[
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Plaintel (22)"
|
||||
text: "Plaintel (22)",
|
||||
},
|
||||
description: {
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?"
|
||||
text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit dicta explicabo quos accusamus unde nostrum nemo delectus consequatur aliquam iste porro, ab asperiores incidunt autem veniam. In reiciendis totam nesciunt. Lorem ipsum dolor sit amet consectetur adipisicing elit. Eum voluptatibus temporibus autem amet maxime fuga dignissimos quo necessitatibus iusto nam. Rerum placeat esse perspiciatis suscipit eos ipsa ad alias totam?",
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
variant="bg-background"
|
||||
/>
|
||||
|
|
@ -89,56 +91,56 @@ export default function MadeInFrance() {
|
|||
<CarouselSection
|
||||
variant={bgColors.PRIMARY}
|
||||
title={{
|
||||
text: "Certifications"
|
||||
text: "Certifications",
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
src: "/assets/img/elephant.jpg",
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Section>
|
||||
<BackToHome />
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import useDeviceType from "@/hooks/use-device-type"
|
||||
import { CarouselProps } from "@/types/front"
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import useDeviceType from "@/hooks/use-device-type";
|
||||
import { CarouselProps } from "@/types/front";
|
||||
|
||||
/**
|
||||
* Carousel Peek Option
|
||||
|
|
@ -9,18 +10,19 @@ import { CarouselProps } from "@/types/front"
|
|||
* @example
|
||||
* <CarouselSection
|
||||
* // other props
|
||||
* carousel={peekCarouselOptions()}
|
||||
* carousel={usePeekCarouselOptions()}
|
||||
* />
|
||||
*/
|
||||
export const peekCarouselOptions = (): CarouselProps["carousel"] => {
|
||||
const { isMobile } = useDeviceType()
|
||||
export function usePeekCarouselOptions(): CarouselProps["carousel"] {
|
||||
const { isMobile } = useDeviceType();
|
||||
|
||||
return {
|
||||
centeredSlides: isMobile,
|
||||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1.3,
|
||||
spaceBetween: 0
|
||||
spaceBetween: 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,27 +11,30 @@ export type FontName = (typeof fonts)[keyof typeof fonts];
|
|||
// CONST for placement
|
||||
export const sidePlacements = {
|
||||
LEFT: "left",
|
||||
RIGHT: "right"
|
||||
RIGHT: "right",
|
||||
} as const;
|
||||
export type SidePlacementName = (typeof sidePlacements)[keyof typeof sidePlacements];
|
||||
export type SidePlacementName =
|
||||
(typeof sidePlacements)[keyof typeof sidePlacements];
|
||||
|
||||
export const verticalPlacements = {
|
||||
TOP: "top",
|
||||
BOTTOM: "bottom"
|
||||
BOTTOM: "bottom",
|
||||
} as const;
|
||||
export type VerticalPlacementName = (typeof verticalPlacements)[keyof typeof verticalPlacements];
|
||||
export type VerticalPlacementName =
|
||||
(typeof verticalPlacements)[keyof typeof verticalPlacements];
|
||||
|
||||
// CONST for weight text
|
||||
export const simpleWeights = {
|
||||
BOLD: "font-bold",
|
||||
NORMAL: "font-normal",
|
||||
} as const;
|
||||
export type SimpleWeightName = (typeof simpleWeights)[keyof typeof simpleWeights];
|
||||
export type SimpleWeightName =
|
||||
(typeof simpleWeights)[keyof typeof simpleWeights];
|
||||
|
||||
// CONST for bg color
|
||||
export const bgColors = {
|
||||
PRIMARY: "bg-primary",
|
||||
BACKGROUND: "bg-background"
|
||||
BACKGROUND: "bg-background",
|
||||
} as const;
|
||||
export type BgColorName = (typeof bgColors)[keyof typeof bgColors];
|
||||
|
||||
|
|
@ -39,24 +42,25 @@ export type BgColorName = (typeof bgColors)[keyof typeof bgColors];
|
|||
export const iconMap = {
|
||||
"chevron-right": ChevronRight,
|
||||
"chevron-left": ChevronLeft,
|
||||
"x": X,
|
||||
} as const
|
||||
x: X,
|
||||
} as const;
|
||||
|
||||
export type IconName = keyof typeof iconMap
|
||||
export type IconName = keyof typeof iconMap;
|
||||
|
||||
// VIDEO PROVIDER
|
||||
export const videoProvider = {
|
||||
YOUTUBE: "youtube",
|
||||
VIMEO: "vimeo",
|
||||
} as const
|
||||
} as const;
|
||||
|
||||
export type VideoProviderName = (typeof videoProvider)[keyof typeof videoProvider];
|
||||
export type VideoProviderName =
|
||||
(typeof videoProvider)[keyof typeof videoProvider];
|
||||
|
||||
// COOKIE NOTICE SERVICE
|
||||
export const cnServices = {
|
||||
...videoProvider,
|
||||
RECAPTCHA: "recaptcha",
|
||||
MATOMO: "matomo"
|
||||
} as const
|
||||
MATOMO: "matomo",
|
||||
} as const;
|
||||
|
||||
export type CnServiceName = (typeof cnServices)[keyof typeof cnServices];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
import { createContext, useContext, useEffect, useRef } from "react";
|
||||
import React, {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
} from "react";
|
||||
import InitRecaptcha from "@/hooks/use-recaptcha";
|
||||
import { useCookieNotice } from "@/hooks/use-cookie-notice";
|
||||
import useCookieNotice from "@/hooks/use-cookie-notice";
|
||||
import { cnServices } from "../lib/constants";
|
||||
|
||||
type ContextType = {
|
||||
|
|
@ -21,22 +28,29 @@ export function RecaptchaProvider({ children }: { children: React.ReactNode }) {
|
|||
}
|
||||
}, [status]);
|
||||
|
||||
const getToken = () => {
|
||||
const getToken = useCallback(() => {
|
||||
// @ts-expect-error grecaptcha global
|
||||
return window.grecaptcha?.getResponse() || "";
|
||||
};
|
||||
}, []);
|
||||
|
||||
const value = useMemo(
|
||||
() => ({
|
||||
enabled: status,
|
||||
getToken,
|
||||
formRef,
|
||||
}),
|
||||
[status, getToken],
|
||||
);
|
||||
|
||||
return (
|
||||
<RecaptchaContext.Provider value={{ enabled: status, getToken, formRef }}>
|
||||
<RecaptchaContext.Provider value={value}>
|
||||
<div>{children}</div>
|
||||
</RecaptchaContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export function useRecaptcha() {
|
||||
const ctx = useContext(RecaptchaContext);
|
||||
if (!ctx) throw new Error("useRecaptcha must be used inside provider");
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { CnServiceName } from "@/front/lib/constants";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const useCookieNotice = (service: CnServiceName) => {
|
||||
export default function useCookieNotice(service: CnServiceName) {
|
||||
const [status, setStatus] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
|
|
@ -23,4 +23,4 @@ export const useCookieNotice = (service: CnServiceName) => {
|
|||
};
|
||||
|
||||
return { status, loading, accept };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
declare global {
|
||||
interface Window {
|
||||
__CN_Recaptcha?: () => void;
|
||||
|
|
@ -13,7 +12,6 @@ declare global {
|
|||
}
|
||||
|
||||
export default function InitRecaptcha(forms: HTMLFormElement[]) {
|
||||
|
||||
if (!forms.length) return;
|
||||
|
||||
// Setup reCAPTCHA loader
|
||||
|
|
|
|||
77
resources/ts/types/front.d.ts
vendored
77
resources/ts/types/front.d.ts
vendored
|
|
@ -1,29 +1,45 @@
|
|||
import { BgColorName, FontName, IconName, SidePlacementName, SimpleWeightName } from "@/front/lib/constants";
|
||||
import {
|
||||
BgColorName,
|
||||
FontName,
|
||||
IconName,
|
||||
SidePlacementName,
|
||||
SimpleWeightName,
|
||||
} from "@/front/lib/constants";
|
||||
import React, { ReactNode } from "react";
|
||||
import { SwiperClass } from "swiper/react";
|
||||
import { AutoplayOptions, NavigationOptions, PaginationOptions, SwiperOptions } from "swiper/types";
|
||||
import {
|
||||
AutoplayOptions,
|
||||
NavigationOptions,
|
||||
PaginationOptions,
|
||||
SwiperOptions,
|
||||
} from "swiper/types";
|
||||
|
||||
type TextProps = {
|
||||
text: string;
|
||||
font?: FontName;
|
||||
weight?: SimpleWeightName
|
||||
}
|
||||
weight?: SimpleWeightName;
|
||||
};
|
||||
|
||||
type ImageProps = {
|
||||
src: string;
|
||||
alt: string;
|
||||
title?: string;
|
||||
lazyload?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
type FrontNavLinkProps = {
|
||||
title: string;
|
||||
href?: string;
|
||||
children?: FrontNavLinkProps[]
|
||||
}
|
||||
children?: FrontNavLinkProps[];
|
||||
};
|
||||
|
||||
type CustomButtonVariant = "tertiary" | "inverted";
|
||||
|
||||
type ButtonProps = {
|
||||
label: string;
|
||||
href: string;
|
||||
};
|
||||
|
||||
type ThemeItemCardProps = {
|
||||
button?: ButtonProps;
|
||||
title?: TextProps;
|
||||
|
|
@ -34,13 +50,8 @@ type ThemeItemCardProps = {
|
|||
size?: {
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
}
|
||||
|
||||
type ButtonProps = {
|
||||
label: string;
|
||||
href: string;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
type CarouselBreakpointsProps = {
|
||||
[width: number]: SwiperOptions;
|
||||
|
|
@ -50,8 +61,8 @@ type CarouselBreakpointsProps = {
|
|||
type SwiperButtonProps = {
|
||||
swiperRef: React.RefObject<SwiperClass | null>;
|
||||
disabled: boolean;
|
||||
icon: ReactNode
|
||||
}
|
||||
icon: ReactNode;
|
||||
};
|
||||
|
||||
type CarouselProps = {
|
||||
/**
|
||||
|
|
@ -76,8 +87,8 @@ type CarouselProps = {
|
|||
*/
|
||||
items: ThemeItemCardProps[];
|
||||
/**
|
||||
* Variant of the background color.
|
||||
*/
|
||||
* Variant of the background color.
|
||||
*/
|
||||
variant?: BgColorName;
|
||||
carousel?: {
|
||||
/**
|
||||
|
|
@ -96,7 +107,7 @@ type CarouselProps = {
|
|||
pagination?: PaginationOptions | boolean;
|
||||
/**
|
||||
* Allows to set different parameter for different responsive breakpoints (screen sizes). Not all parameters can be changed in breakpoints, only those which do not require different layout and logic, like `slidesPerView`, `slidesPerGroup`, `spaceBetween`, `grid.rows`. Such parameters like `loop` and `effect` won't work
|
||||
*/
|
||||
*/
|
||||
breakpoints?: CarouselBreakpointsProps;
|
||||
/**
|
||||
* Object with navigation parameters or boolean `true` to enable with default settings.
|
||||
|
|
@ -115,11 +126,12 @@ type CarouselProps = {
|
|||
* @note `slidesPerView: 'auto'` is currently not compatible with multirow mode, when `grid.rows` > 1
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
slidesPerView?: number | 'auto';
|
||||
*/
|
||||
slidesPerView?: number | "auto";
|
||||
/**
|
||||
* Event will be fired when currently active slide is changed
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onSlideChange?: (swiper: SwiperClass) => void;
|
||||
/**
|
||||
* Object with autoplay parameters or boolean `true` to enable with default settings
|
||||
|
|
@ -131,43 +143,44 @@ type CarouselProps = {
|
|||
* delay: 5000,
|
||||
* },
|
||||
*});
|
||||
* ```
|
||||
*/
|
||||
* ```
|
||||
*/
|
||||
autoplay?: AutoplayOptions | boolean;
|
||||
/**
|
||||
* Get Swiper instance
|
||||
*/
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onSwiper?: (swiper: SwiperClass) => void;
|
||||
/**
|
||||
* When enabled Swiper will be disabled and hide navigation buttons on
|
||||
* case there are not enough slides for sliding.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
*/
|
||||
watchOverflow?: boolean | undefined;
|
||||
/**
|
||||
* If `true`, then active slide will be centered, not always on the left side.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
*/
|
||||
centeredSlides?: boolean;
|
||||
/**
|
||||
* ClassName of the wrapper slide
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
*/
|
||||
wrapperClass?: string;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
type CarouselPropsWithNavigation = CarouselProps & {
|
||||
prevBtn: ReactNode;
|
||||
nextBtn: ReactNode;
|
||||
wrapperClass?: string;
|
||||
}
|
||||
};
|
||||
|
||||
type IconConfig = {
|
||||
icon: IconName
|
||||
icon: IconName;
|
||||
placement?: SidePlacementName;
|
||||
className?: string;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
8
resources/ts/window.d.ts
vendored
8
resources/ts/window.d.ts
vendored
|
|
@ -1,8 +1,8 @@
|
|||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
CookieNotice: typeof CookieNotice;
|
||||
Recaptcha: unknown;
|
||||
}
|
||||
interface Window {
|
||||
CookieNotice: typeof CookieNotice;
|
||||
Recaptcha: unknown;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||
use Diglactic\Breadcrumbs\Generator;
|
||||
use Illuminate\Support\Str;
|
||||
use Uwil\LaravelDynamicPages\Helpers\RouteHelper;
|
||||
use Uwil\LaravelDynamicPages\Models\DynamicPage;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
|
|
@ -40,8 +39,8 @@ DynamicPage::getModelsCached()->map(function (DynamicPage $dynamicPageModel) use
|
|||
|
||||
|
||||
Breadcrumbs::for('front.engage', function (Generator $trail) {
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
->where('status', PageStatusEnum::published)
|
||||
->where('isRoot', true)
|
||||
->first();
|
||||
|
|
@ -53,9 +52,9 @@ Breadcrumbs::for('front.engage', function (Generator $trail) {
|
|||
);
|
||||
});
|
||||
|
||||
Breadcrumbs::for('front.made-in-france', function (Generator $trail) {
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
Breadcrumbs::for('front.made-in-france', function (Generator $trail) use ($pageHome, $currentLocale) {
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
->where('status', PageStatusEnum::published)
|
||||
->where('isRoot', true)
|
||||
->first();
|
||||
|
|
@ -70,12 +69,7 @@ Breadcrumbs::for('front.made-in-france', function (Generator $trail) {
|
|||
);
|
||||
});
|
||||
|
||||
Breadcrumbs::for('front.expertise', function (Generator $trail) {
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
->where('status', PageStatusEnum::published)
|
||||
->where('isRoot', true)
|
||||
->first();
|
||||
Breadcrumbs::for('front.expertise', function (Generator $trail) use ($currentLocale, $pageHome) {
|
||||
$trail->parent(sprintf("front.dynamic-pages.%s.%s", $pageHome->id_key, $currentLocale));
|
||||
$trail->push(
|
||||
__('front.engage'),
|
||||
|
|
@ -87,12 +81,7 @@ Breadcrumbs::for('front.expertise', function (Generator $trail) {
|
|||
);
|
||||
});
|
||||
|
||||
Breadcrumbs::for('front.gamme', function (Generator $trail) {
|
||||
$currentLocale = app()->getLocale();
|
||||
$pageHome = DynamicPage::getModelsCached()
|
||||
->where('status', PageStatusEnum::published)
|
||||
->where('isRoot', true)
|
||||
->first();
|
||||
Breadcrumbs::for('front.gamme', function (Generator $trail) use ($pageHome, $currentLocale) {
|
||||
$trail->parent(sprintf("front.dynamic-pages.%s.%s", $pageHome->id_key, $currentLocale));
|
||||
$trail->push(
|
||||
__('front.engage'),
|
||||
|
|
|
|||
|
|
@ -3,26 +3,26 @@
|
|||
use Illuminate\Support\Facades\Route;
|
||||
use Inertia\Inertia;
|
||||
|
||||
Route::get('/nos-engagements', function() {
|
||||
Route::get('/nos-engagements', function () {
|
||||
return Inertia::render('front/Pages/Commitment');
|
||||
})->name('engage');
|
||||
|
||||
Route::get('/nos-engagements/fabrique-en-france', function() {
|
||||
Route::get('/nos-engagements/fabrique-en-france', function () {
|
||||
return Inertia::render('front/Pages/MadeInFrance');
|
||||
})->name('made-in-france');
|
||||
|
||||
Route::get('/nos-engagements/expertise', function() {
|
||||
Route::get('/nos-engagements/expertise', function () {
|
||||
return Inertia::render('front/Pages/Expertise');
|
||||
})->name('expertise');
|
||||
|
||||
Route::get('/nos-engagements/gamme', function() {
|
||||
Route::get('/nos-engagements/gamme', function () {
|
||||
return Inertia::render('front/Pages/Gamme');
|
||||
})->name('gamme');
|
||||
|
||||
Route::get('/nous-contacter', function() {
|
||||
Route::get('/nous-contacter', function () {
|
||||
return Inertia::render('front/Pages/Contact/ContactUs');
|
||||
})->name('contact-us');
|
||||
|
||||
Route::get('/demo', function() {
|
||||
Route::get('/demo', function () {
|
||||
return inertia('front/Pages/Demo');
|
||||
})->name('demo');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue