Skip to content

Commit

Permalink
Merge pull request #162 from Actualiza-Tu-Carro/categories_navbar
Browse files Browse the repository at this point in the history
Added categories section in the navbar
  • Loading branch information
CBarreraB authored Oct 4, 2023
2 parents 6630a55 + 620bad7 commit caad5dc
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/node_modules
/.pnp
.pnp.js

.env
# testing
/coverage

Expand Down
9 changes: 8 additions & 1 deletion src/app/container_page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use client'
import Footer from '~/components/footer/Footer';
import NavBar from '~/components/navBar/navBar';
import Categories from '~/components/categories/categories';
import { usePathname } from 'next/navigation';

type ContainerPageProps = {
children: React.ReactNode;
Expand All @@ -14,11 +17,15 @@ export function ContainerPage({
footer = true,
children,
}: ContainerPageProps) {
const pathname = usePathname();
return (
<>
{typeof nav === 'boolean' && nav ? <NavBar /> : nav}
{header && header}
<main className="min-h-screen overflow-hidden mx-auto">{children}</main>
<main className="min-h-screen overflow-hidden mx-auto">
{pathname !== '/' && <Categories />}
{children}
</main>
{footer && <Footer />}
</>
);
Expand Down
6 changes: 1 addition & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
'use client';
import './globals.css';
import type { Metadata } from 'next';

import { Inter } from 'next/font/google';

import { AuthContextProvider } from '../context/AuthContext';
import { ThemeProvider } from 'next-themes';

const inter = Inter({ subsets: ['latin'] });

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({
children,
Expand Down
1 change: 0 additions & 1 deletion src/app/products/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ import { ContainerPage } from '../container_page';

export default function Landing() {
return <ContainerPage>
Products page
</ContainerPage>;
}
17 changes: 17 additions & 0 deletions src/components/categories/categories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const Categories = () => {
return(
<div className="hidden w-full h-[60px] md:block mt-16 bg-opacity-70 bg-white shadow">
<ul className="flex justify-around items-center w-full h-full font-medium">
<li>Repuestos</li>
<li>Exterior</li>
<li>Bombillos</li>
<li>Farolas</li>
<li>Stops</li>
<li>Exploradoras</li>
<li>Audio</li>
<li>Interior</li>
</ul>
</div>
)
}
export default Categories;
4 changes: 2 additions & 2 deletions src/components/navBar/navBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const NavBar: FC<NavBarProps> = ({}) => {
return (
<nav>
<div className="z-50 fixed top-0 bg-opacity-70 bg-white w-full backdrop-blur-sm flex-col shadow-sm">
<div className="p-4 flex items-center h-[60px] justify-between mx-auto">
<div className="p-4 flex items-center h-[60px] justify-between mx-auto my-1">
{/* Contenedor lado izquierdo menu hamburguesa-imagenes*/}
<div className="flex items-center gap-2">
{/* Icono hamburguesa */}
Expand Down Expand Up @@ -68,7 +68,7 @@ const NavBar: FC<NavBarProps> = ({}) => {
<div className="flex items-center justify-center ">
<InputField
style={{ width: '50vw' }}
className="shadow-md bg-opacity-70 bg-white "
className="bg-opacity-70 bg-white "
placeholder="Buscar Productos"
leftIcon={<Icon icon="SearchIcon" />}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/types/icons.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export type IconTypes = | 'CardCredit' | 'CarShoping' | 'Cash' | 'Close' | 'Facebook' | 'HamburguerClose' | 'HamburguerOpen' | 'Heart' | 'icon' | 'Instagram' | 'Login' | 'MapLocation' | 'Moon' | 'quotationMarks' | 'SearchIcon' | 'Shield' | 'Sun' | 'Truck' | 'warranty' | 'Whatsapp'
export type IconTypes = | 'CarShoping' | 'CardCredit' | 'Cash' | 'Close' | 'Facebook' | 'HamburguerClose' | 'HamburguerOpen' | 'Heart' | 'Instagram' | 'Login' | 'MapLocation' | 'Moon' | 'SearchIcon' | 'Shield' | 'Sun' | 'Truck' | 'Whatsapp' | 'icon' | 'quotationMarks' | 'warranty'

0 comments on commit caad5dc

Please sign in to comment.