Skip to content

Commit

Permalink
Jl/fix new modal (#247)
Browse files Browse the repository at this point in the history
* fix svg icons position

* hide quantity if shoppinglist is disabled
  • Loading branch information
jrlarano authored Sep 9, 2024
1 parent 45b7678 commit 6628907
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/kits/core-ui/components/common/offer-overview.styl
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
height 36px

svg
display inline
vertical-align middle
width 16px
height 16px
Expand Down Expand Up @@ -391,6 +392,7 @@
border 0.5px solid #7b7b7b

svg
display inline
width 10px
height 10px

Expand Down
14 changes: 11 additions & 3 deletions lib/kits/core-ui/components/common/offer-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const defaultTemplate = `\
<div class="sgn-product-description"><span>{{description}}</span></div>
</div>
<div class="sgn-product-price-container">
{{#showQuantityButtons}}
<div id="sgn-offer-product-quantity-{{id}}" class="sgn-offer-product-quantity">
<div class="sgn-offer-product-quantity-content">
<button id="sgn-offer-product-quantity-minus-{{id}}" class="sgn-offer-product-quantity-minus">
Expand All @@ -88,6 +89,7 @@ const defaultTemplate = `\
</button>
</div>
</div>
{{/showQuantityButtons}}
<div class="sgn-product-price"><span>{{formattedPrice}}</span></div>
</div>
</div>
Expand Down Expand Up @@ -149,13 +151,19 @@ const OfferOverview = ({
? await fetchOffer(offer.id)
: await transformIncitoOffer(offer);

const disableShoppingList = document.querySelector(
'.sgn__offer-shopping'
)
? false
: true;

container.innerHTML = Mustache.render(template, {
translations,
label: sgnData?.details?.label,
disableShoppingList: document.querySelector('.sgn__offer-shopping')
? false
: true,
disableShoppingList,
offer: transformedOffer,
showQuantityButtons:
!disableShoppingList || scriptEls.showQuantityButtons,
layoutWidth: sgnData?.incito?.root_view?.layout_width
});

Expand Down
7 changes: 5 additions & 2 deletions lib/kits/core-ui/components/common/shopping-list.styl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
padding 0

> svg
display inline
width 25px

.sgn-shopping-list-items-container
Expand Down Expand Up @@ -112,6 +113,7 @@
height 36px

svg
display inline
vertical-align middle
width 16px
height 16px
Expand All @@ -121,7 +123,7 @@
border unset
background unset
width 30px
padding 8px 0
padding 0
text-align center

.sgn-shopping-list-content-ticker-box
Expand Down Expand Up @@ -179,6 +181,7 @@
border 0.5px solid #7b7b7b

svg
display inline
width 10px
height 10px

Expand All @@ -187,7 +190,7 @@
border unset
background unset
width 30px
padding 8px 0
padding 0
text-align center

@media print
Expand Down
2 changes: 2 additions & 0 deletions lib/kits/core-ui/components/common/sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
width 50px

> svg
display inline
width 25px
height 25px

Expand Down Expand Up @@ -337,6 +338,7 @@
color #ffffff

> svg
display inline
width 25px
height 25px

Expand Down
2 changes: 2 additions & 0 deletions lib/kits/core-ui/components/helpers/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export const transformScriptData = (
dataset.componentPublicationSidebarPosition === 'left'
? 'left'
: 'right',
showQuantityButtons:
dataset.componentPublicationShowQuantityButtons === 'true',
enableLazyload: dataset.componentPublicationEnableLazyload === 'true',
requestFilter: dataset.componentListPublicationsRequestFilter,
clientFilter: dataset.componentListPublicationsClientFilter,
Expand Down

0 comments on commit 6628907

Please sign in to comment.