From fa09f2b10b13e8810f058b6888571a4e966aeb70 Mon Sep 17 00:00:00 2001 From: Adam Wang Date: Thu, 24 Feb 2022 17:13:25 -0500 Subject: [PATCH] Added employee view --- frontend/src/pages/App.tsx | 2 + frontend/src/pages/Employee.tsx | 81 +++++++++++++++++++++++++++ frontend/src/styles/Employee.css | 94 ++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) create mode 100644 frontend/src/pages/Employee.tsx create mode 100644 frontend/src/styles/Employee.css diff --git a/frontend/src/pages/App.tsx b/frontend/src/pages/App.tsx index 647c58e..6ff50c5 100644 --- a/frontend/src/pages/App.tsx +++ b/frontend/src/pages/App.tsx @@ -2,6 +2,7 @@ import {BrowserRouter, Route, Routes} from 'react-router-dom'; import {Menu} from "./Menu"; import {HomePage} from "./HomePage"; import {Confirmation} from "./Confirmation"; +import {Employee} from "./Employee"; import {Status} from "./Status"; import * as React from "react"; @@ -14,6 +15,7 @@ export const App: React.FC = () => { }/> }/> }/> + }/> }/> diff --git a/frontend/src/pages/Employee.tsx b/frontend/src/pages/Employee.tsx new file mode 100644 index 0000000..8b49136 --- /dev/null +++ b/frontend/src/pages/Employee.tsx @@ -0,0 +1,81 @@ +import * as React from "react"; +import "../styles/Employee.css"; +import {DonutCard} from "../components/DonutCard"; +import "../styles/Menu.css"; + +class Donut { + name: string + image: string + description: string + price: number + quantity: number + + constructor(name: string, image: string, description: string, price: number, quantity: number) { + this.name = name; + this.image = image; + this.description = description; + this.price = price; + this.quantity = quantity; + } +} + +// Temporary Menu +const items: Array = [ + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 2), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), + new Donut("Apple Krumble", "https://cmu-17-356.github.io/Dronuts/assets/donut_flavors/apple_krumb.jpg", "Apples and crumbs", 3.99, 0), +] + +export const Employee: React.FC = () => { + return (<> +
+
+

Orders

+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ +
+

Order #3000

+
+

In Progress

+
+ {items.map((donut: Donut, index: number) => ( + + ))} +
+
+
+

Completed

+
+ {items.map((donut: Donut, index: number) => ( + + ))} +
+
+
+
+ ); +} diff --git a/frontend/src/styles/Employee.css b/frontend/src/styles/Employee.css new file mode 100644 index 0000000..7eac6cf --- /dev/null +++ b/frontend/src/styles/Employee.css @@ -0,0 +1,94 @@ +.employee-Main-Div{ + display: grid; + grid-template-columns: 20% 80%; + height: 100vh; +} + +.list-orders-div{ + grid-column: 1; + height: 100%; + background-color: #EF72AC; + display: grid; + grid-template-rows: repeat(1fr, 8); + overflow-y:scroll; + text-align: center; + align-items: center; +} + +.In-Progress{ + border-color: black; + background-color: #F6F6F6; + display: grid; + padding: 10px; + grid-template-columns: repeat(auto-fill, minmax(200px, auto)); + margin: auto; + height: auto; + text-align: center; + align-items: center; +} + +.Completed{ + border-color: black; + background-color: #F6F6F6; + display: grid; + padding: 10px; + grid-template-columns: repeat(auto-fill, minmax(200px, auto)); + margin: auto; + height: auto; + text-align: center; + align-items: center; +} + +.employee-main-div-title{ + font-weight: bolder; + color: white; + font-size: 30px; +} + +.list-order-button{ + height: 100%; + color: white; + border-width: 1px; + display: grid; + grid-template-columns: auto auto auto; + +} + +.ListButton{ + font-size: 17px; + font-weight: bolder; + height: 100%; + margin: auto; +} + +.order-div{ + overflow-y: scroll; +} + +.order-Title{ + font-size: 30px; + color: black; + font-weight: bolder; + margin-top: 30px; + text-align: center; +} + +.In-Progress-Div{ + padding: 30px; +} + +.In-Progress-Title{ + font-size: 25px; + color: black; + font-weight: bolder; +} + +.Completed-Title{ + font-size: 25px; + color: black; + font-weight: bolder; +} + +.Completed-Div{ + padding: 30px; +} \ No newline at end of file