From 624499361ef47261901d5233d71612d0fb2d1ecc Mon Sep 17 00:00:00 2001 From: Jimmy Hoenderdaal Date: Mon, 16 Dec 2024 13:52:00 +0100 Subject: [PATCH 1/5] Fix layout shift on thumbnails, reviews, quantity --- resources/views/components/quantity.blade.php | 2 + .../views/components/reviews/stars.blade.php | 16 +++ resources/views/product/overview.blade.php | 2 +- .../product/partials/gallery/popup.blade.php | 4 +- .../product/partials/gallery/slider.blade.php | 34 +++-- .../partials/gallery/thumbnails.blade.php | 130 +++++++++++++----- .../views/product/partials/images.blade.php | 20 +-- 7 files changed, 139 insertions(+), 69 deletions(-) create mode 100644 resources/views/components/reviews/stars.blade.php diff --git a/resources/views/components/quantity.blade.php b/resources/views/components/quantity.blade.php index 940abf093..689229add 100644 --- a/resources/views/components/quantity.blade.php +++ b/resources/views/components/quantity.blade.php @@ -6,6 +6,7 @@
diff --git a/resources/views/product/overview.blade.php b/resources/views/product/overview.blade.php index 35015f189..1009d6899 100644 --- a/resources/views/product/overview.blade.php +++ b/resources/views/product/overview.blade.php @@ -20,7 +20,7 @@ @includeWhen($product->type_id !== 'grouped', 'rapidez::product.partials.addtocart') @if (App::providerIsLoaded('Rapidez\Reviews\ReviewsServiceProvider')) @if ($product->reviews_score) - + @endif @endif
diff --git a/resources/views/product/partials/gallery/popup.blade.php b/resources/views/product/partials/gallery/popup.blade.php index 0e5b63a25..dc2acbbab 100644 --- a/resources/views/product/partials/gallery/popup.blade.php +++ b/resources/views/product/partials/gallery/popup.blade.php @@ -1,4 +1,4 @@ -
+
-
\ No newline at end of file +
diff --git a/resources/views/product/partials/gallery/slider.blade.php b/resources/views/product/partials/gallery/slider.blade.php index 029ac8967..0ba713575 100644 --- a/resources/views/product/partials/gallery/slider.blade.php +++ b/resources/views/product/partials/gallery/slider.blade.php @@ -1,23 +1,33 @@ -
+
{{ $product->name }} - - + @if (count($product->images) > 1) + + + @endif
- + diff --git a/resources/views/product/partials/gallery/thumbnails.blade.php b/resources/views/product/partials/gallery/thumbnails.blade.php index 87900ae6a..3bc397f9e 100644 --- a/resources/views/product/partials/gallery/thumbnails.blade.php +++ b/resources/views/product/partials/gallery/thumbnails.blade.php @@ -1,40 +1,96 @@ -@php($breakpoints = ['xl' => 7, 'lg' => 5, 'md' => 4, 'sm' => 3, 'xs' => 4]) -
- + @endif + @endforeach + +
diff --git a/resources/views/product/partials/images.blade.php b/resources/views/product/partials/images.blade.php index a8e9c54b7..161b07083 100644 --- a/resources/views/product/partials/images.blade.php +++ b/resources/views/product/partials/images.blade.php @@ -4,28 +4,14 @@ @include('rapidez::wishlist.button')
@endif - @if (count($product->images)) -
-
- {{ $product->name }} -
-
- @endif - - +
@include('rapidez::product.partials.gallery.slider') - @include('rapidez::product.partials.gallery.thumbnails') + @includeWhen(count($product->images) > 1, 'rapidez::product.partials.gallery.thumbnails')
@include('rapidez::product.partials.gallery.popup')
-
\ No newline at end of file +
From d4f8010ee7c907b72e540a4f21b03c6f48ae144f Mon Sep 17 00:00:00 2001 From: Jimmy Hoenderdaal Date: Wed, 18 Dec 2024 10:11:21 +0100 Subject: [PATCH 2/5] Seperate reviews stars to reviews package --- .../views/components/reviews/stars.blade.php | 16 ---------------- resources/views/product/overview.blade.php | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 resources/views/components/reviews/stars.blade.php diff --git a/resources/views/components/reviews/stars.blade.php b/resources/views/components/reviews/stars.blade.php deleted file mode 100644 index e05d7a8bc..000000000 --- a/resources/views/components/reviews/stars.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@props(['score', 'count']) -
-
-
- @for ($star = 0; $star < 5; $star++) - - @endfor -
-
- @for ($star = 0; $star < 5; $star++) - - @endfor -
-
- ({{ $count }}) -
diff --git a/resources/views/product/overview.blade.php b/resources/views/product/overview.blade.php index 1009d6899..57d7605dc 100644 --- a/resources/views/product/overview.blade.php +++ b/resources/views/product/overview.blade.php @@ -20,7 +20,7 @@ @includeWhen($product->type_id !== 'grouped', 'rapidez::product.partials.addtocart') @if (App::providerIsLoaded('Rapidez\Reviews\ReviewsServiceProvider')) @if ($product->reviews_score) - + @endif @endif
From cd30b78d5610b7c3201afc21c33522d9af1571de Mon Sep 17 00:00:00 2001 From: Jimmy Hoenderdaal Date: Wed, 18 Dec 2024 10:33:31 +0100 Subject: [PATCH 3/5] Revert stars --- resources/views/product/overview.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/product/overview.blade.php b/resources/views/product/overview.blade.php index 57d7605dc..35015f189 100644 --- a/resources/views/product/overview.blade.php +++ b/resources/views/product/overview.blade.php @@ -20,7 +20,7 @@ @includeWhen($product->type_id !== 'grouped', 'rapidez::product.partials.addtocart') @if (App::providerIsLoaded('Rapidez\Reviews\ReviewsServiceProvider')) @if ($product->reviews_score) - + @endif @endif
From ca6e4c4ec3eb594d66d38ed977adb835aa870799 Mon Sep 17 00:00:00 2001 From: Jade Geels Date: Wed, 18 Dec 2024 13:26:47 +0100 Subject: [PATCH 4/5] Remove named route 1 --- resources/views/product/partials/gallery/slider.blade.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/resources/views/product/partials/gallery/slider.blade.php b/resources/views/product/partials/gallery/slider.blade.php index 0ba713575..8c71e2566 100644 --- a/resources/views/product/partials/gallery/slider.blade.php +++ b/resources/views/product/partials/gallery/slider.blade.php @@ -5,13 +5,7 @@ class="flex h-[440px] cursor-zoom-in items-center justify-center rounded border p-5" > {{ $product->name }} Date: Wed, 18 Dec 2024 13:27:30 +0100 Subject: [PATCH 5/5] Image resizer route 2 --- .../views/product/partials/gallery/thumbnails.blade.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/resources/views/product/partials/gallery/thumbnails.blade.php b/resources/views/product/partials/gallery/thumbnails.blade.php index 3bc397f9e..1e14a9d2d 100644 --- a/resources/views/product/partials/gallery/thumbnails.blade.php +++ b/resources/views/product/partials/gallery/thumbnails.blade.php @@ -24,13 +24,7 @@ 'max-sm:hidden' => $imageId > $breakpoints['xs'], ])>