Skip to content

Commit

Permalink
Feat: Moving prices to footer
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin committed Jul 11, 2023
1 parent 6e27f18 commit 9574f2b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions source/php/Component/Product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function init()
if (!isset($button['color'])) {
$this->data['button']['color'] = $backgroundColor;
}
$this->data['button']['classList'][] = 'c-product__button';
}
}
}
7 changes: 3 additions & 4 deletions source/php/Component/Product/components/button.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<div class="c-card__footer">
@button($button)
@endbutton
</div>
@button($button)
@endbutton

2 changes: 2 additions & 0 deletions source/php/Component/Product/components/price.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div class="{{$baseClass}}__prices {{!empty($button) ? 'has-button' : ''}}">
@foreach ($prices as $price)
<div class="{{ $baseClass }}__price {{ $baseClass }}__price--{{ $price['color'] ?? $backgroundColor ?? 'primary' }}">
@typography([
Expand Down Expand Up @@ -28,3 +29,4 @@
@endif
</div>
@endforeach
</div>
8 changes: 4 additions & 4 deletions source/php/Component/Product/product.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
])
{{ $label }}
@endtypography
<div class="{{$baseClass}}__prices">
@includeWhen($prices, 'Product.components.price')
</div>
</div>
<div class="c-card__body c-product__body">
@if ($meta)
Expand All @@ -39,6 +36,9 @@
@endlisting
@endif
</div>
@includeWhen(!empty($button), 'Product.components.button')
<div class="c-card__footer {{$baseClass}}__footer">
@includeWhen($prices, 'Product.components.price')
@includeWhen(!empty($button), 'Product.components.button')
</div>
@endcard
</div>

0 comments on commit 9574f2b

Please sign in to comment.