From 735eb140a9d115b0679590b4507192f2bda98d10 Mon Sep 17 00:00:00 2001
From: SofianeLasri <alasri250@gmail.com>
Date: Thu, 20 Feb 2025 14:45:21 +0100
Subject: [PATCH] feat: add contact page and update references

- Created a new contact page with a description and social media links.
- Updated the footer and navbar to link to the new contact page.
- Adjusted multiple button links throughout the site to point to the contact route.
- Added French language support for the contact description.
---
 lang/fr/contact.php                           |  5 ++++
 .../views/components/public/footer.blade.php  |  2 +-
 .../views/components/public/navbar.blade.php  |  4 +--
 resources/views/public/contact.blade.php      | 30 +++++++++++++++++++
 resources/views/public/index.blade.php        |  3 +-
 resources/views/public/prestation.blade.php   |  2 +-
 resources/views/public/prestations.blade.php  |  2 +-
 routes/web.php                                |  1 +
 8 files changed, 43 insertions(+), 6 deletions(-)
 create mode 100644 lang/fr/contact.php
 create mode 100644 resources/views/public/contact.blade.php

diff --git a/lang/fr/contact.php b/lang/fr/contact.php
new file mode 100644
index 0000000..5b48a6b
--- /dev/null
+++ b/lang/fr/contact.php
@@ -0,0 +1,5 @@
+<?php
+
+return [
+    'desc' => 'Vous avez un projet en tête ou souhaitez discuter de vos besoins en design graphique ? N\'hésitez pas à me contacter ! Que ce soit pour une collaboration, une demande de devis ou simplement pour échanger des idées créatives, je suis là pour vous aider.',
+];
diff --git a/resources/views/components/public/footer.blade.php b/resources/views/components/public/footer.blade.php
index b49d55e..de488c3 100644
--- a/resources/views/components/public/footer.blade.php
+++ b/resources/views/components/public/footer.blade.php
@@ -13,7 +13,7 @@
                             {{ __('footer.contact.desc') }}
                         </div>
                     </div>
-                    <x-public.button size="medium" tag="a" href="#">
+                    <x-public.button size="medium" tag="a" href="{{ route('contact') }}">
                         <div class="text-xl font-bold">{{ __('navbar.contact_me') }}</div>
                     </x-public.button>
                 </div>
diff --git a/resources/views/components/public/navbar.blade.php b/resources/views/components/public/navbar.blade.php
index 0c0612b..f4d6917 100644
--- a/resources/views/components/public/navbar.blade.php
+++ b/resources/views/components/public/navbar.blade.php
@@ -17,7 +17,7 @@
                 <a href="{{ route('prestations') }}" class="text-xl font-bold">{{ __('navbar.services') }}</a>
                 <a href="{{ route('portfolio') }}" class="text-xl font-bold">{{ __('navbar.portfolio') }}</a>
                 <a href="{{ route('evenements') }}" class="text-xl font-bold">{{ __('navbar.events') }}</a>
-                <a href="#" class="text-xl font-bold">{{ __('navbar.contact_me') }}</a>
+                <a href="{{ route('contact') }}" class="text-xl font-bold">{{ __('navbar.contact_me') }}</a>
                 <x-public.button tag="a" href="https://dalnarabyrann.sumupstore.com/">
                     {{ __('navbar.shop') }}
                 </x-public.button>
@@ -41,7 +41,7 @@ class="fixed z-50 inset-0 bg-white bg-opacity-90 flex-col items-center justify-c
         <a href="{{ route('prestations') }}" class="text-2xl font-bold">{{ __('navbar.services') }}</a>
         <a href="{{ route('portfolio') }}" class="text-2xl font-bold">{{ __('navbar.portfolio') }}</a>
         <a href="{{ route('evenements') }}" class="text-2xl font-bold">{{ __('navbar.events') }}</a>
-        <a href="#" class="text-2xl font-bold">{{ __('navbar.contact_me') }}</a>
+        <a href="{{ route('contact') }}" class="text-2xl font-bold">{{ __('navbar.contact_me') }}</a>
         <x-public.button tag="a" href="https://dalnarabyrann.sumupstore.com/" class="text-xl">
             {{ __('navbar.shop') }}
         </x-public.button>
diff --git a/resources/views/public/contact.blade.php b/resources/views/public/contact.blade.php
new file mode 100644
index 0000000..5861a61
--- /dev/null
+++ b/resources/views/public/contact.blade.php
@@ -0,0 +1,30 @@
+@extends('layouts.public', ['title' => __('navbar.contact_me')])
+
+@section('content')
+    <x-public.navbar class="container mx-auto px-4"/>
+    <div class="container mx-auto px-4 py-24 flex flex-col gap-16">
+        <x-public.generic-page-header title="{{ __('navbar.contact_me') }}" :description="__('contact.desc')"/>
+
+        <div>
+            <div class="text-center text-2xl">
+                Contactez moi sur l'un de mes réseaux
+            </div>
+
+            <div class="flex align-center justify-center gap-4 mt-4">
+                @foreach(\App\Models\SocialMediaLink::all() as $socialMediaLink)
+                    <x-public.button tag="a" :href="$socialMediaLink->url" class="flex items-center gap-2"
+                                     size="medium">
+                        <div>
+                            {{ $socialMediaLink->name }}
+                        </div>
+                        <div>
+                            <x-font-awesome :icon="$socialMediaLink->icon_name" type="brands" class="w-6 h-6"/>
+                        </div>
+                    </x-public.button>
+                @endforeach
+            </div>
+        </div>
+    </div>
+
+    <x-public.footer/>
+@endsection
\ No newline at end of file
diff --git a/resources/views/public/index.blade.php b/resources/views/public/index.blade.php
index 72ec9b6..af5927c 100644
--- a/resources/views/public/index.blade.php
+++ b/resources/views/public/index.blade.php
@@ -25,7 +25,8 @@ class="absolute hidden 2xl:block left-[-96px] top-[-26px] origin-top-left rotate
                                     {{ __('home.hero.second_row') }}
                                 </span>
                             </h1>
-                            <x-public.button size="large" tag="a" href="#" class="flex items-center gap-8">
+                            <x-public.button size="large" tag="a" href="{{ route('contact') }}"
+                                             class="flex items-center gap-8">
                                 <img class="w-10 h-10" src="{{Vite::asset("resources/images/public/waving-hand.avif")}}"
                                      alt="{{ __('home.img_alt.waving_hand') }}" loading="eager"/>
                                 <div class="flex flex-col justify-center items-start">
diff --git a/resources/views/public/prestation.blade.php b/resources/views/public/prestation.blade.php
index 7fd1dc6..71e3662 100644
--- a/resources/views/public/prestation.blade.php
+++ b/resources/views/public/prestation.blade.php
@@ -45,7 +45,7 @@ class="w-full relative aspect-square"/>
                 {{ __('generic.custom_needs_desc') }}
             </div>
         </div>
-        <x-public.button size="medium" tag="a" href="#">
+        <x-public.button size="medium" tag="a" href="{{ route('contact') }}">
             <div class="text-xl font-bold">{{ __('navbar.contact_me') }}</div>
         </x-public.button>
     </div>
diff --git a/resources/views/public/prestations.blade.php b/resources/views/public/prestations.blade.php
index 5d052fa..bd230a3 100644
--- a/resources/views/public/prestations.blade.php
+++ b/resources/views/public/prestations.blade.php
@@ -17,7 +17,7 @@
                 {{ __('generic.custom_needs_desc') }}
             </div>
         </div>
-        <x-public.button size="medium" tag="a" href="#">
+        <x-public.button size="medium" tag="a" href="{{ route('contact') }}">
             <div class="text-xl font-bold">{{ __('navbar.contact_me') }}</div>
         </x-public.button>
     </div>
diff --git a/routes/web.php b/routes/web.php
index 3f72ca5..805fcfe 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -33,6 +33,7 @@
     Route::get('/prestations/{slug}', [PublicPrestationController::class, 'index'])->name('prestations.show');
     Route::get('/mentions-legales', LegalMentionsController::class)->name('legal-mentions');
     Route::get('/conditions-generales-de-vente', TermsController::class)->name('terms');
+    Route::view('/contact', 'public.contact')->name('contact');
 
     Route::view('/maintenance', 'public.maintenance')->name('maintenance');
 });
-- 
GitLab