From e04342f904d944981486098d068b9f9b9205b84f Mon Sep 17 00:00:00 2001
From: xaralis <filip.varecha@fragaria.cz>
Date: Fri, 27 May 2022 09:43:49 +0100
Subject: [PATCH] fix(shared): button block not respecting icon

---
 .../styleguide/2.3.x/blocks/button_block.html        | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/shared/templates/styleguide/2.3.x/blocks/button_block.html b/shared/templates/styleguide/2.3.x/blocks/button_block.html
index 180e5fbd..b68f389a 100644
--- a/shared/templates/styleguide/2.3.x/blocks/button_block.html
+++ b/shared/templates/styleguide/2.3.x/blocks/button_block.html
@@ -1,7 +1,13 @@
 {% load wagtailcore_tags wagtailimages_tags %}
 {% firstof self.page.url self.link as target %}
-
-<a href="{{ target }}" class="btn btn--{{ self.color }} {% if self.hoveractive %}btn--hoveractive{% endif %} btn--autowidth text-{{ self.size }}"
+<a href="{{ target }}" class="btn btn--{{ self.color }} {% if self.hoveractive %}btn--hoveractive{% endif %} {% if self.icon %}btn--icon{% endif %} btn--autowidth text-{{ self.size }}"
 >
-    <div class="btn__body ">{{ self.title }}</div>
+    {% if self.icon %}
+        <div class="btn__body-wrap">
+            <div class="btn__body ">{{ self.title }}</div>
+            <div class="btn__icon "><i class="ico--{{ self.icon }}"></i></div>
+        </div>
+    {% else %}
+        <div class="btn__body ">{{ self.title }}</div>
+    {% endif %}
 </a>
-- 
GitLab