Skip to content

Commit

Permalink
feat change type image to string (url)
Browse files Browse the repository at this point in the history
  • Loading branch information
SourerDev committed Sep 27, 2023
1 parent b4b2691 commit b6f20a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
7 changes: 1 addition & 6 deletions src/components/cards/categoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ 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={image[0]}
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>
Expand Down
17 changes: 8 additions & 9 deletions src/components/containerCards/containerCardsCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,39 @@
import React from 'react';
import CardCategory from '../cards/categoryCard';
import { CategoryProps } from '~/types/products';
import { Images } from '~/assets/img';

const CATEGORIES: CategoryProps[] = [
{
name: 'Farolas',
image: [Images.categories.Cat04],
image: 'https://i.postimg.cc/Gp1QbGmD/Cat04.png',
},
{
name: 'Stops',
image: [Images.categories.Cat05],
image: 'https://i.postimg.cc/6qQcDK51/Cat05.png',
},
{
name: 'Audio',
image: [Images.categories.Cat07],
image: 'https://i.postimg.cc/02bZn94z/Cat07.png',
},
{
name: 'Exploradoras',
image: [Images.categories.Cat06],
image: 'https://i.postimg.cc/gcMN3xg9/Cat06.png',
},
{
name: 'Exterior',
image: [Images.categories.Cat02],
image: 'https://i.postimg.cc/8P94nq8t/Cat03.png',
},
{
name: 'Interior',
image: [Images.categories.Cat08],
image: 'https://i.postimg.cc/Sx9d0Dkq/Cat08.png',
},
{
name: 'Bombillos',
image: [Images.categories.Cat03],
image: 'https://i.postimg.cc/63czjqwv/Cat02.png',
},
{
name: 'Repuestos',
image: [Images.categories.Cat01],
image: 'https://i.postimg.cc/rsYjTHDy/Cat01.png',
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/types/products.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ export interface ProductCardProps {
}

export type CategoryProps = {
image: StaticImageData[];
image: string;
name: string;
}

0 comments on commit b6f20a6

Please sign in to comment.