Skip to content

Commit

Permalink
2 type moteur d'on 1 obligatoire en cours
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacati committed Oct 14, 2024
1 parent 87008f8 commit 0bcc2b6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 31 deletions.
9 changes: 6 additions & 3 deletions src/components/global/Cards.astro
Original file line number Diff line number Diff line change
@@ -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';
---

Expand All @@ -12,10 +12,13 @@ import { Eye } from 'lucide-astro';
<p class="text-gray-400">{description}</p>
<div class=" flex gap-2">
<img src="/images/motor.svg">
<p class="px-3 border-orange-500 rounded-3xl border-2">{type}</p>
<div class="flex flex-col lg:flex-row gap-2">
<p class="px-3 bg-orange-500 rounded-3xl items-center flex justify-center">{typeMotor}</p>
<p class="px-3 border-orange-500 rounded-3xl border-2 items-center flex justify-center">{typeMotor1}</p>
</div>
</div>
</div>
<div class="cards rounded-full w-60 h-60 flex items-center justify-center mt-6">
<div class="cards rounded-full w-52 h-52 flex items-center justify-center mt-6">
<img class="max-w-72 lg:max-w-80" alt="" src={imageSrc} />
</div>
<div class="flex justify-between items-center w-full mt-4">
Expand Down
7 changes: 5 additions & 2 deletions src/components/global/TemplateConfig.astro
Original file line number Diff line number Diff line change
@@ -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';
---

Expand Down Expand Up @@ -35,7 +35,10 @@ import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-astro';
<p class="text-gray-400">{enderTitle}</p>
<div class=" flex gap-2">
<img src="/images/motor.svg">
<p class="px-3 border-orange-500 rounded-3xl border-2">{type}</p>
<div class="flex flex-col lg:flex-row gap-2">
<p class="px-3 bg-orange-500 rounded-3xl items-center flex justify-center">{typeMotor}</p>
<p class="px-3 border-orange-500 rounded-3xl border-2 items-center flex justify-center">{typeMotor1}</p>
</div>
</div>
</div>
<p class="mt-2">{description}</p>
Expand Down
44 changes: 24 additions & 20 deletions src/libs/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`),
Expand All @@ -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"],
Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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" },
Expand All @@ -284,22 +288,22 @@ 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" },
{
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" },
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/pages/allDays.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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`}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/competition.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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`}
Expand Down
7 changes: 4 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/product/config.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const currentConfig = getCurrentConfig(configType);
<TemplateConfig
title={currentConfig.title}
enderTitle={currentConfig.enderTitle}
type={currentConfig.type}
typeMotor={currentConfig.typeMotor}
typeMotor1={currentConfig.typeMotor1}
description={currentConfig.description}
price={currentConfig.price}
images={currentConfig.images}
Expand Down

0 comments on commit 0bcc2b6

Please sign in to comment.