From 0bcc2b6008d934eca70973def78a8a9d5e0c8038 Mon Sep 17 00:00:00 2001 From: Bacati Date: Mon, 14 Oct 2024 16:33:21 +0200 Subject: [PATCH] 2 type moteur d'on 1 obligatoire en cours --- src/components/global/Cards.astro | 9 +++-- src/components/global/TemplateConfig.astro | 7 +++- src/libs/configurations.ts | 44 ++++++++++++---------- src/pages/allDays.astro | 3 +- src/pages/competition.astro | 3 +- src/pages/index.astro | 7 ++-- src/pages/product/config.astro | 3 +- 7 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/components/global/Cards.astro b/src/components/global/Cards.astro index 207ab50..502f4cf 100644 --- a/src/components/global/Cards.astro +++ b/src/components/global/Cards.astro @@ -1,5 +1,5 @@ --- -const { title, description, price, imageSrc, lien, logo, type } = Astro.props; +const { title, description, price, imageSrc, lien, logo, typeMotor, typeMotor1 } = Astro.props; import { Eye } from 'lucide-astro'; --- @@ -12,10 +12,13 @@ import { Eye } from 'lucide-astro';

{description}

-

{type}

+
+

{typeMotor}

+

{typeMotor1}

+
-
+
diff --git a/src/components/global/TemplateConfig.astro b/src/components/global/TemplateConfig.astro index 65162ef..9adc694 100644 --- a/src/components/global/TemplateConfig.astro +++ b/src/components/global/TemplateConfig.astro @@ -1,5 +1,5 @@ --- -const { title, enderTitle, type, description, price, images, pieces } = Astro.props; +const { title, enderTitle, typeMotor, typeMotor1, description, price, images, pieces } = Astro.props; import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-astro'; --- @@ -35,7 +35,10 @@ import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-astro';

{enderTitle}

-

{type}

+
+

{typeMotor}

+

{typeMotor1}

+

{description}

diff --git a/src/libs/configurations.ts b/src/libs/configurations.ts index 2ec429f..c96f846 100644 --- a/src/libs/configurations.ts +++ b/src/libs/configurations.ts @@ -31,10 +31,11 @@ const createSpecificPieces = (basePieces, specificPieces) => [ ]; // Fonction de création de configuration -const createConfig = (title, type, description, price, images, specificPieces) => ({ +const createConfig = (title, typeMotor, typeMotor1, description, price, images, specificPieces) => ({ title, enderTitle: "Configuration AllDays", - type, + typeMotor, + typeMotor1, description, price, images: images.map(image => `${imagePrefix}/${image}`), @@ -46,6 +47,7 @@ const configurations = { "50mk": createConfig( "50cc Metrakit Alu", "AM6", + "Derbi", "Configuration très solide. Peu performant mais permet de faire de nombreux kilomètres sans problème.", config[0].allMk, ["50mk.png", "carbupolini.png", "potmost50.png"], @@ -168,7 +170,8 @@ export const generateProductData = (config) => [ title: "50cc Metrakit Alu", logo: "mk.svg", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", + typeMotor1: "Derbi", price: config[0].allMk || 'N/A', imageSrc: `${imagePrefix}/50mk.png`, link: `${linkPrefix}50mk` @@ -177,7 +180,7 @@ export const generateProductData = (config) => [ title: "70cc Top Performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allTop || 'N/A', imageSrc: `${imagePrefix}/topnoir.png`, link: `${linkPrefix}70top` @@ -186,7 +189,7 @@ export const generateProductData = (config) => [ title: "70cc Airsal fonte", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allAirsal || 'N/A', imageSrc: `${imagePrefix}/70airsalfonte.png`, link: `${linkPrefix}70airsal` @@ -195,7 +198,7 @@ export const generateProductData = (config) => [ title: "70cc Airsal Alu", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allAirsalAlu || 'N/A', imageSrc: `${imagePrefix}/70airsal.png`, link: `${linkPrefix}70airsalAlu` @@ -204,7 +207,7 @@ export const generateProductData = (config) => [ title: "75cc Top performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allTopRose || 'N/A', imageSrc: `${imagePrefix}/toprose.png`, link: `${linkPrefix}75topRose` @@ -213,7 +216,7 @@ export const generateProductData = (config) => [ title: "78cc Airsal alu", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].all78Airsal || 'N/A', imageSrc: `${imagePrefix}/70airsal.png`, link: `${linkPrefix}78airsal` @@ -222,7 +225,7 @@ export const generateProductData = (config) => [ title: "78cc BRK 4RACE", logo: "brk.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].all78brk || 'N/A', imageSrc: `${imagePrefix}/80brk.png`, link: `${linkPrefix}78brk` @@ -231,7 +234,7 @@ export const generateProductData = (config) => [ title: "86cc Top performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allTopalu || 'N/A', imageSrc: `${imagePrefix}/topalu.png`, link: `${linkPrefix}86top` @@ -240,7 +243,7 @@ export const generateProductData = (config) => [ title: "78cc MOST 4STREET", logo: "most.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].all78Most || 'N/A', imageSrc: `${imagePrefix}/80most.png`, link: `${linkPrefix}78most` @@ -256,21 +259,22 @@ export const categories = [ { title: "50cc Metrakit Alu", logo: "mk.svg", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", + typeMotor1: "Derbi", price: config[0].allMk || 'N/A', image: "50mk.png", configKey: "50mk" }, { title: "70cc Top Performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allTop || 'N/A', image: "topnoir.png", configKey: "70top" }, { title: "70cc Airsal fonte", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allAirsal || 'N/A', image: "70airsalfonte.png", configKey: "70airsal" }, @@ -284,14 +288,14 @@ export const categories = [ { title: "70cc Airsal Alu", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allAirsalAlu || 'N/A', image: "70airsal.png", configKey: "70airsalAlu" }, { title: "75cc Top performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].allTopRose || 'N/A', image: "toprose.png", configKey: "75topRose" }, @@ -299,7 +303,7 @@ export const categories = [ title: "78cc Airsal alu", logo: "airsal.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0]?.all78Airsal || 'N/A', image: "70airsal.png", configKey: "78airsal" }, @@ -314,7 +318,7 @@ export const categories = [ title: "78cc BRK 4RACE", logo: "brk.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0]?.all78brk || 'N/A', image: "80brk.png", configKey: "78brk" @@ -323,7 +327,7 @@ export const categories = [ title: "86cc Top performance", logo: "topPerf.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0]?.allTopalu || 'N/A', image: "topalu.png", configKey: "86top" @@ -332,7 +336,7 @@ export const categories = [ title: "78cc MOST 4STREET", logo: "most.png", description: "Configuration AllDays", - type: "AM6", + typeMotor: "AM6", price: config[0].all78Most || 'N/A', image: "80most.png", configKey: "78most" diff --git a/src/pages/allDays.astro b/src/pages/allDays.astro index 7e6c02d..095013f 100644 --- a/src/pages/allDays.astro +++ b/src/pages/allDays.astro @@ -33,7 +33,8 @@ import { categories } from 'libs/configurations'; title={product.title} logo={`/images/${product.logo}`} description={product.description} - type={product.type} + typeMotor={product.typeMotor} + typeMotor1={product.typeMotor1} price={product.price} imageSrc={`/images/${product.image}`} lien={`/product/config?config=${product.configKey}#item-1`} diff --git a/src/pages/competition.astro b/src/pages/competition.astro index 9b39f0b..541ccac 100644 --- a/src/pages/competition.astro +++ b/src/pages/competition.astro @@ -33,7 +33,8 @@ import { categories } from 'libs/configCompetition'; title={product.title} logo={`/images/${product.logo}`} description={product.description} - type={product.type} + typeMotor={product.typeMotor} + typeMotor1={product.typeMotor1} price={product.price} imageSrc={`/images/${product.image}`} lien={`/product/config?config=${product.configKey}#item-1`} diff --git a/src/pages/index.astro b/src/pages/index.astro index 61b85a7..d06195d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,6 @@ --- import MainLayout from 'layouts/MainLayout.astro'; -import { generateProductData, fastProducts } from 'libs/configurations'; +import { generateProductData } from 'libs/configurations'; import { config } from 'libs/donner'; import { ChevronDown, Quote } from 'lucide-astro'; import moi from '/public/images/moi.jpg'; @@ -32,7 +32,8 @@ import Picture from 'components/global/Picture.astro'; title={product.title} logo={`/images/${product.logo}`} description={product.description} - type={product.type} + typeMotor={product.typeMotor} + typeMotor1={product.typeMotor1} price={product.price} imageSrc={product.imageSrc} lien={product.link} @@ -45,7 +46,7 @@ import Picture from 'components/global/Picture.astro'; title={product.title} logo={`/images/${product.logo}`} description={product.description} - type={product.type} + typeMotor1={product.typeMotor1} price={product.price} imageSrc={product.imageSrc} lien={product.link} diff --git a/src/pages/product/config.astro b/src/pages/product/config.astro index 21d8a0e..ac8bfb2 100644 --- a/src/pages/product/config.astro +++ b/src/pages/product/config.astro @@ -13,7 +13,8 @@ const currentConfig = getCurrentConfig(configType);