-
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 #184 from Actualiza-Tu-Carro/147-viewdetail
cambios para la viewDetail
- Loading branch information
Showing
5 changed files
with
138 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,4 @@ | |
"@storybook/testing-library": "^0.2.0", | ||
"file-loader": "^6.2.0" | ||
} | ||
} | ||
} |
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,39 @@ | ||
import React, { FC } from 'react'; | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import { MainButton } from '../../components/button/button'; | ||
|
||
interface NotFoundProps {} | ||
|
||
const NotFound: FC<NotFoundProps> = ({}) => { | ||
return ( | ||
<div className="flex flex-col items-center h-screen w-screen gap-9 p-12"> | ||
<h1 className="text-center"> | ||
La página que estás buscando no parece existir | ||
</h1> | ||
<div className="text-center"> | ||
<Image | ||
src="https://i.postimg.cc/NjdR1VMt/product-No-Found.png" | ||
alt="404" | ||
width={500} | ||
height={500} | ||
className="mx-auto max-w-4xl object-cover mb-8" | ||
/> | ||
<p className="text-lg"> | ||
Te invitamos a ponerte en contacto con nosotros para que podamos | ||
verificar la disponibilidad a través de nuestros proveedores y | ||
recomendarte la mejor solución. Estaremos encantados de ayudarte a | ||
encontrar lo que necesitas. | ||
</p> | ||
</div> | ||
<MainButton | ||
variant="tertiary" | ||
className="bg-primary-lm text-white border font-bold" | ||
> | ||
<Link href="/contact">CONTACTANOS</Link> | ||
</MainButton> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NotFound; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useState } from 'react'; | ||
import { TiHome } from 'react-icons/ti'; | ||
import Link from 'next/link'; | ||
import { useBreadcrumb } from '~/hooks/useBreadcrumb'; | ||
import { CategoryProps } from '../../types/products'; | ||
|
||
const Breadcrumb = () => { | ||
const { breadcrumbCategory } = useBreadcrumb(); // Obtener el estado del breadcrumb del hook useBreadcrumb | ||
const [selectedOption, setSelectedOption] = useState(breadcrumbCategory[0]); // Agregar un estado local para la opción seleccionada | ||
|
||
const handleOptionChange = (event) => { | ||
const selectedLabel = event.target.value; | ||
const selectedOption = breadcrumbCategory.find((item) => item.label === selectedLabel); | ||
setSelectedOption(selectedOption); | ||
}; // Agregar un manejador de eventos para actualizar el estado con la opción seleccionada | ||
|
||
return ( | ||
<section className="bg-gray-200 py-2"> | ||
<div className="container mx-auto flex items-center"> | ||
<Link href="/"> | ||
<a className="text-blue-300 mr-2">Volver</a> {/* Crear un enlace a la página de inicio */} | ||
</Link> | ||
<span className="mr-2"> | ||
<TiHome className="text-gray-500" /> {/* Renderizar el icono de inicio */} | ||
</span> | ||
<select | ||
className="text-sm text-gray-500" | ||
value={selectedOption.label} | ||
onChange={handleOptionChange} | ||
> | ||
{breadcrumbCategory.map((item, index) => ( | ||
<option key={index} value={item.label}> | ||
{item.label} | ||
</option> | ||
))} | ||
</select> | ||
</div> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Breadcrumb; |
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,16 @@ | ||
import create from 'zustand'; | ||
|
||
export const useBreadcrumb = create((set) => ({ // Crear una tienda que administre el estado del componente breadcrumb | ||
breadcrumb: [ | ||
{ label: 'Categorias', path: '/category' }, | ||
{ label: 'Repuestos', path: '/repuestos' }, | ||
{ label: 'Exterior', path: '/exterior' }, | ||
{ label: 'Bombillos', path: '/bombillos' }, | ||
{ label: 'Farolas', path: '/farolas' }, | ||
{ label: 'Stops', path: '/stops' }, | ||
{ label: 'Exploradoras', path: '/exploradoras' }, | ||
{ label: 'Audio', path: '/audio' }, | ||
{ label: 'Interior', path: '/interior' }, | ||
], // Inicializar el estado del breadcrumb con las categorías | ||
setBreadcrumb: (breadcrumb) => set({ breadcrumb }), // Agregar una función para actualizar el estado del breadcrumb | ||
})); |