-
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.
- Loading branch information
Kyle Zarazan
committed
Nov 15, 2024
1 parent
db28eb9
commit 1202754
Showing
4 changed files
with
47 additions
and
16 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,25 +1,41 @@ | ||
import React from 'react'; | ||
import { Outlet, Link } from "react-router-dom"; | ||
|
||
function Layout(): React.ReactElement { | ||
const Layout = (): JSX.Element => { | ||
return ( | ||
<div> | ||
<nav> | ||
<ul> | ||
<li> | ||
<Link to="/">Home</Link> | ||
</li> | ||
<li> | ||
<Link to="/recipes">Recipes</Link> | ||
</li> | ||
</ul> | ||
</nav> | ||
<div className="m-2"> | ||
<div className="flex m-6"> | ||
<h1>ICON</h1> | ||
<Nav /> | ||
<h1 className="ml-auto">PROFILE</h1> | ||
</div> | ||
|
||
<hr /> | ||
|
||
<Outlet /> | ||
<div className="m-6"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const Nav = (): JSX.Element => { | ||
return ( | ||
<nav className="ml-2"> | ||
<ul className="flex gap-2"> | ||
<NavLink name="Home" path="/" /> | ||
<NavLink name="Search" path="/search" /> | ||
<NavLink name="Recipes" path="/recipes" /> | ||
<NavLink name="Ingredients" path="/ingredients" /> | ||
</ul> | ||
</nav> | ||
) | ||
} | ||
|
||
const NavLink = ({ name, path }: {name: string, path: string}): JSX.Element => { | ||
return ( | ||
<li> | ||
<Link to={path} className="text-green-600">{name}</Link> | ||
</li> | ||
) | ||
} | ||
|
||
export default Layout; |
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,12 @@ | ||
import React from 'react'; | ||
|
||
function Home(): React.ReactElement { | ||
return ( | ||
<div> | ||
<input type="text"></input> | ||
<button>Search</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default Home; |
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