Skip to content

Commit

Permalink
Feat: Project price container added (#314)
Browse files Browse the repository at this point in the history
* Feat: Project price container added

* Feat: Moving prices to footer
  • Loading branch information
NiclasNorin authored Aug 7, 2023
1 parent 5efa884 commit 5b19fdb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 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>
6 changes: 4 additions & 2 deletions source/php/Component/Product/product.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
])
{{ $label }}
@endtypography
@includeWhen($prices, 'Product.components.price')
</div>
<div class="c-card__body c-product__body">
@if ($meta)
Expand All @@ -37,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 5b19fdb

Please sign in to comment.