From f3ea6ee166144a8fd07017b32e235da707b0e7ce Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Wed, 3 Aug 2022 10:48:18 +0200
Subject: [PATCH] icon fix

---
 app/services/icon.rb                          | 3 +++
 app/views/admin/application/_preview.html.erb | 6 +++---
 config/locales/fr.yml                         | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/services/icon.rb b/app/services/icon.rb
index a50e868fd..f67430b58 100644
--- a/app/services/icon.rb
+++ b/app/services/icon.rb
@@ -10,6 +10,9 @@ class Icon
   COMMUNICATION_WEBSITE_PAGES = 'sitemap'
   COMMUNICATION_WEBSITE_MENUS = 'bars'
   COMMUNICATION_WEBSITE_ANALYTICS = 'chart-pie'
+  COMMUNICATION_WEBSITE_PREVIEW_MOBILE = 'mobile-alt'
+  COMMUNICATION_WEBSITE_PREVIEW_TABLET = 'tablet-alt'
+  COMMUNICATION_WEBSITE_PREVIEW_DESKTOP = 'laptop'
 
   EDUCATION_DIPLOMA = 'graduation-cap'
   EDUCATION_PROGRAM = 'chalkboard-teacher'
diff --git a/app/views/admin/application/_preview.html.erb b/app/views/admin/application/_preview.html.erb
index 6e10605cb..89af7d270 100644
--- a/app/views/admin/application/_preview.html.erb
+++ b/app/views/admin/application/_preview.html.erb
@@ -8,15 +8,15 @@
         <h5 class="modal-title h4"><%= t 'preview.title' %></h5>
         <div class="btn-group m-auto" role="group" aria-label="Basic example">
           <button type="button" class="btn btn-primary preview__button" data-mode="mobile">
-            <i class="fas fa-mobile-alt"></i>
+            <i class="fas fa-<%= Icon::COMMUNICATION_WEBSITE_PREVIEW_MOBILE %>"></i>
             <%= t 'preview.mobile' %>
           </button>
           <button type="button" class="btn btn-light preview__button" data-mode="tablet">
-            <i class="fas fa-tablet-alt"></i>
+            <i class="fas fa-<%= Icon::COMMUNICATION_WEBSITE_PREVIEW_TABLET %>"></i>
             <%= t 'preview.tablet' %>
           </button>
           <button type="button" class="btn btn-light preview__button" data-mode="desktop">
-            <i class="fas fa-desktop"></i>
+            <i class="fas fa-<%= Icon::COMMUNICATION_WEBSITE_PREVIEW_DESKTOP %>"></i>
             <%= t 'preview.desktop' %>
           </button>
         </div>
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index d6ff7c7d5..50fb3b687 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -236,7 +236,7 @@ fr:
     title: Prévisualisation
     mobile: Mobile
     tablet: Tablette
-    desktop: Ordinateur de bureau
+    desktop: Ordinateur
   privacy_policy: Politique de confidentialité
   privacy_policy_url: https://osuny.org/politique-de-confidentialite
   properties:
-- 
GitLab