-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Food organization landing and inventory page
- Loading branch information
1 parent
999aca8
commit 8882f91
Showing
17 changed files
with
352 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Outlet } from "react-router-dom"; | ||
import Sidebar from "./components/DashboardSidebar"; | ||
|
||
function Layout(){ | ||
return ( | ||
<div className="w-screen h-screen"> | ||
<div className="h-5/6 w-11/12 p-4 flex gap-6"> | ||
<Sidebar /> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Layout; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,110 @@ | ||
import request from "../assets/icons/request.png"; | ||
import logout from "../assets/icons/logout.png"; | ||
import support from "../assets/icons/headphones.png"; | ||
import setting from "../assets/icons/settings.png"; | ||
import inventory from "../assets/icons/inventory.png"; | ||
import dashboard from "../assets/icons/dashboard.png"; | ||
import { useEffect, useState } from "react"; | ||
import { Link, useLocation } from "react-router-dom"; | ||
|
||
|
||
const options = [ | ||
{ | ||
id: "dashboard", | ||
label: "Dashboard", | ||
icon: dashboard, | ||
route: "/restaurant-dashboard", | ||
}, | ||
{ | ||
id: "inventory", | ||
label: "Inventory", | ||
icon: inventory, | ||
route: "/restaurant-dashboard/inventory", | ||
}, | ||
{ | ||
id: "requests", | ||
label: "Requests", | ||
icon: request, | ||
route: "/restaurant-dashboard/requests", | ||
}, | ||
{ | ||
id: "support", | ||
label: "Support", | ||
icon: support, | ||
route: "/restaurant-dashboard/support", | ||
}, | ||
{ | ||
id: "logout", | ||
label: "Logout", | ||
icon: logout, | ||
route: "/restaurant-dashboard/logout", | ||
}, | ||
]; | ||
|
||
function Sidebar() { | ||
|
||
const location = useLocation(); | ||
|
||
const [activeTab, setActiveTab] = useState(""); | ||
|
||
const handleTabClick = (tab) => { | ||
setActiveTab(tab); | ||
}; | ||
|
||
|
||
useEffect(() => { | ||
const currentPath = location.pathname; | ||
console.log(currentPath); | ||
|
||
// Find the option whose route matches the current path | ||
const matchedOption = options.find( | ||
(option) => option.route === currentPath | ||
); | ||
|
||
if (matchedOption) { | ||
setActiveTab(matchedOption.id); | ||
} | ||
else if (currentPath === "/restaurant-dashboard/settings") { | ||
setActiveTab("settings"); | ||
} | ||
else { | ||
setActiveTab(""); // Reset active tab if there is no match | ||
} | ||
}, [location]); | ||
|
||
return ( | ||
<div className="h-full w-80 bg-primary rounded-xl text-dashboardOption"> | ||
<div className=" w-2/3 h-5/6 m-auto mt-20 flex flex-col justify-between"> | ||
<div className="flex flex-col gap-10 "> | ||
{options.map((option) => ( | ||
<Link | ||
key={option.id} | ||
to={option.route} | ||
onClick={() => handleTabClick(option.id)} | ||
className={`flex gap-3 items-center ${ | ||
activeTab === option.id ? "text-white text-xl" : "" | ||
}`} | ||
> | ||
<img className="h-8 w-8" src={option.icon} alt={option.label} /> | ||
<h2>{option.label}</h2> | ||
</Link> | ||
))} | ||
</div> | ||
<div> | ||
<Link | ||
to="/restaurant-dashboard/settings" | ||
onClick={() => handleTabClick("settings")} | ||
className={`flex gap-3 items-center ${ | ||
activeTab === "settings" ? "text-white text-xl" : "" | ||
}`} | ||
> | ||
<img className="h-8 w-8" src={setting} alt="Settings" /> | ||
<h2>Settings</h2> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Sidebar; |
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,86 @@ | ||
import juice from "../assets/images/juice.avif" | ||
import dish from "../assets/images/food.avif" | ||
import user from "../assets/images/user.jpeg" | ||
import bell from "../assets/icons/bell.png" | ||
import { FaSearch } from "react-icons/fa"; | ||
|
||
function Dashboard() { | ||
return ( | ||
<div className="flex w-full h-full flex-col gap-16"> | ||
<div className="h-16 w-full border flex gap-6 items-center justify-between"> | ||
<div className="flex ml-6 items-center gap-3"> | ||
<FaSearch /> | ||
<input | ||
className="focus:outline-none" | ||
type="text" | ||
placeholder="Search" | ||
/> | ||
</div> | ||
<div className="flex items-center mr-6 gap-10"> | ||
<img className="rounded-lg h-6 w-6" src={bell} alt="dashboard-icon" /> | ||
<div className="flex items-center gap-2"> | ||
<img className="w-10 h-10" src={user} alt="user-img" /> | ||
<h2>Tom Hook</h2> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="h-5/6 w-full border rounded-sm py-2"> | ||
<div className="flex flex-col h-full ml-6 overflow-y-auto gap-6"> | ||
<div className="flex gap-4"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex gap-4"> | ||
<img className="rounded-lg h-32 w-36" src={dish} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex gap-4"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex gap-4"> | ||
<img className="rounded-lg h-32 w-36" src={dish} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex gap-4"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-10"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
|
||
export default Dashboard; |
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,130 @@ | ||
import juice from "../assets/images/juice.avif"; | ||
import dish from "../assets/images/food.avif"; | ||
import user from "../assets/images/user.jpeg"; | ||
import bell from "../assets/icons/bell.png"; | ||
import { FaSearch } from "react-icons/fa"; | ||
|
||
function Inventory() { | ||
return ( | ||
<div className="flex w-full h-full flex-col gap-10"> | ||
<div className="h-16 w-full border flex gap-6 items-center justify-between"> | ||
<div className="flex ml-6 items-center gap-3"> | ||
<FaSearch /> | ||
<input | ||
className="focus:outline-none" | ||
type="text" | ||
placeholder="Search" | ||
/> | ||
</div> | ||
<div className="flex items-center mr-6 gap-10"> | ||
<img className="h-6 w-6" src={bell} alt="dashboard-icon" /> | ||
<div className="flex items-center gap-2"> | ||
<img className="w-10 h-10" src={user} alt="user-img" /> | ||
<h2>Tom Hook</h2> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="h-5/6 w-full flex flex-col gap-16 border rounded-sm py-2"> | ||
<div className="flex items-center justify-center mt-4 "> | ||
<button className="bg-primary p-2 rounded-full h-12 w-44"> | ||
Add Item | ||
</button> | ||
</div> | ||
<div className="flex flex-col h-5/6 ml-6 overflow-y-auto gap-6"> | ||
<div className="flex gap-14"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-6"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<div className="flex gap-6 items-center mt-6"> | ||
<button className="bg-editButton rounded-full py-2 px-4 h-8 flex items-center"> | ||
Edit | ||
</button> | ||
<button className="bg-deleteButton rounded-full h-8 py-2 px-4 flex items-center "> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-14"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-6"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<div className="flex gap-6 items-center mt-6"> | ||
<button className="bg-editButton rounded-full py-2 px-4 h-8 flex items-center"> | ||
Edit | ||
</button> | ||
<button className="bg-deleteButton rounded-full h-8 py-2 px-4 flex items-center "> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-14"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-6"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<div className="flex gap-6 items-center mt-6"> | ||
<button className="bg-editButton rounded-full py-2 px-4 h-8 flex items-center"> | ||
Edit | ||
</button> | ||
<button className="bg-deleteButton rounded-full h-8 py-2 px-4 flex items-center "> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-14"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-6"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<div className="flex gap-6 items-center mt-6"> | ||
<button className="bg-editButton rounded-full py-2 px-4 h-8 flex items-center"> | ||
Edit | ||
</button> | ||
<button className="bg-deleteButton rounded-full h-8 py-2 px-4 flex items-center "> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-14"> | ||
<img className="rounded-lg h-32 w-36" src={juice} alt="juice-img" /> | ||
<div className="w-2/3"> | ||
<h4 className="inline">Maecenas</h4> | ||
<h4 className="inline float-right">03</h4> | ||
<p className="mt-6"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
</p> | ||
<div className="flex gap-6 items-center mt-6"> | ||
<button className="bg-editButton rounded-full py-2 px-4 h-8 flex items-center"> | ||
Edit | ||
</button> | ||
<button className="bg-deleteButton rounded-full h-8 py-2 px-4 flex items-center "> | ||
Delete | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Inventory; |
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