From fe6b05016ed96b513e20f31e2321b3f1a08834e5 Mon Sep 17 00:00:00 2001 From: Damien Foulhoux Date: Mon, 9 Sep 2024 16:14:27 +0200 Subject: [PATCH] use symfony ux to display svg icons instead of custom function --- assets/js/twig/custom-twig.ts | 2 +- components/Atoms/Form/Checkbox.twig | 2 +- components/Atoms/Form/checkbox.css | 4 +-- components/Atoms/Icon/Icon.twig | 2 +- components/Layout/Footer/Footer.twig | 12 +++---- components/Layout/Header/Header.twig | 20 ++++++++--- components/Layout/Header/HeaderCheckout.twig | 6 ++-- .../Layout/Reinsurance/Reinsurance.twig | 4 ++- components/Molecules/Accordion/Accordion.twig | 12 +++++-- components/Molecules/Button/Button.twig | 8 +++-- components/Molecules/Favorite/Favorite.twig | 4 ++- .../Filters/FilterPill/FilterPill.twig | 4 +-- .../Filters/FilterSelect/FilterSelect.twig | 4 +-- .../Molecules/HeaderButton/HeaderButton.twig | 2 +- .../Molecules/ItemHeader/ItemHeader.twig | 4 +-- components/Molecules/Link/Link.twig | 4 +-- .../Molecules/Pagination/Pagination.twig | 12 +++---- components/Molecules/Score/Score.twig | 4 +-- components/Molecules/SearchBar/SearchBar.twig | 2 +- components/Molecules/Step/Steps.twig | 2 +- components/Molecules/Tab/Tab.twig | 4 +-- components/Molecules/Tag/Tag.twig | 6 ++-- components/Molecules/Tooltip/Tooltip.twig | 4 +-- components/Molecules/userMenu/UserMenu.twig | 2 +- .../Organisms/Card/Address/AddressCard.twig | 4 +-- .../Organisms/Card/Payment/PaymentCard.twig | 2 +- .../Card/PickupPoint/PickupPoint.twig | 2 +- .../Card/PickupPoint/PickupPointDrawer.twig | 2 +- .../Organisms/Card/StoreInfo/StoreInfo.twig | 2 +- .../Modules/HomeDelivery/HomeDelivery.twig | 2 +- .../Organisms/Modules/Payment/Payment.twig | 2 +- .../PickupPointModule/PickupPointModule.twig | 6 ++-- .../Modules/StoreDelivery/StoreDelivery.twig | 4 +-- .../Organisms/ProductCard/ProductCard.twig | 16 ++++----- .../Organisms/ProductCard/PurchaseFunnel.twig | 2 +- .../Organisms/Reinsurance/Reinsurance.twig | 2 +- components/Organisms/SnackBar/SnackBar.twig | 2 +- index.html.twig | 2 +- product.html.twig | 2 +- .../Molecules/Filters/FilterPill.tsx | 35 ++++++++++--------- src/FlexyBundle.php | 17 +++++---- 41 files changed, 131 insertions(+), 103 deletions(-) diff --git a/assets/js/twig/custom-twig.ts b/assets/js/twig/custom-twig.ts index e7ae0a4..35ba09f 100644 --- a/assets/js/twig/custom-twig.ts +++ b/assets/js/twig/custom-twig.ts @@ -3,7 +3,7 @@ import Twig from 'twig'; // @ts-ignore import IconTwig from './IconTwig.twig'; -Twig.extendFunction('svg', (iconName: string): string => { +Twig.extendFunction('ux_icon', (iconName: string): string => { return IconTwig({ icon: iconName }); }); diff --git a/components/Atoms/Form/Checkbox.twig b/components/Atoms/Form/Checkbox.twig index 35cca99..e6959fe 100644 --- a/components/Atoms/Form/Checkbox.twig +++ b/components/Atoms/Form/Checkbox.twig @@ -9,7 +9,7 @@ diff --git a/components/Atoms/Form/checkbox.css b/components/Atoms/Form/checkbox.css index cf5ad8f..35ec819 100644 --- a/components/Atoms/Form/checkbox.css +++ b/components/Atoms/Form/checkbox.css @@ -27,8 +27,8 @@ } } .checkmark { - width: 16px; - height: 16px; + width: 1rem; + height: 1rem; background: var(--white); border: 1px solid var(--current-checkbox-color); border-radius: 2px; diff --git a/components/Atoms/Icon/Icon.twig b/components/Atoms/Icon/Icon.twig index 08dd691..d525dff 100644 --- a/components/Atoms/Icon/Icon.twig +++ b/components/Atoms/Icon/Icon.twig @@ -5,7 +5,7 @@ {% for icon in line %}
- {{ svg(icon) }} + {{ ux_icon(icon) }}
{{ icon }}
diff --git a/components/Layout/Footer/Footer.twig b/components/Layout/Footer/Footer.twig index 7de8944..43491f2 100644 --- a/components/Layout/Footer/Footer.twig +++ b/components/Layout/Footer/Footer.twig @@ -41,22 +41,22 @@
diff --git a/components/Layout/Header/Header.twig b/components/Layout/Header/Header.twig index dc6f40a..c9d57e6 100644 --- a/components/Layout/Header/Header.twig +++ b/components/Layout/Header/Header.twig @@ -10,7 +10,9 @@ {% endif %}
@@ -20,8 +22,12 @@ {% else %}