Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: combine headlines for products slider #950

Merged
merged 11 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<template>
<p
v-if="headline"
<div v-if="text?.pretitle" class="text-2xl">{{ text.pretitle }}</div>
<h2
v-if="text?.title"
class="typography-display-3 md:typography-display-2 lg:typography-display-2 font-bold lg:leading-[4rem]"
data-testid="recommended-products-headline"
class="mb-4 typography-text-lg text-center md:text-left"
>
{{ headline }}
</p>

{{ text.title }}
</h2>
<div v-if="text?.subtitle" class="text-2xl pb-1">{{ text.subtitle }}</div>
<div
class="typography-text-sm md:typography-text-lg font-normal"
v-if="text?.htmlDescription"

Check warning on line 13 in apps/web/components/ProductRecommendedProducts/ProductRecommendedProducts.vue

View workflow job for this annotation

GitHub Actions / fitness-code-quality

Attribute "v-if" should go before "class"
v-html="text.htmlDescription"
></div>
<ProductSlider v-if="recommendedProducts?.length" :items="recommendedProducts" />
</template>

Expand Down
7 changes: 6 additions & 1 deletion apps/web/components/ProductRecommendedProducts/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
export type ProductRecommendedProductsProps = {
categoryId: string;
cacheKey?: string;
headline?: string;
text?: {
pretitle?: string;
title?: string;
subtitle?: string;
htmlDescription?: string;
};
};
10 changes: 9 additions & 1 deletion apps/web/composables/useHomepage/homepageTemplateDataDe.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@
},
{
"name": "ProductRecommendedProducts",
"options": { "headline": "Entdecken Sie unsere Modekollektion", "categoryId": "49" }
"options": {
"text": {
"pretitle": "Mehr als nur Technik",
"title": "Entdecken Sie unsere Modekollektion",
"subtitle": "Sportive Mode und Accessories für alle.",
"htmlDescription": "<a class='underline' href='https://plentyshop.plentymarkets.com/wear' target='_self'>Zu unserer kompletten Kollektion.</a>"
},
"categoryId": "49"
}
},
{
"name": "NewsletterSubscribe",
Expand Down
16 changes: 12 additions & 4 deletions apps/web/composables/useHomepage/homepageTemplateDataEn.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,26 @@
"subtitle": "Innovative technology meets modern fashion",
"pretitle": "Welcome to your new favorite shop",
"textAlignment": "right"

},
"button": {
"label":"Get shopping",
"link":"",
"label": "Get shopping",
"link": "",
"variant": "primary"
}
}
},
{
"name": "ProductRecommendedProducts",
"options": { "headline": "Explore our fashion collection", "categoryId": "49" }
"options": {
"text": {
"pretitle": "More than just technology",
"title": "Explore our fashion collection",
"subtitle": "Sportive fashion and accessoires for everybody.",
"htmlDescription": "<a class='underline' href='https://plentyshop.plentymarkets.com/wear' target='_self'>To our full collection.</a>"
},

"categoryId": "49"
}
},
{
"name": "NewsletterSubscribe",
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Added the logic to render components within a module in certain areas of the PWA
- Added delivery days to checkout shipping providers.
- Added robots for category page.
- Subtitle, pretitle and title options where added to the Recommened Products component

### 🩹 Fixed

Expand Down
Loading