Skip to content

Commit

Permalink
Add new components into Home (#14)
Browse files Browse the repository at this point in the history
* Add function Navbar

* Add new components into Home

- Imported all new components in home.tsx file
- Add isotype and logotype in the navbar e Layout-Home
- New component of Button Outline
- Each function was placed in the components folder
- Two images were added referring to the visual identity of the Linx project (Isotype and Logo)
- The width size of the two previous images was changed to ensure good accessibility, behavior and coherence

* chore: format code
  • Loading branch information
Daridjcm authored Jul 18, 2024
1 parent 5717c11 commit cbfee7a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 1 deletion.
Binary file added client/public/isotypeLinx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logotypeLinx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions client/src/components/Button-Outline.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import cn from 'classnames';
import type { ReactNode } from 'react';

export default function Button({
children,
type = 'button',
className,
onClick,
}: ButtonProps) {
return (
<button
type={type}
onClick={onClick}
className={cn(
'mt-4 px-4 py-2 border border-blue-500 text-blue-500 rounded hover:bg-blue-500 hover:text-white transition-colors',
className,
)}
>
{children}
</button>
);
}

interface ButtonProps {
children: ReactNode;
type?: 'submit' | 'button';
className?: string;
onClick?: () => void;
}
27 changes: 27 additions & 0 deletions client/src/components/Layout-Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import ButtonOutline from './Button-Outline';

export default function Layout() {
return (
<section className="pb-12 pt-12">
<div className="flex flex-col md:flex-row items-center md:items-start">
<div className="p-2 md:w-1/2 mb-4 md:mb-0">
<img
className="w-full md:w-[500px] object-contain"
src="../../public/isotypeLinx.png"
alt="Isotype Linx"
/>
</div>
<div className="p-2 md:pl-8">
<h1 className="text-slate-950 text-2xl font-bold mb-4">Linx</h1>
<p className="pb-2">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Repellat
error corrupti vitae incidunt totam blanditiis, voluptatem ratione
eius consequuntur qui. Quae laborum quasi assumenda ea autem beatae,
sed corrupti atque!
</p>
<ButtonOutline type="button">Button</ButtonOutline>
</div>
</div>
</section>
);
}
30 changes: 30 additions & 0 deletions client/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export default function Navbar() {
return (
<>
<nav className="p-4 border-b-2 border-blue-500">
<div className="container mx-auto flex justify-between items-center">
<div className="text-slate-950 text-2xl font-bold">
<img className="w-20" src="/logotypeLinx.png" alt="Logotype Linx" />
</div>
<ul className="flex space-x-4">
<li>
<a href="#product" className="text-slate-950 hover:text-blue-700">
Product
</a>
</li>
<li>
<a href="#login" className="text-slate-950 hover:text-blue-700">
Login
</a>
</li>
<li>
<a href="#signup" className="text-slate-950 hover:text-blue-700">
Sign Up
</a>
</li>
</ul>
</div>
</nav>
</>
);
}
5 changes: 4 additions & 1 deletion client/src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import Layout from '../components/Layout-Home';
import Navbar from '../components/Navbar';
export default function Home() {
return (
<>
<h1 className="text-black text-4xl">Home</h1>
<Navbar />
<Layout />
</>
);
}

0 comments on commit cbfee7a

Please sign in to comment.