-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from Actualiza-Tu-Carro/categories-update
Categories update
- Loading branch information
Showing
5 changed files
with
68 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,17 @@ | ||
import React, { FC } from "react"; | ||
import Image from "next/image"; | ||
import Image from 'next/image'; | ||
import { CategoryProps } from '~/types/products'; | ||
|
||
interface CardPropsCategory { | ||
name: string; | ||
imageSrc: string; | ||
} | ||
|
||
const CardCategory: FC<CardPropsCategory> = ({ name, imageSrc }) => { | ||
const CardCategory: React.FC<CategoryProps> = ({ name, image }) => { | ||
return ( | ||
<div className="flex w-[10rem] h-[200px] flex-col items-center overflow-hidden m-8"> | ||
<div className="w-full h-[78%] relative"> | ||
<Image | ||
src={imageSrc} | ||
alt="Imagen de Categoria" | ||
layout="fill" | ||
objectFit="cover" | ||
/> | ||
<Image src={image} alt="Imagen de Categoria" layout="fill" /> | ||
</div> | ||
<div> | ||
<h3 className="font-bold text-2xl w-[100%] h-[22%] mt-2">{name}</h3> | ||
</div> | ||
<div> | ||
<h3 className="font-bold text-2xl w-[100%] h-[22%] mt-2"> | ||
{name} | ||
</h3> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CardCategory; | ||
export default CardCategory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
'use client'; | ||
import React from 'react'; | ||
import CardCategory from '../cards/categoryCard'; | ||
import { CategoryProps } from '~/types/products'; | ||
|
||
const CATEGORIES: CategoryProps[] = [ | ||
{ | ||
name: 'Farolas', | ||
image: 'https://i.postimg.cc/Gp1QbGmD/Cat04.png', | ||
}, | ||
{ | ||
name: 'Stops', | ||
image: 'https://i.postimg.cc/6qQcDK51/Cat05.png', | ||
}, | ||
{ | ||
name: 'Audio', | ||
image: 'https://i.postimg.cc/02bZn94z/Cat07.png', | ||
}, | ||
{ | ||
name: 'Exploradoras', | ||
image: 'https://i.postimg.cc/gcMN3xg9/Cat06.png', | ||
}, | ||
{ | ||
name: 'Exterior', | ||
image: 'https://i.postimg.cc/8P94nq8t/Cat03.png', | ||
}, | ||
{ | ||
name: 'Interior', | ||
image: 'https://i.postimg.cc/Sx9d0Dkq/Cat08.png', | ||
}, | ||
{ | ||
name: 'Bombillos', | ||
image: 'https://i.postimg.cc/63czjqwv/Cat02.png', | ||
}, | ||
{ | ||
name: 'Repuestos', | ||
image: 'https://i.postimg.cc/rsYjTHDy/Cat01.png', | ||
}, | ||
]; | ||
|
||
const Categories = () => { | ||
return ( | ||
<div> | ||
<div className="flex flex-wrap justify-around mt-12"> | ||
{CATEGORIES.map(({ name, image }, id) => ( | ||
<CardCategory key={id} name={name} image={image} /> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Categories; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters