Skip to content

Commit ecf5aeb

Browse files
committed
Refactor
1 parent 5c4490a commit ecf5aeb

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

components/Products/ProductsShowAll.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
}"
1919
>
2020
<ProductImage :alt="product.name" :src="productImage(product)" />
21-
2221
<div class="flex justify-center pt-3">
2322
<p class="text-2xl font-bold text-center cursor-pointer">
2423
{{ product.name }}
@@ -84,6 +83,12 @@ const props = defineProps({
8483
8584
const config = useRuntimeConfig();
8685
86+
/**
87+
* Returns the source URL of a product image or a placeholder image if the product does not have an image.
88+
*
89+
* @param {Object} product - The product object containing the image source URL.
90+
* @return {string} The source URL of the product image or a placeholder image if the product does not have an image.
91+
*/
8792
const productImage = (product) =>
8893
product.image ? product.image.sourceUrl : config.public.placeholderImage;
8994

layouts/default.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<template>
2-
<div>
3-
<LayoutNavbar />
4-
<div class="container mx-auto max-w-[84.375rem]">
5-
<slot />
6-
</div>
7-
<LayoutFooter />
8-
<LayoutStickyFooter />
2+
<LayoutNavbar />
3+
<div class="container mx-auto max-w-[84.375rem]">
4+
<slot />
95
</div>
6+
<LayoutFooter />
7+
<LayoutStickyFooter />
108
</template>
119

1210
<style>
1311
.home-enter-active,
1412
.home-leave-active {
1513
transition: opacity 0.5s;
1614
}
15+
1716
.home-enter,
1817
.home-leave-active {
1918
opacity: 0;
@@ -23,6 +22,7 @@
2322
.cart-leave-active {
2423
transition: all 0.5s;
2524
}
25+
2626
.cart-enter,
2727
.cart-leave-active {
2828
opacity: 0;

0 commit comments

Comments
 (0)