merge with ?
This commit is contained in:
@@ -3,6 +3,7 @@ import Login from "./components/Login";
|
|||||||
import CreateAccount from "./components/CreateAccount";
|
import CreateAccount from "./components/CreateAccount";
|
||||||
import Menus from "./components/Menus";
|
import Menus from "./components/Menus";
|
||||||
import Plan from "./components/Plan";
|
import Plan from "./components/Plan";
|
||||||
|
import MenuExpansion from "./components/MenuExpansion";
|
||||||
import { ReactSession } from 'react-client-session';
|
import { ReactSession } from 'react-client-session';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -15,8 +16,6 @@ import {
|
|||||||
ReactSession.setStoreType("sessionStorage");
|
ReactSession.setStoreType("sessionStorage");
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
<Routes>
|
<Routes>
|
||||||
@@ -24,6 +23,7 @@ function App() {
|
|||||||
<Route path='/CreateAccount' element={<CreateAccount/>}></Route>
|
<Route path='/CreateAccount' element={<CreateAccount/>}></Route>
|
||||||
<Route path='/Menus' element={<Menus/>}></Route>
|
<Route path='/Menus' element={<Menus/>}></Route>
|
||||||
<Route path='/Plan' element={<Plan/>}></Route>
|
<Route path='/Plan' element={<Plan/>}></Route>
|
||||||
|
<Route path='/MenuExpansion' element={<MenuExpansion/>}></Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
|||||||
91
db_app/src/components/MenuExpansion.js
Normal file
91
db_app/src/components/MenuExpansion.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import React,{useState, useEffect} from 'react';
|
||||||
|
import {Routes, Route, useNavigate} from 'react-router-dom';
|
||||||
|
import './Login.css';
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
|
import Card from "@mui/material/Card";
|
||||||
|
import { CardMedia, CardContent } from '@mui/material';
|
||||||
|
import TextField from "@mui/material/TextField";
|
||||||
|
import FormControlLabel from "@mui/material/FormControlLabel";
|
||||||
|
import Checkbox from "@mui/material/Checkbox";
|
||||||
|
import Link from "@mui/material/Link";
|
||||||
|
import Grid from "@mui/material/Grid";
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Container from "@mui/material/Container";
|
||||||
|
import AppBar from '@mui/material/AppBar';
|
||||||
|
import Toolbar from '@mui/material/Toolbar';
|
||||||
|
import IconButton from '@mui/material/IconButton';
|
||||||
|
import Avatar from '@mui/material/Avatar';
|
||||||
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
|
import Menu from '@mui/material/Menu';
|
||||||
|
import MenuIcon from '@mui/material/Menu'
|
||||||
|
import MenuItem from '@mui/material/MenuItem';
|
||||||
|
import {red, green, lightBlue, lightGreen} from '@mui/material/colors';
|
||||||
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||||
|
import { ReactSession } from 'react-client-session';
|
||||||
|
|
||||||
|
|
||||||
|
const theme = createTheme({
|
||||||
|
palette: {
|
||||||
|
primary: {
|
||||||
|
main: lightGreen[700],
|
||||||
|
apple: red[500],
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const getEatery = () => {
|
||||||
|
return ReactSession.get("eatery");
|
||||||
|
}
|
||||||
|
|
||||||
|
function MenuExpansion() {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const Home = () => {
|
||||||
|
navigate('/Plan');
|
||||||
|
}
|
||||||
|
const Menus = () => {
|
||||||
|
navigate('/Menus');
|
||||||
|
}
|
||||||
|
const Past = () => {
|
||||||
|
navigate('/Past');
|
||||||
|
}
|
||||||
|
const navigateLogin = () => {
|
||||||
|
navigate('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return(
|
||||||
|
|
||||||
|
|
||||||
|
<ThemeProvider theme={theme}>
|
||||||
|
<AppBar className='bar' position="static">
|
||||||
|
<Toolbar variant="dense">
|
||||||
|
<Button variant="h6" color="main" position="right" onClick={Home}>
|
||||||
|
Home</Button>
|
||||||
|
<Button variant="h6" color="main" component="div" onClick={Menus}>
|
||||||
|
Menus
|
||||||
|
</Button>
|
||||||
|
<Button variant="h6" onClick="Past">
|
||||||
|
Past Plans</Button>
|
||||||
|
<Button variant="h6" color="main" component="div" onClick={navigateLogin} sx={{
|
||||||
|
':hover': {
|
||||||
|
bgcolor: '#ffc6c4', // theme.palette.primary.main
|
||||||
|
color: 'red',
|
||||||
|
},
|
||||||
|
}}>
|
||||||
|
Log out
|
||||||
|
</Button>
|
||||||
|
</Toolbar>
|
||||||
|
</AppBar>
|
||||||
|
</ThemeProvider>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
export default MenuExpansion;
|
||||||
@@ -22,6 +22,8 @@ import MenuIcon from '@mui/material/Menu'
|
|||||||
import MenuItem from '@mui/material/MenuItem';
|
import MenuItem from '@mui/material/MenuItem';
|
||||||
import {red, green, lightBlue, lightGreen} from '@mui/material/colors';
|
import {red, green, lightBlue, lightGreen} from '@mui/material/colors';
|
||||||
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||||
|
import { ReactSession } from 'react-client-session';
|
||||||
|
|
||||||
|
|
||||||
const theme = createTheme({
|
const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
@@ -49,6 +51,52 @@ const navigateLogin = () => {
|
|||||||
navigate('/');
|
navigate('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const menuExpansion = () => {
|
||||||
|
navigate('/MenuExpansion');
|
||||||
|
}
|
||||||
|
|
||||||
|
const setStarbucks = () => {
|
||||||
|
ReactSession.set("eatery", "Starbucks");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setChick = () => {
|
||||||
|
ReactSession.set("eatery", "Chick-fil-a");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setABP = () => {
|
||||||
|
ReactSession.set("eatery", "Au Bon Pain");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setMoma = () => {
|
||||||
|
ReactSession.set("eatery", "Modern Market");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setTaco = () => {
|
||||||
|
ReactSession.set("eatery", "Taco Bell");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setDH = () => {
|
||||||
|
ReactSession.set("eatery", "Dining Hall");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setFlip = () => {
|
||||||
|
ReactSession.set("eatery", "Flip Kitchen");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
const setSmash = () => {
|
||||||
|
ReactSession.set("eatery", "Smashburger");
|
||||||
|
menuExpansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
@@ -94,7 +142,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Dining Hall
|
Dining Hall
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setDH}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -108,7 +156,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Starbucks
|
Starbucks
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setStarbucks}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -128,7 +176,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
ABP
|
ABP
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setABP}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -142,7 +190,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Chick-fil-a
|
Chick-fil-a
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setChick}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -161,7 +209,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Flip Kitchen
|
Flip Kitchen
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setFlip}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -175,7 +223,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Modern Market
|
Modern Market
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setMoma}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -194,7 +242,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Taco Bell
|
Taco Bell
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setTaco}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
@@ -208,7 +256,7 @@ const navigateLogin = () => {
|
|||||||
<Typography gutterBottom variant="h5" component="div">
|
<Typography gutterBottom variant="h5" component="div">
|
||||||
Smashburger
|
Smashburger
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button>View Items</Button>
|
<Button onClick={setSmash}>View Items</Button>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import InputLabel from '@mui/material/InputLabel';
|
|||||||
import FormControl from '@mui/material/FormControl';
|
import FormControl from '@mui/material/FormControl';
|
||||||
import { Table, TableBody, TableCell, TableContainer,TableHead, TableRow, Paper} from '@mui/material';
|
import { Table, TableBody, TableCell, TableContainer,TableHead, TableRow, Paper} from '@mui/material';
|
||||||
|
|
||||||
|
|
||||||
const theme = createTheme({
|
const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
primary: {
|
primary: {
|
||||||
|
|||||||
Reference in New Issue
Block a user