schon/storefront/app/components/home/blog.vue
Alexandr SaVBaD Waltz 9bf600845a feat(storefront): enhance cart and wishlist handling with cookie-based products support
Introduced `useExactProducts` composable to fetch precise product details for guest cart and wishlist items. Improved cookie-based cart and wishlist fallback handling for unauthenticated users. Updated related components and composables for better synchronization and type safety.

- Added `useExactProducts` composable leveraging the `GET_EXACT_PRODUCTS` query.
- Enhanced `wishlist.vue` and `cart.vue` for reactive updates on guest state changes.
- Improved product synchronization logic in `useOrderSync` and `useWishlistSync`.
- Updated translations and fixed minor typos in localization files.

Improves user experience by ensuring consistent product details, even for guests. No breaking changes.
2026-03-02 23:06:13 +03:00

57 lines
No EOL
1.1 KiB
Vue

<template>
<div class="blog">
<div class="container">
<div class="blog__wrapper">
<h2 class="blog__title">{{ t('home.blog.title') }}</h2>
<div class="blog__posts">
<cards-post
v-for="post in filteredPosts.slice(0, 3)"
:key="post.node.id"
:post="post.node"
/>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type {IPost} from '@types';
import { docsSlugs } from '@appConstants';
const props = defineProps<{
posts: { node: IPost }[];
}>();
const {t} = useI18n();
const filteredPosts = computed(() => {
const excludedSlugs = Object.values(docsSlugs);
return props.posts?.filter(post => !excludedSlugs.includes(post.node.slug));
});
</script>
<style lang="scss" scoped>
.blog {
&__wrapper {
display: flex;
flex-direction: column;
align-items: center;
gap: 50px;
}
&__title {
color: $primary_dark;
font-family: "Playfair Display", sans-serif;
font-size: 30px;
font-weight: 600;
letter-spacing: -0.5px;
}
&__posts {
display: flex;
align-items: stretch;
gap: 32px;
}
}
</style>