Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linked customer menu to cart page #65

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import Home from './components/Home/Home';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import theme from "./components/Theme/Theme";
import Orders from './components/Dashboard/Orders';

import ResponsiveAppBar from './components/Home/ResponsiveAppBar';
import CustomerMenu from './components/Customer/CustomerMenu';
import TrackOrder from './components/Customer/TrackOrder';
import Cart from './components/Customer/Cart';
import Dashboard from './components/Dashboard/Dashboard';

import {
Expand All @@ -26,7 +27,9 @@ function App() {
<CssBaseline />
<ResponsiveAppBar></ResponsiveAppBar>
<Routes>
<Route path="/customer" element={<TrackOrder />} />
<Route path="/customer" element={<CustomerMenu />} />
<Route path="/order" element={<TrackOrder />} />
<Route path="/cart" element={<Cart />} />
<Route path="/employee" element={<Dashboard />} />
<Route path="" element={<Home />} />
</Routes>
Expand Down
38 changes: 38 additions & 0 deletions frontend/src/components/Customer/Cart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import * as React from 'react';
import AppBar from '@mui/material/AppBar';
import Button from '@mui/material/Button';
import RestaurantMenuTwoToneIcon from '@mui/icons-material/RestaurantMenuTwoTone';import Card from '@mui/material/Card';
import CardActions from '@mui/material/CardActions';
import CardContent from '@mui/material/CardContent';
import CardMedia from '@mui/material/CardMedia';
import CssBaseline from '@mui/material/CssBaseline';
import Grid from '@mui/material/Grid';
import Stack from '@mui/material/Stack';
import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
// import Link from '@mui/material/Link';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Link } from 'react-router-dom';

function Copyright() {
return (
<Typography variant="body2" color="text.secondary" align="center">
{'Copyright © '}
<Link color="inherit" to="https://mui.com/">
Dronuts Group 3
</Link>{' '}
{new Date().getFullYear()}
{'.'}
</Typography>
);
}

export default function Cart() {
return (
<main>
<Copyright />
</main>
);
}
13 changes: 9 additions & 4 deletions frontend/src/components/Customer/CustomerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Typography from '@mui/material/Typography';
import Container from '@mui/material/Container';
import Link from '@mui/material/Link';
// import Link from '@mui/material/Link';
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { Link } from 'react-router-dom';



function Copyright() {
return (
<Typography variant="body2" color="text.secondary" align="center">
{'Copyright © '}
<Link color="inherit" href="https://mui.com/">
<Link color="inherit" to="https://mui.com/">
Dronuts Group 3
</Link>{' '}
{new Date().getFullYear()}
Expand All @@ -29,6 +32,8 @@ function Copyright() {
}

const cards = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const donuts = ["Glazed", "Chocolate", "Boston Kreme", "Strawberry",
"Sprinkles", "Apple Krumb", "Powdered", "Krueller", "Munchkin"]

const theme = createTheme();

Expand Down Expand Up @@ -60,14 +65,14 @@ export default function CustomerMenu() {
/>
<CardContent sx={{ flexGrow: 1 }}>
<Typography gutterBottom variant="h5" component="h2">
Donut Name
{(donuts[card-1])}
</Typography>
<Typography>
This is a donut card. The donut's description will go here.
</Typography>
</CardContent>
<CardActions>
<Button size="small">Add to Cart</Button>
<Button component={Link} to={'/cart'} size="small">Add to Cart</Button>
</CardActions>
</Card>
</Grid>
Expand Down