feat: :construct: front pages + components
This commit is contained in:
parent
a7d30e8353
commit
f2a4a367e0
63 changed files with 6118 additions and 2528 deletions
45
lang/de/cookie-notice.php
Normal file
45
lang/de/cookie-notice.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Cookie-Einstellungen',
|
||||
'button_close_cookies' => 'Cookies-Fenster schließen',
|
||||
'button_toggle_cookie' => 'Akzeptieren oder ablehnen',
|
||||
'button_forbid_all' => 'Alle ablehnen',
|
||||
'button_allow_all' => 'Alle akzeptieren',
|
||||
'button_forbid_all_title' => 'Lehnen Sie alle Cookies ab und schließen Sie das Cookie-Panel',
|
||||
'button_allow_all_title' => 'Akzeptieren Sie alle Cookies und schließen Sie das Cookie-Panel',
|
||||
'button_customize' => 'Einstellungen',
|
||||
'button_validate_and_close' => 'Bestätigen und schließen',
|
||||
'button_title_open_new_tab' => 'Link in neuem Tab öffnen',
|
||||
'banner_title' => 'Die Website :site_name nutzt Cookies!',
|
||||
'banner_text' => 'Wir verwenden Cookies, um sicherzustellen, dass unsere Website ordnungsgemäß funktioniert, und zu analytischen Zwecken.
|
||||
Sie können Ihre Meinung jederzeit ändern, indem Sie auf das Symbol auf jeder Seite unserer Website klicken.
|
||||
Wenn Sie diese Dienste von Drittanbietern zulassen, stimmen Sie dem Ablegen und Lesen von Cookies und der Verwendung von Tracking-Technologien zu, die für das Funktionieren dieser Dienste erforderlich sind.',
|
||||
'panel_content' => 'Inhalt des Cookie-Verwaltungspanels',
|
||||
'picture_cookie_title' => 'Bild eines schönen großen Kekses',
|
||||
'navigation_title' => 'Navigation im Cookie-Panel',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Dienste zur Zielgruppenmessung ermöglichen die Erstellung von Besucherstatistiken, die zur Verbesserung der Website nützlich sind.',
|
||||
],
|
||||
'youtube' => [
|
||||
'name' => 'Youtube',
|
||||
'description' => 'Über Video-Sharing-Dienste platzierte Cookies sollen es dem Benutzer ermöglichen, Multimedia-Inhalte direkt auf der Website anzusehen.',
|
||||
'labelLink' => 'Erfahren Sie mehr',
|
||||
'warning' => 'Sie müssen Cookies akzeptieren, um dieses Video anzusehen',
|
||||
'accept' => 'Akzeptieren'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Mithilfe von Publikumsmessungsdiensten werden Verkehrsstatistiken erstellt, die zur Verbesserung der Website nützlich sind.',
|
||||
'labelLink' => 'Erfahren Sie mehr',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Der Zweck der über das Recaptcha auf Formularen platzierten Cookies besteht darin, zu verhindern, dass diese von Robotern übermittelt werden.',
|
||||
'labelLink' => 'Erfahren Sie mehr',
|
||||
'warning' => 'Sie müssen reCAPTCHA Cookies akzeptieren, um das Formular senden zu können',
|
||||
]
|
||||
]
|
||||
];
|
||||
46
lang/en/cookie-notice.php
Normal file
46
lang/en/cookie-notice.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Customize cookies',
|
||||
'button_close_cookies' => 'Close cookie window',
|
||||
'button_toggle_cookie' => 'Accept or refuse',
|
||||
'button_forbid_all' => 'Refuse all',
|
||||
'button_allow_all' => 'Accept all',
|
||||
'button_forbid_all_title' => 'Refuse all cookies and close the cookies panel',
|
||||
'button_allow_all_title' => 'Accept all cookies and close the cookies panel',
|
||||
'button_customize' => 'Customize',
|
||||
'button_validate_and_close' => 'Confirm and close',
|
||||
'button_title_open_new_tab' => 'Open link in new tab',
|
||||
'banner_title' => 'The :site_name website uses cookies!',
|
||||
'banner_text' => 'We use cookies to ensure the proper functioning of our site and for analytical purposes.
|
||||
You can change your mind at any time by clicking on the icon on any page of our site.
|
||||
By authorizing these third-party services, you agree to the deposit and reading of cookies and the use of tracking technologies necessary for their proper operation.',
|
||||
'modal_title' => 'Cookie management window',
|
||||
'panel_content' => 'Cookie management panel content',
|
||||
'picture_cookie_title' => 'Image of a nice big cookie',
|
||||
'navigation_title' => 'Cookies panel navigation',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Audience measurement services make it possible to generate attendance statistics useful for improving the site.',
|
||||
],
|
||||
'youtube' => [
|
||||
'title' => 'Youtube',
|
||||
'description' => 'Cookies placed via video sharing services are intended to allow the user to view multimedia content directly on the site.',
|
||||
'labelLink' => 'Learn more',
|
||||
'warning' => 'You must accept cookies to view this video',
|
||||
'accept' => 'Accept'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Audience measurement services are used to generate traffic statistics, which are useful for improving the site.',
|
||||
'labelLink' => 'Learn more',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'The purpose of the cookies placed on forms via the recaptcha is to prevent them from being submitted by robots.',
|
||||
'labelLink' => 'Learn more',
|
||||
'warning' => 'You must accept reCAPTCHA cookies to send the form',
|
||||
]
|
||||
]
|
||||
];
|
||||
46
lang/es/cookie-notice.php
Normal file
46
lang/es/cookie-notice.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Personalizar las cookies',
|
||||
'button_close_cookies' => 'Cerrar la ventana de cookies',
|
||||
'button_toggle_cookie' => 'Permitir o rechazar',
|
||||
'button_forbid_all' => 'Rechazar todo',
|
||||
'button_allow_all' => 'Aceptar todo',
|
||||
'button_forbid_all_title' => 'Rechazar todas las cookies y cerrar el panel de cookies',
|
||||
'button_allow_all_title' => 'Aceptar todas las cookies y cerrar el panel de cookies',
|
||||
'button_customize' => 'Personalizar',
|
||||
'button_validate_and_close' => 'Validar y cerrar',
|
||||
'button_title_open_new_tab' => 'Abrir el enlace en una nueva pestaña',
|
||||
'banner_title' => 'El sitio web :site_name utiliza cookies' . html_entity_decode(' ') . '!',
|
||||
'banner_text' => 'Utilizamos cookies para garantizar el correcto funcionamiento de nuestro sitio y con fines analíticos.
|
||||
Puede cambiar de opinión en cualquier momento haciendo clic en el icono presente en cada página de nuestro sitio.
|
||||
Al autorizar estos servicios de terceros, acepta el uso de cookies y tecnologías de seguimiento necesarias para su correcto funcionamiento.',
|
||||
'modal_title' => 'Ventana de gestión de cookies',
|
||||
'panel_content' => 'Contenido del panel de cookies',
|
||||
'picture_cookie_title' => 'Imagen de una gran galleta',
|
||||
'navigation_title' => 'Navegación del panel de cookies',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Los servicios de medición de audiencia permiten generar estadísticas de uso útiles para mejorar el sitio.',
|
||||
],
|
||||
'youtube' => [
|
||||
'name' => 'YouTube',
|
||||
'description' => 'Las cookies utilizadas por los servicios de compartición de vídeos permiten al usuario visualizar contenidos multimedia directamente en el sitio.',
|
||||
'labelLink' => 'Saber más',
|
||||
'warning' => 'Debe aceptar las cookies para ver este vídeo',
|
||||
'accept' => 'Aceptar'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Los servicios de medición de audiencia permiten generar estadísticas de uso útiles para mejorar el sitio.',
|
||||
'labelLink' => 'Saber más',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Las cookies utilizadas por reCAPTCHA en los formularios tienen como finalidad evitar que estos sean enviados por robots.',
|
||||
'labelLink' => 'Saber más',
|
||||
'warning' => 'Debe aceptar las cookies de reCAPTCHA para enviar el formulario',
|
||||
]
|
||||
]
|
||||
];
|
||||
46
lang/fr/cookie-notice.php
Normal file
46
lang/fr/cookie-notice.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Personnaliser les cookies',
|
||||
'button_close_cookies' => 'Fermer la fenêtre des cookies',
|
||||
'button_toggle_cookie' => 'Autoriser ou refuser',
|
||||
'button_forbid_all' => 'Tout refuser',
|
||||
'button_allow_all' => 'Tout accepter',
|
||||
'button_forbid_all_title' => 'Refuser tous les cookies et fermer le panneau des cookies',
|
||||
'button_allow_all_title' => 'Accepter tous les cookies et fermer le panneau des cookies',
|
||||
'button_customize' => 'Personnaliser',
|
||||
'button_validate_and_close' => 'Valider et fermer',
|
||||
'button_title_open_new_tab' => 'Ouvrir le lien dans un nouvel onglet',
|
||||
'banner_title' => 'Le site internet :site_name utilise des cookies !',
|
||||
'banner_text' => 'Nous utilisons des cookies pour nous assurer du bon fonctionnement de notre site et à des fins analytiques.
|
||||
Vous pouvez changer d’avis à tout moment en cliquant sur l’icône présente sur chaque page de notre site.
|
||||
En autorisant ces services tiers, vous acceptez le dépôt et la lecture de cookies et l’utilisation de technologies de suivi nécessaires à leur bon fonctionnement.',
|
||||
'modal_title' => 'Fenêtre de gestion de cookies',
|
||||
'panel_content' => 'Contenu du panneau des cookies',
|
||||
'picture_cookie_title' => 'Image d’un bon gros cookie',
|
||||
'navigation_title' => 'Navigation du panneau des cookies',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site.',
|
||||
],
|
||||
'youtube' => [
|
||||
'name' => 'Youtube',
|
||||
'description' => 'Les cookies placés via les services de partage de vidéos sont destinés à permettre à l’utilisateur de visionner des contenus multimédias directement sur le site.',
|
||||
'labelLink' => 'En apprendre plus',
|
||||
'warning' => 'Vous devez accepter les cookies pour visionner cette vidéo',
|
||||
'accept' => 'Autoriser'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Les services de mesure d’audience permettent de générer des statistiques de fréquentation utiles à l’amélioration du site.',
|
||||
'labelLink' => 'En apprendre plus',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Les cookies qui sont déposés via le recaptcha sur les formulaires ont pour finalité d’empêcher que ceux-ci ne soient soumis par des robots.',
|
||||
'labelLink' => 'En apprendre plus',
|
||||
'warning' => 'Vous devez accepter les cookies reCAPTCHA pour envoyer le formulaire',
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -13,5 +13,44 @@ return [
|
|||
"know_more" => "en savoir plus",
|
||||
"ovoteam_commit" => "ovoteam s'engage",
|
||||
"discover_our_commit" => "découvrez nos engagements",
|
||||
"ovoteam_recipe" => "recettes ovoteam"
|
||||
"ovoteam_recipe" => "recettes ovoteam",
|
||||
"image" => [
|
||||
"state_file_uploaded" => "un fichier à bien été chargé",
|
||||
"modale_title" => "Modification de l'image",
|
||||
"modale_description" => "Personnalisez le rendu selon vos besoins",
|
||||
"action_the_crop" => ":action le cadrage",
|
||||
"select_file_zone" => "Glisser-déposer un fichier ou cliquez pour en sélectionner un",
|
||||
"select_img_zone" => "Glisser-déposer une image ou cliquez pour en sélectionner une",
|
||||
"preview_image" => "Prévisualisation de l'image",
|
||||
"refresh_original" => "remettre à l'état d'origine",
|
||||
"toast" => [
|
||||
"too_big" => "taille maximale autorisée : :maxSize. Le fichier est trop volumineux",
|
||||
"no_file" => "aucun fichier sélectionné !",
|
||||
"forbidden_file" => "fichier non autorisé.",
|
||||
"too_many" => "le nombre de fichier autorisé est dépassé (1)",
|
||||
"defaultError" => "une erreur est survenue !"
|
||||
],
|
||||
"validation" => [
|
||||
"rules_between" => "le média doit faire :width px de large et :height px de haut.",
|
||||
"rules_weight" => "taille max: :size",
|
||||
"allowed_formats" => "formats autorisés: :formats",
|
||||
"all_formats" => "tous"
|
||||
],
|
||||
"filters" => [
|
||||
'zoomIn' => "zoom avant",
|
||||
"zoomOut" => "zoom arrière",
|
||||
"zoom" => "zoom",
|
||||
"rotation_forward" => "rotation avant",
|
||||
"rotation_back" => "rotation arrière",
|
||||
"rotation" => "rotation",
|
||||
"grayscale" => "noir & blanc",
|
||||
"sepia" => "sépia",
|
||||
"saturation" => "saturation",
|
||||
"contrast" => "contraste",
|
||||
"brightness" => "luminosité",
|
||||
"reset" => "réinitialiser",
|
||||
"vertical_flip" => "inverser verticalement",
|
||||
"horizontal_flip" => "inverser horizontalement",
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
46
lang/nl/cookie-notice.php
Normal file
46
lang/nl/cookie-notice.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Cookies aanpassen',
|
||||
'button_close_cookies' => 'Cookiewindow sluiten',
|
||||
'button_toggle_cookie' => 'Toestaan of weigeren',
|
||||
'button_forbid_all' => 'Alles weigeren',
|
||||
'button_allow_all' => 'Alles accepteren',
|
||||
'button_forbid_all_title' => 'Alle cookies weigeren en het cookiemenu sluiten',
|
||||
'button_allow_all_title' => 'Alle cookies accepteren en het cookiemenu sluiten',
|
||||
'button_customize' => 'Aanpassen',
|
||||
'button_validate_and_close' => 'Bevestigen en sluiten',
|
||||
'button_title_open_new_tab' => 'Link openen in een nieuw tabblad',
|
||||
'banner_title' => 'De website :site_name gebruikt cookies' . html_entity_decode(' ') . '!',
|
||||
'banner_text' => 'Wij gebruiken cookies om de goede werking van onze website te garanderen en voor analytische doeleinden.
|
||||
U kunt op elk moment van gedachten veranderen door te klikken op het pictogram dat op elke pagina van onze website aanwezig is.
|
||||
Door deze diensten van derden toe te staan, accepteert u het gebruik van cookies en trackingtechnologieën die nodig zijn voor hun goede werking.',
|
||||
'modal_title' => 'Cookiemanagementvenster',
|
||||
'panel_content' => 'Inhoud van het cookiemenu',
|
||||
'picture_cookie_title' => 'Afbeelding van een grote koek',
|
||||
'navigation_title' => 'Navigatie van het cookiemenu',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Diensten voor publieksmeting maken het mogelijk gebruiksstatistieken te genereren die helpen om de website te verbeteren.',
|
||||
],
|
||||
'youtube' => [
|
||||
'name' => 'YouTube',
|
||||
'description' => 'Cookies die via videodeeldiensten worden geplaatst, maken het mogelijk om multimedia-inhoud direct op de website te bekijken.',
|
||||
'labelLink' => 'Meer informatie',
|
||||
'warning' => 'U moet cookies accepteren om deze video te bekijken',
|
||||
'accept' => 'Toestaan'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Diensten voor publieksmeting maken het mogelijk gebruiksstatistieken te genereren die helpen om de website te verbeteren.',
|
||||
'labelLink' => 'Meer informatie',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Cookies die via reCAPTCHA in formulieren worden geplaatst, hebben als doel te voorkomen dat deze door bots worden verzonden.',
|
||||
'labelLink' => 'Meer informatie',
|
||||
'warning' => 'U moet reCAPTCHA-cookies accepteren om het formulier te verzenden',
|
||||
]
|
||||
]
|
||||
];
|
||||
46
lang/pl/cookie-notice.php
Normal file
46
lang/pl/cookie-notice.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'button_customize_cookies' => 'Dostosuj cookies',
|
||||
'button_close_cookies' => 'Zamknij okno cookies',
|
||||
'button_toggle_cookie' => 'Zezwól lub odrzuć',
|
||||
'button_forbid_all' => 'Odrzuć wszystkie',
|
||||
'button_allow_all' => 'Akceptuj wszystkie',
|
||||
'button_forbid_all_title' => 'Odrzuć wszystkie cookies i zamknij panel cookies',
|
||||
'button_allow_all_title' => 'Akceptuj wszystkie cookies i zamknij panel cookies',
|
||||
'button_customize' => 'Dostosuj',
|
||||
'button_validate_and_close' => 'Zatwierdź i zamknij',
|
||||
'button_title_open_new_tab' => 'Otwórz link w nowej karcie',
|
||||
'banner_title' => 'Strona internetowa :site_name używa cookies' . html_entity_decode(' ') . '!',
|
||||
'banner_text' => 'Używamy plików cookies, aby zapewnić prawidłowe działanie naszej strony oraz do celów analitycznych.
|
||||
Możesz zmienić zdanie w dowolnym momencie, klikając ikonę dostępną na każdej stronie naszego serwisu.
|
||||
Zezwalając na te usługi stron trzecich, akceptujesz używanie cookies oraz technologii śledzenia niezbędnych do ich prawidłowego działania.',
|
||||
'modal_title' => 'Okno zarządzania cookies',
|
||||
'panel_content' => 'Zawartość panelu cookies',
|
||||
'picture_cookie_title' => 'Obraz dużego ciasteczka',
|
||||
'navigation_title' => 'Nawigacja panelu cookies',
|
||||
'custom' => [
|
||||
'analytics' => [
|
||||
'title' => 'Google Analytics',
|
||||
'description' => 'Usługi analizy ruchu pozwalają generować statystyki użytkowania, które pomagają ulepszać stronę.',
|
||||
],
|
||||
'youtube' => [
|
||||
'name' => 'YouTube',
|
||||
'description' => 'Cookies używane przez usługi udostępniania wideo umożliwiają użytkownikowi oglądanie treści multimedialnych bezpośrednio na stronie.',
|
||||
'labelLink' => 'Dowiedz się więcej',
|
||||
'warning' => 'Musisz zaakceptować cookies, aby obejrzeć ten film',
|
||||
'accept' => 'Zezwól'
|
||||
],
|
||||
'matomo' => [
|
||||
'title' => 'Matomo',
|
||||
'description' => 'Usługi analizy ruchu pozwalają generować statystyki użytkowania, które pomagają ulepszać stronę.',
|
||||
'labelLink' => 'Dowiedz się więcej',
|
||||
],
|
||||
'recaptcha' => [
|
||||
'title' => 'reCAPTCHA',
|
||||
'description' => 'Cookies stosowane przez reCAPTCHA w formularzach mają na celu zapobieganie ich wysyłaniu przez boty.',
|
||||
'labelLink' => 'Dowiedz się więcej',
|
||||
'warning' => 'Musisz zaakceptować cookies reCAPTCHA, aby wysłać formularz',
|
||||
]
|
||||
]
|
||||
];
|
||||
3551
package-lock.json
generated
3551
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -15,6 +15,7 @@
|
|||
},
|
||||
"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",
|
||||
|
|
@ -75,6 +76,7 @@
|
|||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@inertiajs/core": "^2.1.5",
|
||||
"@inertiajs/react": "^2.3.18",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
"@tiptap/core": "^3.21.0",
|
||||
"@tiptap/extension-blockquote": "^3.21.0",
|
||||
|
|
@ -102,7 +104,6 @@
|
|||
"@tiptap/extension-underline": "^3.21.0",
|
||||
"@tiptap/react": "^3.21.0",
|
||||
"@tiptap/starter-kit": "^3.21.0",
|
||||
"@radix-ui/react-slot": "^1.2.4",
|
||||
"@types/pluralize": "^0.0.33",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
|
|
@ -116,13 +117,14 @@
|
|||
"lucide-react": "^0.503.0",
|
||||
"motion": "^12.38.0",
|
||||
"prosemirror-state": "^1.4.4",
|
||||
"radix-ui": "^1.4.3",
|
||||
"react-color": "^2.19.3",
|
||||
"react-dropzone": "^14.4.1",
|
||||
"react-image-crop": "^11.0.10",
|
||||
"radix-ui": "^1.4.3",
|
||||
"slugify": "^1.6.8",
|
||||
"swiper": "^12.1.3",
|
||||
"tailwind-merge": "^3.5.0",
|
||||
"vaul": "^1.1.2",
|
||||
"ziggy-js": "^2.6.2",
|
||||
"zod": "^4.3.6",
|
||||
"zustand": "^5.0.12"
|
||||
|
|
|
|||
|
|
@ -1,56 +1,3 @@
|
|||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
--primary: 40 100% 64%;
|
||||
--primary-foreground: 227 65% 19%;
|
||||
--background: 0 0% 100%;
|
||||
--secondary: 210 40% 96.1%;
|
||||
--secondary-foreground: 222.2 47.4% 11.2%;
|
||||
--accent: 220 14% 96%;
|
||||
--accent-foreground: 227 51% 23%;
|
||||
--foreground: 227 65% 19%;
|
||||
|
||||
|
||||
|
||||
--muted: 210 40% 96.1%;
|
||||
--muted-foreground: 215.4 16.3% 46.9%;
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 222.2 84% 4.9%;
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 222.2 84% 4.9%;
|
||||
--border: 214.3 31.8% 91.4%;
|
||||
--input: 214.3 31.8% 91.4%;
|
||||
|
||||
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 210 40% 98%;
|
||||
--successive: 113 100% 38%;
|
||||
--successive-foreground: 210 40% 98%;
|
||||
--informative: 207 69% 48%;
|
||||
--informative-foreground: 210 40% 98%;
|
||||
--preventive: 46 100% 50%;
|
||||
--preventive-foreground: 210 40% 98%;
|
||||
--ring: 222.2 84% 4.9%;
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
* {
|
||||
@apply border-border font-gotham;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
.swiper-pagination {
|
||||
@apply w-full flex justify-center items-center;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,58 @@
|
|||
// * COMMON CSS.
|
||||
@use './../common';
|
||||
|
||||
@use './fonts';
|
||||
@use './vendor/_cookie-notice';
|
||||
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
--primary: 40 100% 64%;
|
||||
--primary-foreground: 227 65% 19%;
|
||||
--background: 0 0% 100%;
|
||||
--secondary: 210 40% 96.1%;
|
||||
--secondary-foreground: 222.2 47.4% 11.2%;
|
||||
--accent: 220 14% 96%;
|
||||
--accent-foreground: 227 51% 23%;
|
||||
--foreground: 227 65% 19%;
|
||||
|
||||
|
||||
|
||||
--muted: 210 40% 96.1%;
|
||||
--muted-foreground: 215.4 16.3% 46.9%;
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 222.2 84% 4.9%;
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 222.2 84% 4.9%;
|
||||
--border: 214.3 31.8% 91.4%;
|
||||
--input: 214.3 31.8% 91.4%;
|
||||
|
||||
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 210 40% 98%;
|
||||
--successive: 113 100% 38%;
|
||||
--successive-foreground: 210 40% 98%;
|
||||
--informative: 207 69% 48%;
|
||||
--informative-foreground: 210 40% 98%;
|
||||
--preventive: 46 100% 50%;
|
||||
--preventive-foreground: 210 40% 98%;
|
||||
--ring: 222.2 84% 4.9%;
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
|
||||
* {
|
||||
@apply border-border font-gotham;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
.swiper-pagination {
|
||||
@apply w-full flex justify-center items-center;
|
||||
}
|
||||
|
|
|
|||
36
resources/sass/front/vendor/_cookie-notice.scss
vendored
Normal file
36
resources/sass/front/vendor/_cookie-notice.scss
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
@use "@ldc-web/cookie-notice/src/scss/variables" with (
|
||||
$ck-primary-color: hsl(227 65% 19%),
|
||||
$ck-secondary-color: hsl(227 65% 19%),
|
||||
$cn-button-bg-color: hsl(40 100% 64%),
|
||||
$ck-title-font: "Gotham",
|
||||
$ck-text-font: "Gotham",
|
||||
$ck-btn-background-color: hsl(40 100% 64%),
|
||||
);
|
||||
@use "@ldc-web/cookie-notice/src/scss/themes/standard";
|
||||
|
||||
.cn-banner-img {
|
||||
width: 150px !important;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.cn-cookie-wrapper {
|
||||
background-color: hsl(40 100% 64%);
|
||||
}
|
||||
|
||||
.cn-banner-btn {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cn-content {
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
#cn-cookie-btn svg {
|
||||
path {
|
||||
fill: hsl(227 65% 19%);
|
||||
}
|
||||
|
||||
circle {
|
||||
fill: hsl(227 65% 19%);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@ import { createInertiaApp } from "@inertiajs/react";
|
|||
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
|
||||
import { createRoot } from "react-dom/client";
|
||||
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";
|
||||
|
|
@ -27,3 +30,6 @@ createInertiaApp({
|
|||
|
||||
window.axios = axios;
|
||||
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
||||
|
||||
window.CookieNotice = CookieNotice;
|
||||
window.Recaptcha = recaptcha;
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
// * Packages
|
||||
import { createInertiaApp } from "@inertiajs/react";
|
||||
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import axios from "axios";
|
||||
|
||||
// @ts-expect-error Env is always present.
|
||||
const appName = import.meta.env.VITE_APP_NAME || "Laravel";
|
||||
|
||||
createInertiaApp({
|
||||
title: (title) => `${title} - ${appName}`,
|
||||
resolve: (name) =>
|
||||
resolvePageComponent(
|
||||
`./Pages/${name}.tsx`,
|
||||
// @ts-expect-error Glob error.
|
||||
import.meta.glob("./Pages/**/*.tsx"),
|
||||
),
|
||||
setup({ el, App, props }) {
|
||||
const root = createRoot(el);
|
||||
|
||||
// eslint-disable-next-line react/jsx-filename-extension, react/jsx-props-no-spreading
|
||||
root.render(<App {...props} />);
|
||||
},
|
||||
progress: {
|
||||
color: "#4B5563",
|
||||
},
|
||||
});
|
||||
|
||||
window.axios = axios;
|
||||
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
||||
132
resources/ts/components/ui/drawer.tsx
Normal file
132
resources/ts/components/ui/drawer.tsx
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
import * as React from "react"
|
||||
import { Drawer as DrawerPrimitive } from "vaul"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
function Drawer({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Root>) {
|
||||
return <DrawerPrimitive.Root data-slot="drawer" {...props} />
|
||||
}
|
||||
|
||||
function DrawerTrigger({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
||||
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
|
||||
}
|
||||
|
||||
function DrawerPortal({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
||||
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
|
||||
}
|
||||
|
||||
function DrawerClose({
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
||||
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
|
||||
}
|
||||
|
||||
function DrawerOverlay({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
|
||||
return (
|
||||
<DrawerPrimitive.Overlay
|
||||
data-slot="drawer-overlay"
|
||||
className={cn(
|
||||
"fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function DrawerContent({
|
||||
className,
|
||||
children,
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Content>) {
|
||||
return (
|
||||
<DrawerPortal data-slot="drawer-portal">
|
||||
<DrawerOverlay />
|
||||
<DrawerPrimitive.Content
|
||||
data-slot="drawer-content"
|
||||
className={cn(
|
||||
"group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<div className="mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
||||
{children}
|
||||
</DrawerPrimitive.Content>
|
||||
</DrawerPortal>
|
||||
)
|
||||
}
|
||||
|
||||
function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="drawer-header"
|
||||
className={cn(
|
||||
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="drawer-footer"
|
||||
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function DrawerTitle({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
||||
return (
|
||||
<DrawerPrimitive.Title
|
||||
data-slot="drawer-title"
|
||||
className={cn(
|
||||
"cn-font-heading text-base font-medium text-foreground",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function DrawerDescription({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof DrawerPrimitive.Description>) {
|
||||
return (
|
||||
<DrawerPrimitive.Description
|
||||
data-slot="drawer-description"
|
||||
className={cn("text-sm text-muted-foreground", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
Drawer,
|
||||
DrawerPortal,
|
||||
DrawerOverlay,
|
||||
DrawerTrigger,
|
||||
DrawerClose,
|
||||
DrawerContent,
|
||||
DrawerHeader,
|
||||
DrawerFooter,
|
||||
DrawerTitle,
|
||||
DrawerDescription,
|
||||
}
|
||||
154
resources/ts/components/ui/input-group.tsx
Normal file
154
resources/ts/components/ui/input-group.tsx
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
import * as React from "react"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
|
||||
function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="input-group"
|
||||
role="group"
|
||||
className={cn(
|
||||
"group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const inputGroupAddonVariants = cva(
|
||||
"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
|
||||
{
|
||||
variants: {
|
||||
align: {
|
||||
"inline-start":
|
||||
"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
|
||||
"inline-end":
|
||||
"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
|
||||
"block-start":
|
||||
"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
||||
"block-end":
|
||||
"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
align: "inline-start",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
function InputGroupAddon({
|
||||
className,
|
||||
align = "inline-start",
|
||||
...props
|
||||
}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
|
||||
return (
|
||||
<div
|
||||
role="group"
|
||||
data-slot="input-group-addon"
|
||||
data-align={align}
|
||||
className={cn(inputGroupAddonVariants({ align }), className)}
|
||||
onClick={(e) => {
|
||||
if ((e.target as HTMLElement).closest("button")) {
|
||||
return
|
||||
}
|
||||
e.currentTarget.parentElement?.querySelector("input")?.focus()
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const inputGroupButtonVariants = cva(
|
||||
"flex items-center gap-2 text-sm shadow-none",
|
||||
{
|
||||
variants: {
|
||||
size: {
|
||||
xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
||||
sm: "",
|
||||
"icon-xs":
|
||||
"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
|
||||
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
size: "xs",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
function InputGroupButton({
|
||||
className,
|
||||
type = "button",
|
||||
variant = "ghost",
|
||||
size = "xs",
|
||||
...props
|
||||
}: Omit<React.ComponentProps<typeof Button>, "size"> &
|
||||
VariantProps<typeof inputGroupButtonVariants>) {
|
||||
return (
|
||||
<Button
|
||||
type={type}
|
||||
data-size={size}
|
||||
variant={variant}
|
||||
className={cn(inputGroupButtonVariants({ size }), className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function InputGroupInput({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<"input">) {
|
||||
return (
|
||||
<Input
|
||||
data-slot="input-group-control"
|
||||
className={cn(
|
||||
"flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function InputGroupTextarea({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<"textarea">) {
|
||||
return (
|
||||
<Textarea
|
||||
data-slot="input-group-control"
|
||||
className={cn(
|
||||
"flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
InputGroup,
|
||||
InputGroupAddon,
|
||||
InputGroupButton,
|
||||
InputGroupText,
|
||||
InputGroupInput,
|
||||
InputGroupTextarea,
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
// * Packages
|
||||
import { Link } from "@inertiajs/react";
|
||||
import {
|
||||
ButtonHTMLAttributes,
|
||||
CSSProperties,
|
||||
MouseEventHandler,
|
||||
ReactNode,
|
||||
} from "react";
|
||||
import { VariantProps } from "class-variance-authority";
|
||||
// * Components shadcn
|
||||
import { Button, buttonVariants } from "@/components/ui/button";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
|
||||
type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
||||
type ButtonSize = VariantProps<typeof buttonVariants>["size"];
|
||||
type ButtonType = ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
||||
|
||||
type BtnOptionnalLinkWithTooltipProps = {
|
||||
link?: string | null;
|
||||
content: ReactNode;
|
||||
tooltipContent: ReactNode;
|
||||
className?: string;
|
||||
type?: ButtonType;
|
||||
size?: ButtonSize;
|
||||
variant?: ButtonVariant;
|
||||
externalLink?: boolean;
|
||||
disabled?: boolean;
|
||||
style?: CSSProperties;
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||
};
|
||||
|
||||
export default function BtnOptionnalLinkWithTooltip({
|
||||
link = null,
|
||||
content,
|
||||
tooltipContent,
|
||||
className = "",
|
||||
type = "button",
|
||||
size = "icon",
|
||||
variant = "default",
|
||||
externalLink = false,
|
||||
disabled = false,
|
||||
style,
|
||||
onClick,
|
||||
...props
|
||||
}: BtnOptionnalLinkWithTooltipProps) {
|
||||
let innerContent: ReactNode = content;
|
||||
|
||||
if (link !== null) {
|
||||
if (externalLink) {
|
||||
innerContent = disabled ? (
|
||||
<Button disabled>{content}</Button>
|
||||
) : (
|
||||
<a href={link} target="_blank" rel="noreferrer">
|
||||
{content}
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
innerContent = <Link href={link}>{content}</Link>;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant={variant}
|
||||
size={size}
|
||||
className={className}
|
||||
type={type}
|
||||
asChild={link !== null}
|
||||
disabled={disabled}
|
||||
onClick={onClick}
|
||||
style={style}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
>
|
||||
{innerContent}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{tooltipContent}</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { useInView } from "@/hooks/use-in-view";
|
||||
import useInView from "@/hooks/use-in-view";
|
||||
import CarouselContent from "./CarouselContent";
|
||||
import { CarouselPropsWithNavigation } from "@/types/front";
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import 'swiper/css/pagination';
|
|||
import ItemCard from "$/uwil/ItemCard";
|
||||
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;
|
||||
|
|
@ -92,7 +93,7 @@ const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
|||
pagination={pagination}
|
||||
navigation={carousel?.navigation}
|
||||
breakpoints={breakpoints}
|
||||
wrapperClass="pb-20"
|
||||
wrapperClass={cn("pb-20", carousel?.wrapperClass)}
|
||||
className="w-full"
|
||||
>
|
||||
{items.map((item, index) => {
|
||||
|
|
@ -104,6 +105,8 @@ const CarouselContent = (props: CarouselPropsWithNavigation) => {
|
|||
<ItemCard
|
||||
image={{lazyload: true, ...item.image}}
|
||||
title={item.title}
|
||||
subtitle={item.subtitle}
|
||||
description={item.description}
|
||||
button={item.button}
|
||||
variant={variant}
|
||||
/>
|
||||
|
|
|
|||
41
resources/ts/front/Components/Base/InputError.tsx
Normal file
41
resources/ts/front/Components/Base/InputError.tsx
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
// * Packages
|
||||
import { AlertCircleIcon } from "lucide-react";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
// * Components shadcn
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
// * Other
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export default function InputError({
|
||||
all,
|
||||
message,
|
||||
}: {
|
||||
all?: boolean;
|
||||
message?: string;
|
||||
}) {
|
||||
const { errors } = usePage().props;
|
||||
const errorsTrans = useTrans("uwil-backend::back.errors");
|
||||
let messages = {} as Array<string>;
|
||||
if (message) {
|
||||
messages = Object.values([message]);
|
||||
} else if (Object.values(errors).length && all) {
|
||||
messages = Object.values(errors);
|
||||
}
|
||||
if (messages.length) {
|
||||
return (
|
||||
<Alert
|
||||
variant="destructive"
|
||||
className={cn("text-left ", { "mb-4": all })}
|
||||
>
|
||||
<AlertCircleIcon className="h-4 w-4" />
|
||||
{all && <AlertTitle>{errorsTrans}</AlertTitle>}
|
||||
<AlertDescription>
|
||||
{messages.map((errorMessage) => {
|
||||
return <p key={errorMessage}>{errorMessage}</p>;
|
||||
})}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
}
|
||||
245
resources/ts/front/Components/Base/Inputs/EnumSelect.tsx
Normal file
245
resources/ts/front/Components/Base/Inputs/EnumSelect.tsx
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
// * Packages
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { CheckIcon, ChevronsUpDownIcon, SearchIcon, XIcon } from "lucide-react";
|
||||
// * Components shadcn
|
||||
import { Label } from "@/components/ui/label";
|
||||
import {
|
||||
Popover,
|
||||
PopoverContent,
|
||||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
// * Other
|
||||
import BtnOptionnalLinkWithTooltip from "@/front/Components/Base/BtnOptionnalLinkWithTooltip";
|
||||
import InputError from "@/front/Components/Base/InputError";
|
||||
import { AppEnv } from "@/types/global";
|
||||
import { cn } from "@/lib/utils";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import str from "@/hooks/use-string";
|
||||
|
||||
type EnumSelectProps = {
|
||||
name: string;
|
||||
label: string;
|
||||
options?: Record<string, { label: string; name: string; value: number }>;
|
||||
placeholder?: string;
|
||||
exclude?: number[];
|
||||
selected?: number | null;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
parentErrors?: Record<string, string> | null;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
setData: (name: string, value: number | null) => void;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
onSelectValue?: (value: number | null) => void;
|
||||
};
|
||||
|
||||
export default function EnumSelect({
|
||||
name,
|
||||
label,
|
||||
options = {},
|
||||
placeholder = "ex: John Doe",
|
||||
exclude = [],
|
||||
selected = null,
|
||||
required = true,
|
||||
disabled = false,
|
||||
parentErrors = null,
|
||||
className,
|
||||
setData,
|
||||
onSelectValue,
|
||||
}: EnumSelectProps) {
|
||||
const { locale } = usePage().props.appEnv as AppEnv;
|
||||
const { errors } = usePage().props;
|
||||
const localErrors = parentErrors ?? errors;
|
||||
|
||||
// List of options.
|
||||
const initalOptions = Object.fromEntries(
|
||||
Object.entries(options).filter(([, item]) => !exclude.includes(item.value)),
|
||||
);
|
||||
const [currentOptions, setCurrentOptions] =
|
||||
useState<Record<string, { label: string; name: string; value: number }>>(
|
||||
initalOptions,
|
||||
);
|
||||
|
||||
// Model key selected.
|
||||
const initial =
|
||||
selected === 0 || selected === null || selected === undefined
|
||||
? null
|
||||
: Number(selected);
|
||||
const [selectedEnum, setSelectedEnum] = useState<number | null>(initial);
|
||||
|
||||
// String research in models collection.
|
||||
const [search, setSearch] = useState<string>("");
|
||||
|
||||
// Component states.
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
|
||||
const transNoResults = useTrans("uwil-backend::back.table_no_results");
|
||||
const transDelete = useTrans("uwil-backend::crud.actions.delete");
|
||||
|
||||
/**
|
||||
* Get the identification field of specific option.
|
||||
* @param value number
|
||||
* @return string
|
||||
*/
|
||||
const getEnumLabel = (value: number): string => {
|
||||
const targetEnum = Object.values(initalOptions).find(
|
||||
(option) => option.value === value,
|
||||
);
|
||||
if (!targetEnum) return String(value);
|
||||
if (typeof value === "object")
|
||||
return String(
|
||||
targetEnum.label[locale as keyof typeof targetEnum.label] ?? "",
|
||||
);
|
||||
return targetEnum.label;
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates when selecting new value.
|
||||
* @param value number
|
||||
* @return void
|
||||
*/
|
||||
const handleSelect = (value: number) => {
|
||||
setSelectedEnum(value);
|
||||
setData(name, value);
|
||||
onSelectValue?.(value);
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates when clear the selected value.
|
||||
* @return void
|
||||
*/
|
||||
const handleClear = () => {
|
||||
setSelectedEnum(null);
|
||||
setData(name, null);
|
||||
onSelectValue?.(null);
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset the search.
|
||||
* @return void
|
||||
*/
|
||||
const handleClearSearch = () => {
|
||||
setSearch("");
|
||||
};
|
||||
|
||||
// Fetch with debounce.
|
||||
useEffect(() => {
|
||||
// Reset options list if empty search or null
|
||||
if (search.length === 0) {
|
||||
setCurrentOptions(initalOptions);
|
||||
return;
|
||||
}
|
||||
|
||||
const optionsFiltered = Object.fromEntries(
|
||||
Object.entries(initalOptions).filter(([, item]) =>
|
||||
item.label.toLowerCase().includes(search),
|
||||
),
|
||||
);
|
||||
|
||||
// Get updated options list with search.
|
||||
setCurrentOptions(optionsFiltered);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [search, options]);
|
||||
|
||||
return (
|
||||
<div className={cn("flex flex-col w-full gap-1.5", className)}>
|
||||
<Label htmlFor={name} className="flex items-center gap-1.5">
|
||||
{label}
|
||||
{required && " *"}
|
||||
</Label>
|
||||
<div className="flex items-center gap-1.5 w-full">
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
role="combobox"
|
||||
aria-expanded={open}
|
||||
disabled={disabled}
|
||||
className={cn(
|
||||
"w-full h-10 justify-between whitespace-normal text-start rounded-full",
|
||||
{ "text-muted-foreground": !selectedEnum },
|
||||
{ "border-destructive/50": localErrors[name] },
|
||||
)}
|
||||
>
|
||||
{selectedEnum
|
||||
? str(getEnumLabel(selectedEnum)).ucFirst().value()
|
||||
: placeholder}
|
||||
<ChevronsUpDownIcon className="opacity-50" />
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-[var(--radix-popover-trigger-width)] p-0">
|
||||
<div className="relative">
|
||||
<div className="absolute top-1/2 left-2 transform -translate-y-1/2 text-muted-foreground">
|
||||
<SearchIcon className="w-4 h-4" />
|
||||
</div>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder={placeholder}
|
||||
value={search}
|
||||
disabled={disabled}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
className="w-[calc(100%-2.5rem-40px)] border-0 mx-9"
|
||||
/>
|
||||
<BtnOptionnalLinkWithTooltip
|
||||
content={<XIcon />}
|
||||
tooltipContent={
|
||||
<p>
|
||||
{str(useTrans("uwil-backend::crud.actions.delete"))
|
||||
.ucFirst()
|
||||
.value()}
|
||||
</p>
|
||||
}
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute top-1/2 right-0 transform -translate-y-1/2 text-muted-foreground"
|
||||
onClick={handleClearSearch}
|
||||
disabled={search.length < 1 || disabled}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
`overflow-auto border-t flex flex-col justify-between p-1 gap-1 ${Object.values(initalOptions).length > 5 ? "h-[225px]" : "h-auto"}`,
|
||||
)}
|
||||
>
|
||||
{Object.values(currentOptions).length === 0 && (
|
||||
<p className="text-sm text-muted-foreground text-center py-5">
|
||||
{transNoResults}
|
||||
</p>
|
||||
)}
|
||||
<div className="flex flex-col justify-between">
|
||||
{Object.values(currentOptions).map((option) => (
|
||||
<Button
|
||||
key={option.value}
|
||||
className="w-full h-auto min-h-10 justify-between whitespace-normal text-start"
|
||||
variant="ghost"
|
||||
disabled={disabled}
|
||||
onClick={() => handleSelect(option.value)}
|
||||
>
|
||||
<span>{str(option.label).ucFirst().value()}</span>
|
||||
{selectedEnum === option.value && <CheckIcon />}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
{!required && selectedEnum !== null && (
|
||||
<BtnOptionnalLinkWithTooltip
|
||||
content={<XIcon />}
|
||||
tooltipContent={<p>{str(transDelete).ucFirst().value()}</p>}
|
||||
type="button"
|
||||
variant="destructive"
|
||||
size="icon"
|
||||
onClick={handleClear}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<InputError message={localErrors[name]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
213
resources/ts/front/Components/Base/Inputs/FilterDropdown.tsx
Normal file
213
resources/ts/front/Components/Base/Inputs/FilterDropdown.tsx
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
/** OTHER */
|
||||
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 {
|
||||
Accordion,
|
||||
AccordionContent,
|
||||
AccordionItem,
|
||||
AccordionTrigger,
|
||||
} 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"
|
||||
|
||||
export interface FilterOption {
|
||||
id: string
|
||||
label: string
|
||||
checked?: boolean
|
||||
}
|
||||
|
||||
interface FilterDropdownProps {
|
||||
/** Le texte du bouton */
|
||||
label?: string
|
||||
/** Les options de filtre */
|
||||
options: FilterOption[]
|
||||
/** Callback quand les filtres changent */
|
||||
onChange?: (selectedIds: string[]) => void
|
||||
/** Ouvrir au survol en plus du clic */
|
||||
openOnHover?: boolean
|
||||
/** Délai avant fermeture au survol (ms) */
|
||||
hoverCloseDelay?: number
|
||||
/** Classes additionnelles pour le bouton */
|
||||
className?: string
|
||||
/** Value of the input */
|
||||
value: string[];
|
||||
isMobile?: boolean
|
||||
}
|
||||
|
||||
export function FilterDropdown({
|
||||
label = "Filtres",
|
||||
options,
|
||||
onChange,
|
||||
openOnHover = false,
|
||||
hoverCloseDelay = 200,
|
||||
className,
|
||||
value,
|
||||
isMobile = false
|
||||
}: FilterDropdownProps) {
|
||||
const [open, setOpen] = React.useState(false)
|
||||
const selected = new Set(value);
|
||||
const selectedCount = value.length;
|
||||
const closeTimeoutRef = React.useRef<NodeJS.Timeout | null>(null)
|
||||
|
||||
const handleCheckedChange = (id: string, checked: boolean) => {
|
||||
let next: string[];
|
||||
|
||||
if (checked) {
|
||||
next = [...value, id];
|
||||
} else {
|
||||
next = value.filter((v) => v !== id);
|
||||
}
|
||||
|
||||
onChange?.(next);
|
||||
};
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
if (!openOnHover) return
|
||||
if (closeTimeoutRef.current) {
|
||||
clearTimeout(closeTimeoutRef.current)
|
||||
closeTimeoutRef.current = null
|
||||
}
|
||||
setOpen(true)
|
||||
}
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
if (!openOnHover) return
|
||||
closeTimeoutRef.current = setTimeout(() => {
|
||||
setOpen(false)
|
||||
}, hoverCloseDelay)
|
||||
}
|
||||
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
// <Button variant={"default"} className={cn("gap-2", className)}
|
||||
// icon={{
|
||||
// icon: "chevron-right",
|
||||
// placement: sidePlacements.RIGHT,
|
||||
// className: cn("transition-transform", open ? "rotate-90" : "")
|
||||
// }}
|
||||
// >
|
||||
// {label}
|
||||
// {selectedCount > 0 && (
|
||||
// <span className="bg-primary-foreground text-background ml-1 flex size-5 items-center justify-center rounded-full text-xs font-medium">
|
||||
// {selectedCount}
|
||||
// </span>
|
||||
// )}
|
||||
// </Button>
|
||||
<div className="flex gap-1 items-start">
|
||||
<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">
|
||||
{label}
|
||||
{selectedCount > 0 && (
|
||||
<span className="bg-primary-foreground text-background ml-1 flex size-5 items-center justify-center rounded-full text-xs font-medium">
|
||||
{selectedCount}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<div className="flex flex-wrap gap-1 text-primary-foreground mt-4">
|
||||
{options.map((option) => (
|
||||
<label
|
||||
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"
|
||||
>
|
||||
<Checkbox
|
||||
id={option.id}
|
||||
className="rounded-full bg-background data-[state=checked]:bg-primary-foreground data-[state=checked]:text-primary-foreground"
|
||||
checked={selected.has(option.id)}
|
||||
onCheckedChange={(checked) =>
|
||||
handleCheckedChange(option.id, checked === true)
|
||||
}
|
||||
/>
|
||||
<Label htmlFor={option.id} className={cn("cursor-pointer text-sm font-normal", fonts.DELIUS_SWASH)}>
|
||||
{option.label}
|
||||
</Label>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</AccordionContent>
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Popover open={open} onOpenChange={setOpen}>
|
||||
<div
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
className="inline-block"
|
||||
>
|
||||
<PopoverTrigger asChild>
|
||||
<Button variant={"default"} className={cn("gap-2", className)}
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: sidePlacements.RIGHT,
|
||||
className: cn("transition-transform", open ? "rotate-90" : "")
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
{selectedCount > 0 && (
|
||||
<span className="bg-primary-foreground text-background ml-1 flex size-5 items-center justify-center rounded-full text-xs font-medium">
|
||||
{selectedCount}
|
||||
</span>
|
||||
)}
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
align="start"
|
||||
className="w-96 p-2"
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
>
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{options.map((option) => (
|
||||
<label
|
||||
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"
|
||||
>
|
||||
<Checkbox
|
||||
id={option.id}
|
||||
className="rounded-full bg-background data-[state=checked]:bg-primary-foreground data-[state=checked]:text-primary-foreground"
|
||||
checked={selected.has(option.id)}
|
||||
onCheckedChange={(checked) =>
|
||||
handleCheckedChange(option.id, checked === true)
|
||||
}
|
||||
/>
|
||||
<Label htmlFor={option.id} className={cn("cursor-pointer text-sm font-normal", fonts.DELIUS_SWASH)}>
|
||||
{option.label}
|
||||
</Label>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
{selectedCount > 0 && (
|
||||
<div className="border-border mt-2 border-t pt-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="text-muted-foreground h-8 w-full text-xs"
|
||||
onClick={() => onChange?.([])}
|
||||
>
|
||||
Effacer les filtres
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</PopoverContent>
|
||||
</div>
|
||||
</Popover>
|
||||
)
|
||||
}
|
||||
31
resources/ts/front/Components/Base/Inputs/SearchInput.tsx
Normal file
31
resources/ts/front/Components/Base/Inputs/SearchInput.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// * Packages
|
||||
import { SearchIcon } from "lucide-react";
|
||||
import { useForm } from "@inertiajs/react";
|
||||
// * Components shadcn
|
||||
import { Button } from "@/components/ui/button";
|
||||
// * Other
|
||||
import InputError from "@/front/Components/Base/InputError";
|
||||
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group";
|
||||
|
||||
|
||||
export default function SearchInput() {
|
||||
const { data, setData, processing, errors } = useForm({
|
||||
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">
|
||||
<SearchIcon />
|
||||
</Button>
|
||||
</InputGroupAddon>
|
||||
</InputGroup>
|
||||
<InputError message={errors["search"]} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
51
resources/ts/front/Components/Base/Inputs/SimpleCheckbox.tsx
Normal file
51
resources/ts/front/Components/Base/Inputs/SimpleCheckbox.tsx
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
import { ReactNode } from "react";
|
||||
import InputError from "$/base/InputError";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type SimpleCheckboxProps = {
|
||||
className?: string;
|
||||
name: string;
|
||||
label: ReactNode | string;
|
||||
value?: boolean;
|
||||
id?: string;
|
||||
disabled?: boolean;
|
||||
parentErrors?: Record<string, string> | null;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
setData: (name: string, value: boolean) => void;
|
||||
};
|
||||
|
||||
export default function SimpleCheckbox({
|
||||
className,
|
||||
value = false,
|
||||
name,
|
||||
label,
|
||||
id = name,
|
||||
disabled = false,
|
||||
parentErrors = null,
|
||||
setData,
|
||||
}: SimpleCheckboxProps) {
|
||||
const { errors } = usePage().props;
|
||||
const localErrors = parentErrors ?? errors;
|
||||
return (
|
||||
<div className={cn(className)}>
|
||||
<div className="flex items-start gap-4">
|
||||
<Checkbox
|
||||
id={id}
|
||||
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))
|
||||
}}
|
||||
/>
|
||||
<Label htmlFor={id} className="font-normal">
|
||||
{label}
|
||||
</Label>
|
||||
</div>
|
||||
<InputError message={localErrors[name]} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
294
resources/ts/front/Components/Base/Inputs/SimpleImage.tsx
Normal file
294
resources/ts/front/Components/Base/Inputs/SimpleImage.tsx
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
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>
|
||||
)
|
||||
}
|
||||
108
resources/ts/front/Components/Base/Inputs/SimpleString.tsx
Normal file
108
resources/ts/front/Components/Base/Inputs/SimpleString.tsx
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
// * Packages
|
||||
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
||||
import { useState, useEffect, useRef, ReactNode } from "react";
|
||||
import { usePage } from "@inertiajs/react";
|
||||
// * Components shadcn
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Button } from "@/components/ui/button";
|
||||
// * Other
|
||||
import { cn } from "@/lib/utils";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import InputError from "@/front/Components/Base/InputError";
|
||||
|
||||
type SimpleStringProps = {
|
||||
className?: string;
|
||||
name: string;
|
||||
label: ReactNode | string;
|
||||
value?: string;
|
||||
id?: string;
|
||||
type?: string;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
/** Pattern is regex without antislash */
|
||||
pattern?: string;
|
||||
checkVisibility?: boolean;
|
||||
parentErrors?: Record<string, string> | null;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
setData: (name: string, value: string) => void;
|
||||
};
|
||||
|
||||
export default function SimpleString({
|
||||
className,
|
||||
value = "",
|
||||
name,
|
||||
label,
|
||||
id = name,
|
||||
type = "text",
|
||||
placeholder = "uwil-backend::back.enter_text_here",
|
||||
required = true,
|
||||
disabled = false,
|
||||
pattern,
|
||||
checkVisibility = false,
|
||||
parentErrors = null,
|
||||
setData,
|
||||
}: SimpleStringProps) {
|
||||
const [isVisible, setIsVisible] = useState(checkVisibility);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const { errors } = usePage().props;
|
||||
const localErrors = parentErrors ?? errors;
|
||||
|
||||
useEffect(() => {
|
||||
if (inputRef.current && inputRef.current.value !== value) {
|
||||
inputRef.current.value = value;
|
||||
}
|
||||
}, [value]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col w-full justify-between items-start gap-1.5",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<Label htmlFor={id} className="flex items-center gap-1.5">
|
||||
{label}
|
||||
{required && " *"}
|
||||
</Label>
|
||||
<div className="flex w-full">
|
||||
<Input
|
||||
id={id}
|
||||
name={name}
|
||||
type={isVisible ? "text" : type}
|
||||
placeholder={useTrans(placeholder)}
|
||||
defaultValue={value}
|
||||
ref={inputRef}
|
||||
onChange={(e) => {
|
||||
setData(name, e.target.value);
|
||||
}}
|
||||
required={required}
|
||||
disabled={disabled}
|
||||
className={cn(
|
||||
"rounded-full",
|
||||
type === "password" || checkVisibility
|
||||
? "w-[calc(100%-40px-0.25rem)]"
|
||||
: "w-full",
|
||||
{ "border-destructive/50": localErrors[name] },
|
||||
)}
|
||||
pattern={pattern ?? undefined}
|
||||
/>
|
||||
{(type === "password" || checkVisibility) && (
|
||||
<Button
|
||||
className="ms-1"
|
||||
type="button"
|
||||
size="icon"
|
||||
onClick={() => {
|
||||
setIsVisible(!isVisible);
|
||||
}}
|
||||
>
|
||||
<EyeOffIcon className={!isVisible ? "hidden " : ""} />
|
||||
<EyeIcon className={isVisible ? "hidden" : ""} />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<InputError message={localErrors[name]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
70
resources/ts/front/Components/Base/Inputs/SimpleTextarea.tsx
Normal file
70
resources/ts/front/Components/Base/Inputs/SimpleTextarea.tsx
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
// * Packages
|
||||
import { usePage } from "@inertiajs/react";
|
||||
// * Components shadcn
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
// * Other
|
||||
import InputError from "@/front/Components/Base/InputError";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type SimpleTextareaProps = {
|
||||
className?: string;
|
||||
name: string;
|
||||
label: string;
|
||||
value?: string;
|
||||
id?: string;
|
||||
placeholder?: string;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
parentErrors?: Record<string, string> | null;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
setData: (name: string, value: string) => void;
|
||||
};
|
||||
|
||||
export default function SimpleTextarea({
|
||||
className,
|
||||
name,
|
||||
label,
|
||||
value = "",
|
||||
id = name,
|
||||
placeholder = "uwil-backend::back.enter_text_here",
|
||||
required = true,
|
||||
disabled = false,
|
||||
parentErrors = null,
|
||||
setData,
|
||||
}: SimpleTextareaProps) {
|
||||
const { errors } = usePage().props;
|
||||
const localErrors = parentErrors ?? errors;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col w-full justify-between items-start gap-1.5",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<Label htmlFor={id} className="flex items-center gap-1.5">
|
||||
{label}
|
||||
{required && " *"}
|
||||
</Label>
|
||||
<div className="flex w-full">
|
||||
<Textarea
|
||||
id={id}
|
||||
name={name}
|
||||
placeholder={useTrans(placeholder)}
|
||||
defaultValue={value}
|
||||
onChange={(e) => {
|
||||
setData(name, e.target.value);
|
||||
}}
|
||||
required={required}
|
||||
disabled={disabled}
|
||||
className={cn("w-full", {
|
||||
"border-destructive/50": localErrors[name],
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
<InputError message={localErrors[name]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
62
resources/ts/front/Components/Base/VideoEmbedWithConsent.tsx
Normal file
62
resources/ts/front/Components/Base/VideoEmbedWithConsent.tsx
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
import { Loader } from "lucide-react";
|
||||
import { cn, GetTranslation } from "@/lib/utils";
|
||||
import { useCookieVideoConsent } from "@/hooks/use-cookie-video-consent";
|
||||
import { VideoProviderName } from "@/front/lib/constants";
|
||||
|
||||
type Props = {
|
||||
service: VideoProviderName;
|
||||
embedUrl: string;
|
||||
title: string;
|
||||
className?: string;
|
||||
iframeContainerClassName?: string;
|
||||
};
|
||||
|
||||
const VideoEmbedWithConsent = ({
|
||||
service,
|
||||
embedUrl,
|
||||
title,
|
||||
className = "",
|
||||
iframeContainerClassName = ""
|
||||
}: Props) => {
|
||||
const { status, loading, accept } = useCookieVideoConsent(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">
|
||||
<p>{warning}</p>
|
||||
<button
|
||||
className="underline font-bold hover:opacity-80 transition"
|
||||
type="button"
|
||||
onClick={accept}
|
||||
>
|
||||
{acceptLabel}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
) : (
|
||||
<div className={cn("h-[81vh]", iframeContainerClassName)}>
|
||||
<iframe
|
||||
className="border-none"
|
||||
width="100%"
|
||||
height="100%"
|
||||
src={embedUrl}
|
||||
title={title}
|
||||
allow="autoplay; encrypted-media"
|
||||
allowFullScreen
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default VideoEmbedWithConsent;
|
||||
|
|
@ -51,12 +51,13 @@ const Button = ({
|
|||
return "h-8 px-5"
|
||||
}
|
||||
|
||||
const iconClassName = icon?.className ?? "";
|
||||
if (link && link.href && link.label) {
|
||||
return (
|
||||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn(
|
||||
'rounded-full',
|
||||
'rounded-full w-fit',
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
|
|
@ -67,9 +68,9 @@ const Button = ({
|
|||
{...props}
|
||||
>
|
||||
<Link href={link.href} className="flex items-center justify-center gap-2">
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{link.label}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
</Link>
|
||||
</ShadcnButton>
|
||||
)
|
||||
|
|
@ -80,7 +81,7 @@ const Button = ({
|
|||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn(
|
||||
'rounded-full',
|
||||
'rounded-full w-fit',
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
|
|
@ -91,9 +92,9 @@ const Button = ({
|
|||
{...props}
|
||||
>
|
||||
<div>
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{children}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
</div>
|
||||
</ShadcnButton>
|
||||
);
|
||||
|
|
@ -102,7 +103,7 @@ const Button = ({
|
|||
return (
|
||||
<ShadcnButton
|
||||
variant={variant as ButtonProps["variant"]}
|
||||
className={cn('rounded-full',
|
||||
className={cn('rounded-full w-fit',
|
||||
isBold ? "font-bold" : "font-normal",
|
||||
font,
|
||||
className,
|
||||
|
|
@ -111,9 +112,9 @@ const Button = ({
|
|||
)}
|
||||
{...props}
|
||||
>
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement !== sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
{children}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon />}
|
||||
{icon?.placement === sidePlacements.RIGHT && Icon && <Icon className={cn(iconClassName)} />}
|
||||
</ShadcnButton>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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";
|
||||
|
||||
const Footer = () => {
|
||||
const hoverLink = "hover:text-primary-foreground/80"
|
||||
|
|
@ -14,7 +15,7 @@ const Footer = () => {
|
|||
text: "<strong>Lorem ipsum dolor sit amet consectetur adipisicing elit</strong>. Sequi placeat harum laboriosam facilis a odit sunt, vero doloribus voluptatum suscipit odio, esse."
|
||||
}}
|
||||
button={{
|
||||
href: "#FIXME",
|
||||
href: route('front.contact-us'),
|
||||
label: "Nous contacter",
|
||||
placement: verticalPlacements.BOTTOM,
|
||||
}} variant={bgColors.PRIMARY}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
import GoToTopBase from "../Base/GoToTopBase";
|
||||
|
||||
const GoToTop= () => {
|
||||
const 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_7131_2338)">
|
||||
<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="M47.505 35.1236L36.0621 23.7418C35.8445 23.5346 35.588 23.3723 35.3073 23.2641C34.7505 23.0369 34.1263 23.0377 33.5701 23.2663C33.2897 23.3751 33.0335 23.5381 32.8164 23.7459L21.4021 35.1561C21.1893 35.3689 21.0205 35.6214 20.9055 35.8992C20.7906 36.177 20.7316 36.4746 20.7319 36.7752C20.7327 37.3821 20.9752 37.9639 21.4062 38.3926C21.8371 38.8212 22.4212 39.0616 23.0299 39.0608C23.6386 39.0601 24.222 38.8182 24.6519 38.3885L32.1625 30.8578L32.1841 48.1569C32.1849 48.7614 32.4264 49.3408 32.8556 49.7677C33.2848 50.1946 33.8665 50.4341 34.4727 50.4333C35.0789 50.4325 35.66 50.1917 36.0881 49.7637C36.5162 49.3358 36.7563 48.7557 36.7555 48.1513L36.7339 30.8521L44.2633 38.3641C44.4761 38.5775 44.7291 38.7467 45.0077 38.8621C45.2864 38.9775 45.5853 39.0367 45.887 39.0363C46.1887 39.0359 46.4874 38.976 46.7658 38.8599C47.0442 38.7439 47.2968 38.574 47.509 38.3601C47.723 38.1479 47.8927 37.8956 48.0084 37.6178C48.1241 37.3399 48.1835 37.0419 48.1831 36.741C48.1827 36.4401 48.1226 36.1423 48.0062 35.8647C47.8898 35.5871 47.7195 35.3352 47.505 35.1236Z" fill="#111F51" />
|
||||
<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_7131_2338" x="0" y="0" width="71" height="83" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<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" />
|
||||
<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_7131_2338" />
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_7131_2338" result="shape" />
|
||||
<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>
|
||||
|
||||
}
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,13 +15,14 @@ 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[] }) => {
|
||||
return (
|
||||
<div className="hidden lg:block">
|
||||
<div className="flex items-center justify-between my-3 pr-3">
|
||||
<div>
|
||||
BARRE DE RECHERCHE #TODO
|
||||
<SearchInput />
|
||||
</div>
|
||||
<SocialNetworks />
|
||||
</div>
|
||||
|
|
@ -35,7 +36,7 @@ const DesktopNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
<NavigationMenuItem>
|
||||
<NavigationMenuTrigger className="text-md font-bold uppercase">{link.title}</NavigationMenuTrigger>
|
||||
<NavigationMenuContent>
|
||||
<ul className="w-96 list-disc pl-5 space-y-3">
|
||||
<ul className="w-96 list-disc pl-5 space-y-0.5">
|
||||
{link.children.map((child) => {
|
||||
return (
|
||||
<ListItem href={child.href ?? ""} title={child.title} />
|
||||
|
|
@ -73,7 +74,7 @@ function ListItem({
|
|||
<li {...props}>
|
||||
<NavigationMenuLink asChild>
|
||||
<Link href={href}>
|
||||
<div className="flex flex-col gap-1 text-sm">
|
||||
<div className="flex flex-col gap-1 text-sm py-1.5">
|
||||
<div className="leading-none font-medium">{title}</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ import { Button } from "@/components/ui/button";
|
|||
import { Link } from "@inertiajs/react";
|
||||
import { Search } from "lucide-react";
|
||||
|
||||
const SearchInput = () => {
|
||||
const GoToSearchPage = () => {
|
||||
return (
|
||||
<Button variant={"ghost"} className="cursor-pointor [&_svg]:size-7" asChild>
|
||||
<Link href={"#FIXME"}><Search /></Link>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
export default SearchInput;
|
||||
export default GoToSearchPage;
|
||||
|
|
@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
|
|||
//* THEME
|
||||
import { cn } from "@/lib/utils";
|
||||
import { FrontNavLinkProps } from "@/types/front";
|
||||
import SearchInput from "$/uwil/Header/SearchInput";
|
||||
import GoToSearchPage from "$/uwil/Header/GoToSearchPage";
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
|
|
@ -25,7 +25,7 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
const headerClasses = "h-[65px] flex flex-row items-center justify-between relative"
|
||||
return (
|
||||
<div className={cn('lg:hidden', headerClasses)}>
|
||||
<SearchInput />
|
||||
<GoToSearchPage />
|
||||
<Sheet>
|
||||
<SheetTrigger asChild>
|
||||
<Button variant="ghost" className="cursor-pointer [&_svg]:size-7">
|
||||
|
|
@ -41,7 +41,7 @@ const MobileNav = ({ navLinks } : { navLinks: FrontNavLinkProps[] }) => {
|
|||
<SheetHeader className={cn(headerClasses, "space-y-0 relative")}>
|
||||
<Logo className="block w-[38px] h-auto" />
|
||||
<div className="flex items-center gap-1">
|
||||
<SearchInput />
|
||||
<GoToSearchPage />
|
||||
<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 />
|
||||
|
|
|
|||
173
resources/ts/front/Components/Theme/Inputs/Filters.tsx
Normal file
173
resources/ts/front/Components/Theme/Inputs/Filters.tsx
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
import { useState } from "react";
|
||||
import { FilterDropdown } from "../../Base/Inputs/FilterDropdown";
|
||||
import Button from "../Button";
|
||||
import { fonts, simpleWeights } from "@/front/lib/constants";
|
||||
import useDeviceType from "@/hooks/use-device-type";
|
||||
import {
|
||||
Drawer,
|
||||
DrawerClose,
|
||||
DrawerContent,
|
||||
DrawerDescription,
|
||||
DrawerFooter,
|
||||
DrawerHeader,
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from "@/components/ui/drawer"
|
||||
|
||||
type FiltersState = Record<string, string[]>;
|
||||
|
||||
|
||||
export default function Filters() {
|
||||
const { isMobile } = useDeviceType();
|
||||
const [filters, setFilters] = useState<FiltersState>({
|
||||
tech: ["frais"],
|
||||
category: [],
|
||||
});
|
||||
const badges = Object.entries(filters).flatMap(([key, values]) =>
|
||||
values.map((value) => ({
|
||||
key,
|
||||
value,
|
||||
}))
|
||||
);
|
||||
const handleFilterChange = (key: string, values: string[]) => {
|
||||
setFilters((prev) => ({
|
||||
...prev,
|
||||
[key]: values,
|
||||
}));
|
||||
};
|
||||
const removeFilter = (key: string, value: string) => {
|
||||
setFilters((prev) => ({
|
||||
...prev,
|
||||
[key]: prev[key].filter((v) => v !== value),
|
||||
}));
|
||||
};
|
||||
const clearAllFilters = () => {
|
||||
setFilters((prev) => {
|
||||
const cleared: typeof prev = {};
|
||||
|
||||
for (const key in prev) {
|
||||
cleared[key] = [];
|
||||
}
|
||||
|
||||
return cleared;
|
||||
});
|
||||
};
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<Drawer>
|
||||
<DrawerTrigger>Open</DrawerTrigger>
|
||||
<DrawerContent>
|
||||
<DrawerHeader>
|
||||
<DrawerTitle>Filtres</DrawerTitle>
|
||||
<DrawerDescription>
|
||||
<div className="space-y-4">
|
||||
<FilterDropdown
|
||||
key={"tech"}
|
||||
value={filters.tech}
|
||||
label="Technologie"
|
||||
onChange={(values) => handleFilterChange("tech", values)}
|
||||
options={[
|
||||
{ id: "frais", label: "Frais", checked: true },
|
||||
{ id: "ambiant", label: "Ambiant" },
|
||||
{ id: "surgele", label: "Surgelé" },
|
||||
]}
|
||||
openOnHover={true}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
<FilterDropdown
|
||||
label="Catégorie"
|
||||
onChange={(values) => handleFilterChange("category", values)}
|
||||
options={[
|
||||
{ id: "liquide", label: "Oeufs liquides petit cdt" },
|
||||
{ id: "omelettes", label: "Omelettes" },
|
||||
{ id: "oeufs-durs", label: "Oeufs durs" },
|
||||
]}
|
||||
value={filters.category}
|
||||
openOnHover={true}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
</div>
|
||||
</DrawerDescription>
|
||||
</DrawerHeader>
|
||||
<DrawerFooter className="block max-w-2xl mx-auto space-y-3">
|
||||
<Button
|
||||
onClick={clearAllFilters}
|
||||
variant={"tertiary"}
|
||||
className="uppercase w-full !h-10"
|
||||
>
|
||||
Appliquer
|
||||
</Button>
|
||||
<DrawerClose className="w-full">
|
||||
<Button
|
||||
className="uppercase w-full !h-10"
|
||||
onClick={clearAllFilters}
|
||||
variant={"default"}
|
||||
>
|
||||
Effacer la sélection
|
||||
</Button>
|
||||
</DrawerClose>
|
||||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center gap-4">
|
||||
<FilterDropdown
|
||||
key={"tech"}
|
||||
value={filters.tech}
|
||||
label="Technologie"
|
||||
onChange={(values) => handleFilterChange("tech", values)}
|
||||
options={[
|
||||
{ id: "frais", label: "Frais", checked: true },
|
||||
{ id: "ambiant", label: "Ambiant" },
|
||||
{ id: "surgele", label: "Surgelé" },
|
||||
]}
|
||||
openOnHover={true}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
<FilterDropdown
|
||||
label="Catégorie"
|
||||
onChange={(values) => handleFilterChange("category", values)}
|
||||
options={[
|
||||
{ id: "liquide", label: "Oeufs liquides petit cdt" },
|
||||
{ id: "omelettes", label: "Omelettes" },
|
||||
{ id: "oeufs-durs", label: "Oeufs durs" },
|
||||
]}
|
||||
value={filters.category}
|
||||
openOnHover={true}
|
||||
isMobile={isMobile}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{badges.map(({ key, value }) => (
|
||||
<Button
|
||||
key={`${key}-${value}`}
|
||||
onClick={() => removeFilter(key, value)}
|
||||
variant={"tertiary"}
|
||||
className={simpleWeights.NORMAL}
|
||||
font={fonts.DELIUS_SWASH}
|
||||
icon={{
|
||||
icon: "x",
|
||||
placement: "left"
|
||||
}}
|
||||
>
|
||||
{value}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex justify-start">
|
||||
<button
|
||||
onClick={clearAllFilters}
|
||||
className="px-4 py-2 bg-secondary text-primary-foreground rounded w-fit"
|
||||
>
|
||||
Réinitialiser les filtres
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -10,13 +10,15 @@ const ItemCard = ({
|
|||
image,
|
||||
description,
|
||||
variant,
|
||||
size,
|
||||
subtitle
|
||||
}: ThemeItemCardProps) => {
|
||||
|
||||
const width = "w-[97%] md:w-72 lg:w-56";
|
||||
const height = "aspect-square";
|
||||
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;
|
||||
const titleFont = title?.font ?? fonts.DELIUS_SWASH;
|
||||
const titleWeight = title?.weight ?? simpleWeights.NORMAL;
|
||||
|
||||
const descriptionFont = description?.font ?? fonts.GOTHAM;
|
||||
const descriptionWeight = description?.weight ?? simpleWeights.NORMAL;
|
||||
|
|
@ -39,11 +41,15 @@ const ItemCard = ({
|
|||
}
|
||||
/>
|
||||
|
||||
<div className="w-full mt-6 text-center">
|
||||
<h4 className={cn('text-xl md:text-3xl', titleFont, titleWeight)}>
|
||||
{title.text}
|
||||
</h4>
|
||||
|
||||
<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)}>
|
||||
{title.text}
|
||||
</h4>
|
||||
)}
|
||||
{subtitle?.text && (
|
||||
<h5 className={cn("text-2xl", subtitle?.font ?? fonts.DELIUS_SWASH, subtitle?.weight ?? "font-normal")}>{subtitle.text}</h5>
|
||||
)}
|
||||
{description?.text && (
|
||||
<p dangerouslySetInnerHTML={{
|
||||
__html: description.text
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ type Props = {
|
|||
const Logo = (props: Props) => {
|
||||
const { className } = props;
|
||||
return (
|
||||
<Link href={"#FIXME"} 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;
|
||||
|
|
|
|||
56
resources/ts/front/Components/Theme/NutritionalValueList.tsx
Normal file
56
resources/ts/front/Components/Theme/NutritionalValueList.tsx
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
type Props = {
|
||||
rows: Row[];
|
||||
/** On which value is based all the values
|
||||
* @example "Pour 100g"
|
||||
*/
|
||||
baseValue: string;
|
||||
}
|
||||
|
||||
type Row = {
|
||||
label?: string;
|
||||
value: string;
|
||||
subRow?: Row;
|
||||
}
|
||||
|
||||
export default function NutritionalValueList({ rows, baseValue }: Props) {
|
||||
return (
|
||||
<div>
|
||||
<div className="grid grid-cols-12">
|
||||
<Row row={{
|
||||
value: baseValue
|
||||
}} />
|
||||
</div>
|
||||
<div className="grid grid-cols-12">
|
||||
{rows.map((row, 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,6 +1,8 @@
|
|||
import Breadcrumbs from "$/uwil/Breadcrumbs"
|
||||
import { cn } from "@/lib/utils";
|
||||
import { TextProps } from "@/types/front"
|
||||
import Section from "$/uwil/Section";
|
||||
import { bgColors } from "@/front/lib/constants";
|
||||
|
||||
type PageHeaderProps = {
|
||||
title: TextProps;
|
||||
|
|
@ -9,21 +11,19 @@ type PageHeaderProps = {
|
|||
const PageHeader = (props: PageHeaderProps) => {
|
||||
const { title, description } = props;
|
||||
return (
|
||||
<section className="bg-primary py-20">
|
||||
<div className="container mx-auto px:-4 md:px-0">
|
||||
<Breadcrumbs breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
]} />
|
||||
<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>
|
||||
</div>
|
||||
</section>
|
||||
<Section variant={bgColors.PRIMARY} className="text-start" containerClassName="space-y-0 md:px-4">
|
||||
<Breadcrumbs breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
]} />
|
||||
<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;
|
||||
|
|
|
|||
|
|
@ -28,41 +28,47 @@ const Section = forwardRef<HTMLDivElement, Props>((props, ref) => {
|
|||
const btnVariant = variant === bgColors.BACKGROUND ? "default" : "inverted";
|
||||
const btnPlacement = (button && button.placement) ?? verticalPlacements.BOTTOM;
|
||||
return (
|
||||
<section ref={ref} className={cn(variant, className, "text-center py-20")}>
|
||||
<Container className={cn("space-y-8", containerClassName)}>
|
||||
<section ref={ref} className={cn(variant, "text-center py-20", className)}>
|
||||
<Container className={cn(containerClassName)}>
|
||||
{btnPlacement === verticalPlacements.TOP && button && (
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
placement: button.icon.placement ?? sidePlacements.RIGHT,
|
||||
},
|
||||
})}
|
||||
asChild><Link href={button.href}>{button.label}</Link></Button>
|
||||
<div className="mb-5">
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
placement: button.icon.placement ?? sidePlacements.RIGHT,
|
||||
},
|
||||
})}
|
||||
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>}
|
||||
</Container>
|
||||
)}
|
||||
<Container>
|
||||
{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>
|
||||
{btnPlacement === verticalPlacements.BOTTOM && button && (
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
link={{
|
||||
href: button.href,
|
||||
label: button.label
|
||||
}}
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
placement: button.icon.placement ?? sidePlacements.RIGHT,
|
||||
},
|
||||
})}
|
||||
/>
|
||||
<div className="mt-5">
|
||||
<Button
|
||||
variant={btnVariant}
|
||||
link={{
|
||||
href: button.href,
|
||||
label: button.label
|
||||
}}
|
||||
{...(button.icon && {
|
||||
icon: {
|
||||
icon: button.icon.icon,
|
||||
placement: button.icon.placement ?? sidePlacements.RIGHT,
|
||||
},
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</Container>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
import { CarouselProps, TextProps } from "@/types/front";
|
||||
import Section, { ButtonSectionProps } from "$/uwil/Section"
|
||||
import { BgColorName } from "@/front/lib/constants";
|
||||
import Carousel from "@/front/Components/Base/Carousel/Carousel";
|
||||
import Carousel from "$/base/Carousel/Carousel";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type CarouselSectionProps = CarouselProps & {
|
||||
title?: TextProps;
|
||||
|
|
@ -10,6 +11,7 @@ type CarouselSectionProps = CarouselProps & {
|
|||
description?: TextProps;
|
||||
variant?: BgColorName;
|
||||
button?: ButtonSectionProps;
|
||||
sectionClassName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +51,7 @@ type CarouselSectionProps = CarouselProps & {
|
|||
* />
|
||||
*/
|
||||
const CarouselSection = (props: CarouselSectionProps) => {
|
||||
const { title, subtitle, description, variant, button, items, carousel } = props;
|
||||
const { title, subtitle, description, variant, button, items, carousel, sectionClassName } = props;
|
||||
const buttonProps = button
|
||||
? {
|
||||
button: {
|
||||
|
|
@ -67,6 +69,7 @@ const CarouselSection = (props: CarouselSectionProps) => {
|
|||
: {};
|
||||
return (
|
||||
<Section
|
||||
className={cn(sectionClassName)}
|
||||
containerClassName="px-0"
|
||||
variant={variant}
|
||||
{...(title && {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@ import TripleCol, { TripleColType } from "$/uwil/TripleCol";
|
|||
import { ButtonProps } from "@/components/ui/button";
|
||||
import { BgColorName, bgColors } from "@/front/lib/constants";
|
||||
import Section from "$/uwil/Section";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type TripleColSectionProps = {
|
||||
title: TextProps;
|
||||
title?: TextProps;
|
||||
cols: TripleColType[];
|
||||
button?: {
|
||||
label: string;
|
||||
|
|
@ -14,6 +15,7 @@ type TripleColSectionProps = {
|
|||
variant?: ButtonProps["variant"] | CustomButtonVariant;
|
||||
};
|
||||
variant?: BgColorName;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +38,7 @@ type TripleColSectionProps = {
|
|||
*
|
||||
* @param {TripleColSectionProps} props
|
||||
*
|
||||
* @property {TextProps} title - Main title displayed at the top (required)
|
||||
* @property {TextProps} title - Optional Main title displayed at the top (required)
|
||||
* @property {TripleColType[]} cols - Array of 3 column items rendered inside `TripleCol`
|
||||
* @property {Object} button - Optional CTA button
|
||||
* @property {string} button.label - Button text
|
||||
|
|
@ -56,17 +58,19 @@ type TripleColSectionProps = {
|
|||
* />
|
||||
*/
|
||||
export default function TripleColSection(props: TripleColSectionProps) {
|
||||
const { title, cols, button, variant = bgColors.BACKGROUND } = props;
|
||||
const { title, cols, button, variant = bgColors.BACKGROUND, className } = props;
|
||||
|
||||
return (
|
||||
<Section
|
||||
className="pt-8 text-center"
|
||||
className={cn("text-center", className)}
|
||||
variant={variant}
|
||||
title={{
|
||||
text: title.text,
|
||||
font: title.font,
|
||||
weight: title.weight,
|
||||
}}
|
||||
{...(title && {
|
||||
title: {
|
||||
text: title.text,
|
||||
font: title.font,
|
||||
weight: title.weight,
|
||||
}
|
||||
})}
|
||||
{...(button && {
|
||||
button: {
|
||||
icon: {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
import { videoProvider } from "@/front/lib/constants";
|
||||
import VideoEmbedWithConsent from "$/base/VideoEmbedWithConsent";
|
||||
|
||||
const VideoBanner = () => {
|
||||
|
||||
return (
|
||||
<div className="h-[81vh]">
|
||||
<iframe
|
||||
className="border-none"
|
||||
width="100%"
|
||||
height="100%"
|
||||
src="https://www.youtube.com/embed/7FMs32conQg?autoplay=1&mute=1&controls=0&loop=1&playlist=7FMs32conQg"
|
||||
title="Hero Banner Ovoteam"
|
||||
allow="autoplay; encrypted-media"
|
||||
allowFullScreen
|
||||
<VideoEmbedWithConsent
|
||||
service={videoProvider.YOUTUBE}
|
||||
title="Hero Banner"
|
||||
embedUrl="https://www.youtube.com/embed/7FMs32conQg?autoplay=1&mute=1&controls=0&loop=1&playlist=7FMs32conQg"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import { ReactNode } from "react";
|
|||
import Header from "$/uwil/Header/Header";
|
||||
import Footer from "$/uwil/Footer";
|
||||
import GoToTop from "$/uwil/GoToTop";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
|
||||
interface BreadcrumbItem {
|
||||
title: string;
|
||||
|
|
@ -37,7 +39,10 @@ export default function AppLayout({ children }: AppLayoutProps) {
|
|||
)}
|
||||
</Head>
|
||||
<Header />
|
||||
{children}
|
||||
<Toaster />
|
||||
<TooltipProvider>
|
||||
{children}
|
||||
</TooltipProvider>
|
||||
<GoToTop />
|
||||
<Footer />
|
||||
</div>
|
||||
|
|
|
|||
243
resources/ts/front/Pages/Commitment.tsx
Normal file
243
resources/ts/front/Pages/Commitment.tsx
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
import { Head } from "@inertiajs/react";
|
||||
import AppLayout from "../Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import PageHeader from "$/uwil/PageHeader";
|
||||
import TripleColSection from "$/uwil/Sections/TripleColSection";
|
||||
import { bgColors } from "../lib/constants";
|
||||
import str from "@/hooks/use-string";
|
||||
import { GetTranslation } from "@/lib/utils";
|
||||
import CarouselSection from "$/uwil/Sections/CarouselSection";
|
||||
import { route } from "ziggy-js";
|
||||
|
||||
export default function Commitment() {
|
||||
return (
|
||||
<AppLayout>
|
||||
<Head title={useTrans("front.homepage")} />
|
||||
<PageHeader
|
||||
title={{
|
||||
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?"
|
||||
}}
|
||||
/>
|
||||
<TripleColSection
|
||||
title={{
|
||||
text: "Fabriqué en France",
|
||||
}}
|
||||
cols={[
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
]}
|
||||
button={{
|
||||
href: route('front.made-in-france'),
|
||||
label: "En savoir plus"
|
||||
}}
|
||||
variant="bg-background"
|
||||
/>
|
||||
<TripleColSection
|
||||
title={{
|
||||
text: "Large gamme plein air",
|
||||
}}
|
||||
cols={[
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
]}
|
||||
button={{
|
||||
href: route('front.gamme'),
|
||||
label: "En savoir plus"
|
||||
}}
|
||||
variant={bgColors.PRIMARY}
|
||||
/>
|
||||
<CarouselSection
|
||||
variant={bgColors.BACKGROUND}
|
||||
title={{
|
||||
text: "Expertise depuis 1963"
|
||||
}}
|
||||
button={{
|
||||
href: route('front.expertise'),
|
||||
label: "En savoir plus",
|
||||
icon: {
|
||||
icon: "chevron-right"
|
||||
}
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
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."
|
||||
},
|
||||
button: {
|
||||
label: str(GetTranslation('front.see.product')).ucFirst().value(),
|
||||
href: "/ddd"
|
||||
}
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</AppLayout>
|
||||
)
|
||||
}
|
||||
149
resources/ts/front/Pages/Contact/ContactForm.tsx
Normal file
149
resources/ts/front/Pages/Contact/ContactForm.tsx
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
// * PACKAGES
|
||||
import { useForm } from "@inertiajs/react";
|
||||
// * BASE
|
||||
import SimpleString from "$/base/Inputs/SimpleString";
|
||||
import EnumSelect from "$/base/Inputs/EnumSelect";
|
||||
import SimpleTextarea from "$/base/Inputs/SimpleTextarea";
|
||||
import SimpleCheckbox from "$/base/Inputs/SimpleCheckbox";
|
||||
// * THEME
|
||||
import Section from "$/uwil/Section";
|
||||
import Button from "$/uwil/Button";
|
||||
|
||||
export default function ContactForm() {
|
||||
|
||||
const { data, setData, processing } = useForm({
|
||||
name: "",
|
||||
firstName: "",
|
||||
phone: "",
|
||||
mail: "",
|
||||
entrepriseName: "",
|
||||
activitySector: "",
|
||||
object: "",
|
||||
message: "",
|
||||
terms: false,
|
||||
optin: false,
|
||||
});
|
||||
|
||||
const submit = () => { }
|
||||
|
||||
return (
|
||||
<Section
|
||||
className="max-w-4xl mx-auto"
|
||||
>
|
||||
<form onSubmit={submit}>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 space-y-6 gap-5">
|
||||
<SimpleString
|
||||
value={data.name}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="name"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.firstName}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="firstName"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.phone}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="phone"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.mail}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="mail"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<SimpleString
|
||||
value={data.entrepriseName}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="entrepriseName"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<EnumSelect
|
||||
selected={Number(data.activitySector)}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="activitySector"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
/>
|
||||
<EnumSelect
|
||||
selected={Number(data.object)}
|
||||
setData={setData}
|
||||
label="Label"
|
||||
required={true}
|
||||
name="object"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
className="md:col-span-2"
|
||||
/>
|
||||
<SimpleTextarea
|
||||
label="Label"
|
||||
name="message"
|
||||
setData={setData}
|
||||
className="md:col-span-2"
|
||||
disabled={processing}
|
||||
placeholder="placeholder"
|
||||
required={true}
|
||||
value={data.message}
|
||||
/>
|
||||
<SimpleCheckbox
|
||||
label="Label"
|
||||
name="terms"
|
||||
setData={setData}
|
||||
value={data.terms}
|
||||
className="md:col-span-2"
|
||||
/>
|
||||
<SimpleCheckbox
|
||||
label="Label"
|
||||
name="optin"
|
||||
setData={setData}
|
||||
value={data.optin}
|
||||
className="md:col-span-2"
|
||||
/>
|
||||
</div>
|
||||
<p className="font-semibold text-sm pt-8">* champs obligatoires</p>
|
||||
<div className="mt-8 flex flex-col justify-center gap-8 items-center">
|
||||
<Button
|
||||
variant={"default"}
|
||||
type="submit"
|
||||
icon={{
|
||||
icon: "chevron-right",
|
||||
placement: "right"
|
||||
}}
|
||||
>Envoyer ma demande</Button>
|
||||
<Button
|
||||
variant={"tertiary"}
|
||||
link={{
|
||||
href: "FIXME",
|
||||
label: "Retour à la page d'accueil"
|
||||
}}
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: "left"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</Section>
|
||||
)
|
||||
}
|
||||
38
resources/ts/front/Pages/Contact/ContactUs.tsx
Normal file
38
resources/ts/front/Pages/Contact/ContactUs.tsx
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// * PACKAGES
|
||||
import { Head } from "@inertiajs/react";
|
||||
// * BASE
|
||||
import AppLayout from "../../Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
// * THEME
|
||||
import PageHeader from "$/uwil/PageHeader";
|
||||
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"
|
||||
}}
|
||||
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?"
|
||||
}}
|
||||
/>
|
||||
<div className="mt-20">
|
||||
<Image
|
||||
size={`mx-auto w-[97%] md:w-72 lg:w-72 aspect-square`}
|
||||
image={{
|
||||
src: "/assets/img/elephant.jpg",
|
||||
alt: "ALT",
|
||||
title: "TITLE"
|
||||
}}
|
||||
shape="rounded"
|
||||
/>
|
||||
</div>
|
||||
<ContactForm />
|
||||
</AppLayout>
|
||||
)
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -11,6 +11,9 @@ import {
|
|||
import { AppEnv } from "@/types/global";
|
||||
import { useFormatedDate } from "@/hooks/use-formated-value";
|
||||
import { cn } from "@/lib/utils";
|
||||
import AppLayout from "../Layouts/AppLayout";
|
||||
import PageHeader from "../Components/Theme/PageHeader";
|
||||
import Section from "../Components/Theme/Section";
|
||||
|
||||
type DynamicPageDefaultProps = {
|
||||
dynamicPageModel: DynamicPageModelWithRelations;
|
||||
|
|
@ -203,37 +206,44 @@ export default function DynamicPageDefault({
|
|||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppLayout>
|
||||
<Head title={currentLocaleTitle} />
|
||||
<h1 className="text-4xl font-extrabold tracking-tight lg:text-5xl">
|
||||
{currentLocaleTitle}
|
||||
</h1>
|
||||
<small className="my-5">
|
||||
{useFormatedDate(String(dynamicPageModel.updated_at))}
|
||||
</small>
|
||||
{currentLocaleConfig && currentLocaleContent ? (
|
||||
<table className="w-1/2 mx-auto border-collapse">
|
||||
<tbody>
|
||||
{Object.entries(currentLocaleContent)
|
||||
.filter(([key]) => !key.startsWith("reserved_model_"))
|
||||
.map(([key, value]) => (
|
||||
<tr key={key} className="border-b">
|
||||
<th className="text-left font-medium p-2 w-1/4 align-top">
|
||||
{key}
|
||||
</th>
|
||||
<td className="p-2">{renderField(key, value)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<div
|
||||
// eslint-disable-next-line react/no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: String(currentLocaleContent),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
<PageHeader
|
||||
title={{
|
||||
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?"
|
||||
}}
|
||||
/>
|
||||
<Section className="text-start">
|
||||
<small className="my-5">
|
||||
{useFormatedDate(String(dynamicPageModel.updated_at))}
|
||||
</small>
|
||||
{currentLocaleConfig && currentLocaleContent ? (
|
||||
<table className="w-1/2 mx-auto border-collapse">
|
||||
<tbody>
|
||||
{Object.entries(currentLocaleContent)
|
||||
.filter(([key]) => !key.startsWith("reserved_model_"))
|
||||
.map(([key, value]) => (
|
||||
<tr key={key} className="border-b">
|
||||
<th className="text-left font-medium p-2 w-1/4 align-top">
|
||||
{key}
|
||||
</th>
|
||||
<td className="p-2">{renderField(key, value)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
) : (
|
||||
<div
|
||||
// eslint-disable-next-line react/no-danger
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: String(currentLocaleContent),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Section>
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
398
resources/ts/front/Pages/Expertise.tsx
Normal file
398
resources/ts/front/Pages/Expertise.tsx
Normal file
|
|
@ -0,0 +1,398 @@
|
|||
// * INERTIA
|
||||
import { Head } from "@inertiajs/react";
|
||||
// * THEME
|
||||
import AppLayout from "../Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import HeroImage from "$/uwil/HeroImage";
|
||||
import Section from "$/uwil/Section";
|
||||
import Breadcrumbs from "$/uwil/Breadcrumbs";
|
||||
import Button from "$/uwil/Button";
|
||||
import CarouselSection from "$/uwil/Sections/CarouselSection";
|
||||
import { bgColors } from "../lib/constants";
|
||||
import useDeviceType from "@/hooks/use-device-type";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { route } from "ziggy-js";
|
||||
|
||||
export default function Expertise() {
|
||||
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."
|
||||
}}
|
||||
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."
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
<Breadcrumbs
|
||||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<CarouselSection
|
||||
variant={bgColors.BACKGROUND}
|
||||
title={{
|
||||
text: "Les dates marquantes de la marque"
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
},
|
||||
title: {
|
||||
text: "1963",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
text: "description"
|
||||
}
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<Section
|
||||
containerClassName="px-0"
|
||||
variant={bgColors.PRIMARY}
|
||||
title={{
|
||||
text: "...Et une double expertise unique, pleine de synergie",
|
||||
}}
|
||||
subtitle={{
|
||||
text: "La restauration hors domicile",
|
||||
}}
|
||||
description={{
|
||||
text: "Une large gamme de produits gourmands, simples à mettre en oeuvre pour tous les métiers de la restauration hors domicile",
|
||||
}}
|
||||
>
|
||||
<CarouselSection
|
||||
variant={bgColors.PRIMARY}
|
||||
carousel={{
|
||||
wrapperClass: isMobile ? "pb-20" : "pb-0",
|
||||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 3
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 3
|
||||
}
|
||||
}
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
subtitle: {
|
||||
text: "Hôtellerie, Restauration rapide"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
|
||||
<Section
|
||||
subtitle={{
|
||||
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."
|
||||
}}
|
||||
>
|
||||
<CarouselSection
|
||||
sectionClassName="py-0 pt-8"
|
||||
variant={bgColors.BACKGROUND}
|
||||
carousel={{
|
||||
wrapperClass: isMobile ? "pb-20" : "pb-0",
|
||||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 3
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 3
|
||||
}
|
||||
}
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<Separator className="mx-auto w-[70%] md:w-[65%] bg-primary h-3 my-12" />
|
||||
<Section
|
||||
subtitle={{
|
||||
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."
|
||||
}}
|
||||
>
|
||||
<CarouselSection
|
||||
sectionClassName="py-0 pt-8"
|
||||
variant={bgColors.BACKGROUND}
|
||||
carousel={{
|
||||
wrapperClass: isMobile ? "pb-20" : "pb-0",
|
||||
breakpoints: {
|
||||
0: {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 0
|
||||
},
|
||||
768: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
},
|
||||
1248: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 0
|
||||
}
|
||||
}
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
text: "Restauration commerciale",
|
||||
font: "font-gotham",
|
||||
weight: "font-bold"
|
||||
},
|
||||
description: {
|
||||
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"
|
||||
}
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<Button
|
||||
variant={"tertiary"}
|
||||
link={{
|
||||
href: route('front.homepage'),
|
||||
label: "Retour à la page d'accueil"
|
||||
}}
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: "left"
|
||||
}}
|
||||
/>
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
}
|
||||
126
resources/ts/front/Pages/Gamme.tsx
Normal file
126
resources/ts/front/Pages/Gamme.tsx
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
import { Head } from "@inertiajs/react";
|
||||
import AppLayout from "../Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import HeroImage from "$/uwil/HeroImage";
|
||||
import Section from "$/uwil/Section";
|
||||
import Breadcrumbs from "$/uwil/Breadcrumbs";
|
||||
import TripleColSection from "$/uwil/Sections/TripleColSection";
|
||||
import Button from "$/uwil/Button";
|
||||
import Image from "$/uwil/Image";
|
||||
import { route } from "ziggy-js";
|
||||
|
||||
export default function Expertise() {
|
||||
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."
|
||||
}}
|
||||
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."
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
<Breadcrumbs
|
||||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<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`}
|
||||
image={{
|
||||
alt: "ALT",
|
||||
src: "/assets/img/elephant.jpg",
|
||||
lazyload: true,
|
||||
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>
|
||||
<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>
|
||||
<TripleColSection
|
||||
cols={[
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
]}
|
||||
variant="bg-background"
|
||||
/>
|
||||
<Section>
|
||||
<Button
|
||||
variant={"tertiary"}
|
||||
link={{
|
||||
href: route('front.homepage'),
|
||||
label: "Retour à la page d'accueil"
|
||||
}}
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: "left"
|
||||
}}
|
||||
/>
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ 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";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
|
|
@ -170,7 +171,7 @@ export default function Home() {
|
|||
}
|
||||
]}
|
||||
button={{
|
||||
href: "#FIXME",
|
||||
href: route("front.engage"),
|
||||
label: str(GetTranslation('front.discover_our_commit')).ucFirst().value()
|
||||
}}
|
||||
variant="bg-background"
|
||||
|
|
|
|||
154
resources/ts/front/Pages/MadeInFrance.tsx
Normal file
154
resources/ts/front/Pages/MadeInFrance.tsx
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
import { Head } from "@inertiajs/react";
|
||||
import AppLayout from "../Layouts/AppLayout";
|
||||
import useTrans from "@/hooks/use-translations";
|
||||
import TripleColSection from "$/uwil/Sections/TripleColSection";
|
||||
import { bgColors } from "../lib/constants";
|
||||
import CarouselSection from "$/uwil/Sections/CarouselSection";
|
||||
import Breadcrumbs from "$/uwil/Breadcrumbs";
|
||||
import Section from "$/uwil/Section";
|
||||
import Button from "$/uwil/Button";
|
||||
import HeroImage from "$/uwil/HeroImage";
|
||||
|
||||
export default function MadeInFrance() {
|
||||
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."
|
||||
}}
|
||||
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."
|
||||
}}
|
||||
image={{
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}}
|
||||
/>
|
||||
<Section className="py-0 pt-12">
|
||||
<Breadcrumbs
|
||||
breadcrumbs={[
|
||||
{
|
||||
title: "Accueil",
|
||||
url: "/"
|
||||
}, {
|
||||
title: "Ovoteam s'engage",
|
||||
url: ""
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Section>
|
||||
<TripleColSection
|
||||
title={{
|
||||
text: "Fabriqué en France",
|
||||
}}
|
||||
cols={[
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}, {
|
||||
title: {
|
||||
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?"
|
||||
},
|
||||
image: {
|
||||
alt: "Alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
]}
|
||||
variant="bg-background"
|
||||
/>
|
||||
|
||||
<CarouselSection
|
||||
variant={bgColors.PRIMARY}
|
||||
title={{
|
||||
text: "Certifications"
|
||||
}}
|
||||
items={[
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
image: {
|
||||
alt: "alt",
|
||||
title: "title",
|
||||
src: "/assets/img/elephant.jpg"
|
||||
}
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<Section>
|
||||
<Button
|
||||
variant={"tertiary"}
|
||||
link={{
|
||||
href: "FIXME",
|
||||
label: "Retour à la page d'accueil"
|
||||
}}
|
||||
icon={{
|
||||
icon: "chevron-left",
|
||||
placement: "left"
|
||||
}}
|
||||
/>
|
||||
</Section>
|
||||
</AppLayout>
|
||||
)
|
||||
}
|
||||
|
|
@ -43,3 +43,11 @@ export const iconMap = {
|
|||
} as const
|
||||
|
||||
export type IconName = keyof typeof iconMap
|
||||
|
||||
// VIDEO PROVIDER
|
||||
export const videoProvider = {
|
||||
YOUTUBE: "youtube",
|
||||
VIMEO: "vimeo",
|
||||
} as const
|
||||
|
||||
export type VideoProviderName = (typeof videoProvider)[keyof typeof videoProvider];
|
||||
|
|
|
|||
26
resources/ts/hooks/use-cookie-video-consent.tsx
Normal file
26
resources/ts/hooks/use-cookie-video-consent.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { VideoProviderName } from "@/front/lib/constants";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const useCookieVideoConsent = (service: VideoProviderName) => {
|
||||
const [status, setStatus] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
const currentStatus =
|
||||
window.WebCookieNotice?.getCnCookieStatus(service) === "true";
|
||||
|
||||
setStatus((prev) => (prev !== currentStatus ? currentStatus : prev));
|
||||
setLoading(false);
|
||||
}, 500);
|
||||
return () => clearInterval(interval);
|
||||
}, [service]);
|
||||
|
||||
const accept = () => {
|
||||
// @ts-expect-error external lib
|
||||
window.WebCookieNotice?.acceptCookie(service);
|
||||
setStatus(true);
|
||||
};
|
||||
|
||||
return { status, loading, accept };
|
||||
};
|
||||
18
resources/ts/types/front.d.ts
vendored
18
resources/ts/types/front.d.ts
vendored
|
|
@ -26,11 +26,15 @@ type CustomButtonVariant = "tertiary" | "inverted";
|
|||
|
||||
type ThemeItemCardProps = {
|
||||
button?: ButtonProps;
|
||||
title: TextProps;
|
||||
title?: TextProps;
|
||||
subtitle?: TextProps;
|
||||
description?: TextProps;
|
||||
image: ImageProps;
|
||||
variant?: BgColorName;
|
||||
|
||||
size?: {
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
}
|
||||
|
||||
type ButtonProps = {
|
||||
|
|
@ -147,15 +151,23 @@ type CarouselProps = {
|
|||
* @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
|
||||
placement?: SidePlacementName
|
||||
placement?: SidePlacementName;
|
||||
className?: string;
|
||||
}
|
||||
|
|
|
|||
8
resources/ts/window.d.ts
vendored
Normal file
8
resources/ts/window.d.ts
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import CookieNotice from "@ldc-web/cookie-notice";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
CookieNotice: typeof CookieNotice;
|
||||
Recaptcha: unknown;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
<body>
|
||||
@inertia
|
||||
@include('front.vendor.cookie-notice.cn-cookies')
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
|||
202
resources/views/front/vendor/cookie-notice/cn-cookies.blade.php
vendored
Normal file
202
resources/views/front/vendor/cookie-notice/cn-cookies.blade.php
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
{{-- blade-formatter-disable --}}
|
||||
@php
|
||||
|
||||
$site_name = Str::ucfirst(config('app.name'));
|
||||
$logo_picture_url = "/assets/img/logo.svg";
|
||||
$logo_title_text = __('Logo du site :name', ['name' => $site_name]);
|
||||
$logo_alt_text = __('Logo :name', ['name' => $site_name]);
|
||||
|
||||
$strings = (object)[
|
||||
'modal_title' => __('cookie-notice.modal_title'),
|
||||
'button_customize_cookies' => __('cookie-notice.button_customize_cookies'),
|
||||
'button_close_cookies' => __('cookie-notice.button_close_cookies'),
|
||||
'button_title_open_new_tab' => __('cookie-notice.button_title_open_new_tab'),
|
||||
'button_toggle_cookie' => __('cookie-notice.button_toggle_cookie'),
|
||||
'button_forbid_all' => str(__('cookie-notice.button_forbid_all'))->upper(),
|
||||
'button_allow_all' => str(__('cookie-notice.button_allow_all'))->upper(),
|
||||
'button_customize' => str(__('cookie-notice.button_customize'))->upper(),
|
||||
'button_forbid_all_title' => __('cookie-notice.button_forbid_all_title'),
|
||||
'button_allow_all_title' => __('cookie-notice.button_allow_all_title'),
|
||||
'button_validate_and_close' => str(__('cookie-notice.button_validate_and_close'))->upper(),
|
||||
'banner_title' => __('cookie-notice.banner_title', ['site_name' => $site_name]),
|
||||
'banner_text' => sprintf(
|
||||
"%s<br><br>%s",
|
||||
__("cookie-notice.banner_text"),
|
||||
"<a href='https://www.ldc.fr/politique-de-confidentialite/'>" . __('cookie-notice.policy_title') . "</a>"
|
||||
),
|
||||
'panel_title' => __('cookie-notice.panel_title'),
|
||||
'panel_content' => __('cookie-notice.panel_content'),
|
||||
'panel_subtitle' => __('cookie-notice.panel_subtitle'),
|
||||
'panel_details' => __('cookie-notice.panel_details'),
|
||||
'picture_cookie_title' => __('cookie-notice.picture_cookie_title'),
|
||||
'navigation_title' => __('cookie-notice.navigation_title'),
|
||||
];
|
||||
|
||||
$cookieInline = function ($cookieName, $text, $subtext = '') {
|
||||
return <<<SCRIPT
|
||||
(() => {
|
||||
const cookieActivate = document.createElement("span");
|
||||
cookieActivate.classList.add("cn-cookie-activate");
|
||||
cookieActivate.dataset.cookieName = '{$cookieName}';
|
||||
|
||||
const childSpan = document.createElement("span");
|
||||
const childSpanSpan = document.createElement("span");
|
||||
const childSpanSmall = document.createElement("span");
|
||||
childSpanSpan.textContent = '{$text}';
|
||||
childSpanSmall.textContent = '{$subtext}';
|
||||
childSpan.appendChild(childSpanSpan);
|
||||
childSpan.appendChild(childSpanSmall);
|
||||
|
||||
const childBtn = document.createElement("button");
|
||||
childBtn.classList.add('btn','btn-red');
|
||||
childBtn.textContent = 'Autoriser';
|
||||
|
||||
cookieActivate.appendChild(childSpan);
|
||||
cookieActivate.appendChild(childBtn);
|
||||
return cookieActivate;
|
||||
})
|
||||
SCRIPT;
|
||||
};
|
||||
|
||||
$cookies = [];
|
||||
// YOUTUBE
|
||||
$cookies['youtube'] = [
|
||||
'name' => 'VIDEOS - Youtube',
|
||||
'description' => __('Les cookies déposés via les services de partage de vidéo ont pour finalité de permettre à l’utilisateur de visionner directement sur le site le contenu multimédia.'),
|
||||
'link' => 'https://policies.google.com/technologies/cookies?hl=fr&utm_source=ucb',
|
||||
'labelLink' => __('En savoir +'),
|
||||
'cookies' => ['NID', 'VISITOR_INFO1_LIVE', 'YSC']
|
||||
];
|
||||
|
||||
$cookies['youtube']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
let youtubeVids = document.getElementsByClassName('cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let id = item.dataset.id;
|
||||
let e = document.createElement('iframe');
|
||||
e.src = "https://www.youtube.com/embed/" + id;
|
||||
e.width = "640";
|
||||
e.height = "360";
|
||||
e.frameBorder = "0";
|
||||
e.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture";
|
||||
e.allowFullscreen = true;
|
||||
item.innerHTML = "";
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['youtube']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
let youtubeVids = document.getElementsByClassName('cn-youtube');
|
||||
for (let item of youtubeVids) {
|
||||
let a = document.createElement('a');
|
||||
a.innerText = 'Autoriser';
|
||||
a.classList.add('cn-cookie-link');
|
||||
a.setAttribute('role', 'button');
|
||||
a.onclick = function () {
|
||||
WebCookieNotice.openCookieModalToCookiePage();
|
||||
};
|
||||
let e = document.createElement('p');
|
||||
e.innerHTML = 'Youtube est désactivé. ';
|
||||
item.innerHTML = "";
|
||||
e.appendChild(a);
|
||||
item.appendChild(e);
|
||||
}
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
// RECAPTCHA
|
||||
$cookies['recaptcha'] = [
|
||||
'name' => __('cookie-notice.custom.recaptcha.title'),
|
||||
'description' => __('cookie-notice.custom.recaptcha.description'),
|
||||
'link' => 'https://policies.google.com/privacy',
|
||||
'labelLink' => __('cookie-notice.custom.recaptcha.labelLink'),
|
||||
'cookies' => ['NID', '__Secure-3PAPISID', '__Secure-3PSID', '__Secure-3PSIDCC']
|
||||
];
|
||||
|
||||
$cookies['recaptcha']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
if (window.__CN_Recaptcha) {
|
||||
window.__CN_Recaptcha();
|
||||
}
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.add('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
SCRIPT;
|
||||
$cookies['recaptcha']['fallback'] = <<<FALLBACK
|
||||
function () {
|
||||
if (window.__CN_Recaptcha_Reset) {
|
||||
window.__CN_Recaptcha_Reset();
|
||||
}
|
||||
[...document.getElementsByClassName('cn-cookie-activate')].forEach(function(el) {
|
||||
if (el.dataset.cookieName === 'recaptcha') {
|
||||
el.classList.remove('d-none');
|
||||
}
|
||||
});
|
||||
}
|
||||
FALLBACK;
|
||||
|
||||
|
||||
// MATOMO
|
||||
$cookies['matomo'] = [
|
||||
'name' => __('cookie-notice.custom.matomo.title'),
|
||||
'description' => __('cookie-notice.custom.matomo.description'),
|
||||
'link' => 'https://fr.matomo.org/gdpr-analytics/',
|
||||
'labelLink' => __('En savoir +'),
|
||||
'cookies' => ['_pk']
|
||||
];
|
||||
|
||||
$cookies['matomo']['script'] = <<<SCRIPT
|
||||
function () {
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//yl.s-web.fr/";
|
||||
_paq.push(['setTrackerUrl', u+'rainbow']);
|
||||
_paq.push(['setSiteId', '
|
||||
SCRIPT;
|
||||
$cookies['matomo']['script'] .= config("services.matomo.site_id");
|
||||
$cookies['matomo']['script'] .= <<<SCRIPT
|
||||
']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'unicorn'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
}
|
||||
SCRIPT;
|
||||
|
||||
@endphp
|
||||
|
||||
{{-- INCLUDE TEMPLATE --}}
|
||||
@include('front.vendor.cookie-notice.templates.standard', compact(
|
||||
'site_name', 'logo_picture_url', 'logo_alt_text',
|
||||
'logo_title_text', 'strings'
|
||||
))
|
||||
|
||||
<script nonce="{{ $nonce ?? '' }}">
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
window.WebCookieNotice = {};
|
||||
@foreach($cookies as $index_name => $cookie)
|
||||
window.WebCookieNotice['{{ $index_name }}'] = {};
|
||||
window.WebCookieNotice['{{ $index_name }}'].tmp = {};
|
||||
// SCRIPT
|
||||
window.WebCookieNotice['{{ $index_name }}'].tmp.script = {!! strip_tags($cookie['script']) !!};
|
||||
@php unset($cookie['script']); @endphp
|
||||
// FALLBACK
|
||||
@if(isset($cookie['fallback']))
|
||||
window.WebCookieNotice['{{ $index_name }}'].tmp.fallback = {!! strip_tags($cookie['fallback']) !!};
|
||||
@php unset($cookie['fallback']); @endphp
|
||||
@endif
|
||||
window.WebCookieNotice['{{ $index_name }}'].conf = @json($cookie);
|
||||
window.WebCookieNotice['{{ $index_name }}'].conf.script = window.WebCookieNotice['{{ $index_name }}'].tmp.script;
|
||||
window.WebCookieNotice['{{ $index_name }}'].conf.fallback = window.WebCookieNotice['{{ $index_name }}'].tmp.fallback;
|
||||
window.WebCookieNotice['{{ $index_name }}'] = window.WebCookieNotice['{{ $index_name }}'].conf;
|
||||
@endforeach
|
||||
window.WebCookieNotice = new window.CookieNotice(window.WebCookieNotice);
|
||||
window.Recaptcha([].slice.call(document.querySelectorAll(".recaptcha-form")));
|
||||
});
|
||||
</script>
|
||||
78
resources/views/front/vendor/cookie-notice/templates/standard.blade.php
vendored
Normal file
78
resources/views/front/vendor/cookie-notice/templates/standard.blade.php
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<div id="cn-wrapper" title="{{ $strings->modal_title }}" role="alertdialog" tabindex="-1">
|
||||
<button id="cn-cookie-btn" title="{{ $strings->button_customize_cookies }}">
|
||||
{{-- COOKIE SVG --}}
|
||||
<svg viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>{{ $strings->picture_cookie_title }}</title>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd"
|
||||
d="M14.0001 2.93383C14.0001 4.16622 14.6159 5.25477 15.5567 5.90849C15.3526 6.46423 15.2412 7.06473 15.2412 7.69126C15.2412 10.5472 17.5564 12.8624 20.4123 12.8624C21.0807 12.8624 21.7195 12.7356 22.3059 12.5047C22.9456 13.527 24.0817 14.2069 25.3766 14.2069C26.1872 14.2069 26.9357 13.9404 27.539 13.4903C27.5453 13.6594 27.5484 13.8294 27.5484 14C27.5484 21.4826 21.4826 27.5484 14 27.5484C6.51748 27.5484 0.45166 21.4826 0.45166 14C0.45166 6.51748 6.51748 0.45166 14 0.45166C14.3209 0.45166 14.6391 0.462811 14.9543 0.484747C14.3618 1.12929 14.0001 1.98931 14.0001 2.93383ZM21.2176 2.53212C21.2195 2.54914 21.2213 2.56619 21.2229 2.58328C21.2569 2.58864 21.2909 2.59433 21.3247 2.60035C21.2891 2.57745 21.2534 2.5547 21.2176 2.53212ZM25.5171 6.86104C25.523 6.89745 25.5285 6.93399 25.5336 6.97066C25.5512 6.97141 25.5687 6.97228 25.5861 6.97328C25.5633 6.93574 25.5403 6.89833 25.5171 6.86104ZM12.5247 2.09283C12.4748 2.38291 12.4487 2.68118 12.4487 2.98553C12.4487 4.33316 12.9591 5.56158 13.7972 6.48802C13.7266 6.87842 13.6898 7.28054 13.6898 7.69126C13.6898 11.404 16.6996 14.4137 20.4123 14.4137C20.8725 14.4137 21.3219 14.3675 21.7562 14.2794C22.689 15.1941 23.9669 15.7582 25.3766 15.7582C25.5439 15.7582 25.7094 15.7503 25.8726 15.7347C25.0321 21.5385 20.0368 25.9971 14.0001 25.9971C7.37431 25.9971 2.00305 20.6258 2.00305 14.0001C2.00305 7.87378 6.59498 2.82 12.5247 2.09283Z"
|
||||
fill="#de0d22" />
|
||||
<circle cx="7.58784" cy="12.8624" r="1.96503" fill="#de0d22" />
|
||||
<circle cx="8.82887" cy="19.2745" r="1.3445" fill="#de0d22" />
|
||||
<circle cx="13.6897" cy="14.5171" r="1.03423" fill="#de0d22" />
|
||||
<circle cx="11.4144" cy="7.48439" r="0.930805" fill="#de0d22" />
|
||||
<circle cx="17.5164" cy="20.3089" r="1.86161" fill="#de0d22" />
|
||||
<circle cx="21.3432" cy="6.7604" r="0.930805" fill="#de0d22" />
|
||||
<circle cx="22.1706" cy="1.89958" r="1.44792" fill="#de0d22" />
|
||||
<circle cx="26.8245" cy="8.31185" r="0.72396" fill="#de0d22" />
|
||||
</svg>
|
||||
</button>
|
||||
{{-- BANNER --}}
|
||||
<div id="cn-banner" tabindex="-1">
|
||||
<div class="cn-modal-top-line">
|
||||
<button id="cn-close-modal" title="{{ $strings->button_close_cookies }}">X</button>
|
||||
</div>
|
||||
{{-- CONTENT VIEW --}}
|
||||
<div class="cn-content" title="{{ $strings->panel_content }}" tabindex="0">
|
||||
{{-- 1ST PAGE BANNER --}}
|
||||
<div class="cn-banner-content">
|
||||
<div class="cn-banner-img">
|
||||
<img src="{{ $logo_picture_url }}" title="{{ $logo_title_text }}" alt="{{ $logo_alt_text }}">
|
||||
</div>
|
||||
<div class="cn-banner-text">
|
||||
<div class="cn-banner-title">
|
||||
<span>{!! nl2br(e($strings->banner_title)) !!}</span>
|
||||
</div>
|
||||
<div class="cn-banner-para-p">
|
||||
<p>{!! clean($strings->banner_text) !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- 2ND PAGE CUSTOMIZE PANEL --}}
|
||||
<div class="cn-modal-container d-none">
|
||||
<div class="cn-modal-wrapper">
|
||||
{{-- COOKIES LIST --}}
|
||||
<ul id="cn-modal-list"></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{-- NAV BAR --}}
|
||||
<div class="cn-nav" title="{{ $strings->navigation_title }}" role="navigation">
|
||||
<button class="cn-banner-btn cn-deny" id="cn-deny-banner"
|
||||
title="{{ $strings->button_forbid_all_title }}">{{ $strings->button_forbid_all }}</button>
|
||||
<button class="cn-banner-btn cn-accept" id="cn-accept-banner"
|
||||
title="{{ $strings->button_allow_all_title }}">{{ $strings->button_allow_all }}</button>
|
||||
<button class="cn-banner-btn cn-custom" id="cn-settings-banner"
|
||||
data-open-modal="{{ $strings->button_validate_and_close }}"
|
||||
data-close-modal="{{ $strings->button_customize }}">{{ $strings->button_customize }}</button>
|
||||
</div>
|
||||
|
||||
{{-- COOKIE LIST LI TEMPLATE --}}
|
||||
<div id="cn-li-template">
|
||||
<div class="cn-cookie-wrapper">
|
||||
<div class="cn-cookie-infos">
|
||||
<span class="cn-cookie-name">#name</span>
|
||||
<span class="cn-cookie-description">#description</span>
|
||||
<a class="cn-cookie-link" title="{{ $strings->button_title_open_new_tab }}"
|
||||
target="blank">#link</a>
|
||||
</div>
|
||||
<div class="cn-cookie-buttons">
|
||||
<label class="cn-switch" title="{{ $strings->button_toggle_cookie }}" role="checkbox"
|
||||
aria-label="{{ $strings->button_toggle_cookie }}" aria-checked="undefined" tabindex="0">
|
||||
<input type="checkbox" tabindex="-1" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2,9 +2,30 @@
|
|||
|
||||
use App\Http\Controllers\Front\HomeController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Inertia\Inertia;
|
||||
|
||||
Route::get('/', [HomeController::class, 'homepage'])->name('homepage');
|
||||
|
||||
Route::get('/nos-engagements', function() {
|
||||
return Inertia::render('front/Pages/Commitment');
|
||||
})->name('engage');
|
||||
|
||||
Route::get('/nos-engagements/fabrique-en-france', function() {
|
||||
return Inertia::render('front/Pages/MadeInFrance');
|
||||
})->name('made-in-france');
|
||||
|
||||
Route::get('/nos-engagements/expertise', function() {
|
||||
return Inertia::render('front/Pages/Expertise');
|
||||
})->name('expertise');
|
||||
|
||||
Route::get('/nos-engagements/gamme', function() {
|
||||
return Inertia::render('front/Pages/Gamme');
|
||||
})->name('gamme');
|
||||
|
||||
Route::get('/nous-contacter', function() {
|
||||
return Inertia::render('front/Pages/Contact/ContactUs');
|
||||
})->name('contact-us');
|
||||
|
||||
Route::get('/demo', function() {
|
||||
return inertia('front/Pages/Demo');
|
||||
})->name('demo');
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
],
|
||||
"$/uwil/*": [
|
||||
"resources/ts/front/Components/Theme/*"
|
||||
],
|
||||
"$/base/*": [
|
||||
"resources/ts/front/Components/Base/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,30 +5,50 @@ import path from "path";
|
|||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
input: [
|
||||
'resources/ts/app.tsx',
|
||||
'resources/sass/front/app.scss',
|
||||
'resources/sass/back/app.scss',
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
react(),
|
||||
copy({
|
||||
targets: [
|
||||
{
|
||||
src: path.normalize("resources/favicons/front/*"),
|
||||
dest: path.normalize("public/")
|
||||
},
|
||||
{
|
||||
src: path.normalize("resources/favicon/back/*"),
|
||||
dest: path.normalize("public/favicon-back")
|
||||
},
|
||||
],
|
||||
copyOnce: true,
|
||||
verbose: true
|
||||
}),
|
||||
plugins: [
|
||||
laravel({
|
||||
input: [
|
||||
'resources/ts/app.tsx',
|
||||
'resources/sass/front/app.scss',
|
||||
'resources/sass/back/app.scss',
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
react(),
|
||||
copy({
|
||||
targets: [
|
||||
{
|
||||
src: path.normalize("resources/favicons/front/*"),
|
||||
dest: path.normalize("public/")
|
||||
},
|
||||
{
|
||||
src: path.normalize("resources/favicon/back/*"),
|
||||
dest: path.normalize("public/favicon-back")
|
||||
},
|
||||
],
|
||||
copyOnce: true,
|
||||
verbose: true
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{
|
||||
find: "&",
|
||||
replacement: "/resources/assets",
|
||||
},
|
||||
{
|
||||
find: "@",
|
||||
replacement: "/resources/ts",
|
||||
},
|
||||
{
|
||||
find: "$/uwil",
|
||||
replacement: "/resources/ts/front/Components/Theme",
|
||||
},
|
||||
{
|
||||
find: "$/base",
|
||||
replacement: "/resources/ts/front/Components/Base",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue