) wrapping around all children React Components.\n// 1. In our Parent Componenet:\n// import {CartProvider} from \"./CartContext\"\n// inside our children componenets - we want to\n// 1. import {useCartContext} from \"./CartContext\"\n// 2. inside our functional component code section:\n// const { cart, setCart, ... } = useCartContext();\n// and call cart, setCart, ... wherever we want!\n\nconst CartContext = React.createContext();\n\nexport const useCartContext = () => {\n const context = useContext(CartContext);\n\n // if (!context) {\n // throw new Error(\n // \"useCartContext must be called within a Provider component\"\n // );\n // }\n\n return context;\n};\n\nexport function CartProvider({children}) {\n // values and functions we are allowing every component to access below:\n\n const [cart, setCart] = useLocalStorage(\"userLocalCart\", []);\n const userCartCount = cart.length;\n\n const [prevCart, setPrevCart] = useLocalStorage(\"prevCart\", cart);\n const [prevOrder, setPrevOrder] = useLocalStorage(\"prevOrder\");\n\n const [orderPaid, setOrderPaid] = useState(false);\n\n const addNewItem = (newItem) => {\n setCart((prevItems) => {\n return [...prevItems, newItem];\n });\n };\n\n const [orderID, setOrderID] = useState();\n\n return (\n \n {children}\n \n );\n}\n\n// function like useState but allows us to store our cart (and data) inside the user's local storage\n\nfunction useLocalStorage(key, initialValue) {\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState(() => {\n try {\n // Get from local storage by key\n const item = window.localStorage.getItem(key);\n // Parse stored json or if none return initialValue\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n // If error also return initialValue\n console.log(error);\n return initialValue;\n }\n });\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue = (value) => {\n try {\n // Allow value to be a function so we have same API as useState\n const valueToStore =\n value instanceof Function ? value(storedValue) : value;\n // Save state\n setStoredValue(valueToStore);\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n } catch (error) {\n // A more advanced implementation would handle the error case\n console.log(error);\n }\n };\n\n return [storedValue, setValue];\n}\n","import {makeStyles} from \"@material-ui/core/styles\";\n\n// styling\n\nconst drawerWidth = 240;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: \"flex\",\n },\n drawer: {\n [theme.breakpoints.up(\"lg\")]: {\n width: drawerWidth,\n flexShrink: 0,\n },\n },\n appBar: {\n [theme.breakpoints.up(\"lg\")]: {\n width: `calc(100% - ${drawerWidth}px)`,\n marginLeft: drawerWidth,\n },\n },\n menuButton: {\n marginRight: theme.spacing(2),\n [theme.breakpoints.up(\"lg\")]: {\n display: \"none\",\n },\n },\n // necessary for content to be below app bar\n toolbar: theme.mixins.toolbar,\n drawerPaper: {\n width: drawerWidth,\n },\n content: {\n flexGrow: 1,\n padding: theme.spacing(3),\n },\n navLinks: {\n textDecoration: \"none\",\n color: \"inherit\",\n boxShadow: \"none\",\n },\n menuNavLink: {\n marginRight: theme.spacing(2),\n },\n title: {\n flexGrow: 1,\n fontFamily: \"Hogback\",\n fontSize: \"2.5rem\",\n },\n alignToCenter: {\n alignSelf: \"center\",\n width: \"100%\",\n },\n table: {\n minWidth: 700,\n },\n}));\n\nexport default useStyles;\n","import {React, useState} from \"react\";\nimport {Link} from \"react-router-dom\";\n\nimport {\n Menu as MenuIcon,\n ShoppingBasket as ShoppingBasketIcon,\n} from \"@material-ui/icons\";\n\nimport {\n AppBar,\n Toolbar,\n Drawer,\n Box,\n Typography,\n IconButton,\n List,\n Divider,\n ListItem,\n ListItemIcon,\n ListItemText,\n CssBaseline,\n Hidden,\n Badge,\n} from \"@material-ui/core\";\n\nimport {useTheme} from \"@material-ui/core/styles\";\n\nimport {topList, menuList} from \"./Data/NavList\";\n\nimport {useCartContext} from \"./CartContext\";\n\n//styling\nimport useStyles from \"./MaterialStyles\";\n\nfunction ResponsiveDrawer(props) {\n const {window} = props;\n const classes = useStyles();\n const theme = useTheme();\n const [mobileOpen, setMobileOpen] = useState(false);\n\n const {userCartCount} = useCartContext();\n\n const handleDrawerToggle = () => {\n setMobileOpen(!mobileOpen);\n };\n\n // defining our drawer. loops through imported lists\n // add this to wrapper div to make it close on click onClick={handleDrawerToggle}\n const drawer = (\n \n
\n
\n\n
\n {topList.map((item, index) => {\n const {text, icon, routeTo} = item;\n\n return (\n \n {\" \"}\n \n {icon && {icon} }\n \n \n \n );\n })}\n
\n
\n
\n {menuList.map((item, index) => {\n const {text, icon, routeTo} = item;\n return (\n \n {\" \"}\n \n {icon && {icon} }\n \n \n \n );\n })}\n
\n
if your reading this, its too late \n
\n );\n\n const container =\n window !== undefined ? () => window().document.body : undefined;\n\n return (\n \n
\n
\n \n \n \n \n\n {/* Our Heading */}\n \n \n {\" \"}\n China Delight {\" \"}\n \n \n\n {/* Shopping Cart Icon */}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n {\" \"}\n \n \n \n \n
\n {/* The implementation can be swapped with js to avoid SEO duplication of links. */}\n\n {/* Temp drawer that hides on large and higher screens */}\n \n \n {drawer}\n \n \n\n {/* Perm drawer that is hidden on md & down screens= */}\n \n \n {drawer}\n \n \n \n
\n );\n}\n\nexport default ResponsiveDrawer;\n","import React from \"react\";\nimport {Helmet} from \"react-helmet\";\nimport {Typography, Grid, Box} from \"@material-ui/core\";\nimport {NavigateNext as NavigateNextIcon} from \"@material-ui/icons\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\nimport {AlertTitle} from \"@material-ui/lab\";\n\nfunction Alert(props) {\n return ;\n}\n\nfunction Home() {\n return (\n \n
\n \n \n \n \n \n \n Menu \n Dinner \n Specials \n Sides \n Appetizers \n China Delight - Forest Hill, MD \n \n
\n \n {/* HOME PAGE ALERT */}\n {/* \n \n \n Alert for Friday 6/24 \n \n Our phone lines are down for the day and will not be able to\n process credit cards in-person. Please pay in cash or by credit\n card online. Sorry for any inconveniences and thank you!\n \n */}\n \n 晚餐时间\n \n \n \n {/* \n {\" \"\n */}\n \n \n 你好!~ Welcome the new China Delight website!\n \n China Delight is a local Chinese cuisine take-out and dine-in\n restaurant in Forest Hill, MD.\n \n \n \n Disclaimer: The \n \n photos not exact replications of our dishes and are to serve as\n references.\n \n \n \n \n \n \n \n Menu \n \n \n \n \n Lunch \n \n \n \n \n Dinner \n \n \n \n \n \n \n \n Hours\n \n \n \n Monday - Saturdays\n \n \n 11 AM - 9:30 PM\n \n \n Sundays\n \n \n 12 - 8:30\n \n \n Tuesdays\n \n \n Closed\n \n \n \n \n \n \n Contact\n \n 📞 PHONE: 410-877-9490 \n 📩 EMAIL:\n \n chinadelightmd@gmail.com\n \n \n \n \n \n Directions\n \n 📍 1E Newport Dr, Forest Hill, MD 21050\n \n On Rt. 24 (Rock Spring Road), right across Enotria \n \n \n \n \n \n
\n );\n}\n\nexport default Home;\n","const ingredients = [\n {\n name: \"Mixed Vegetables [Basic]\",\n des:\n \"Mushrooms, bamboo shoots, celery, baby corn, snow peas, water chestnut, cabbage, carrots, broccoli, buck choy. White sauce for Shrimp and Chicken dishes. Brown sauce for Beef and Pork dishes\",\n },\n {\n name: \"Moo Goo Gai Pan\",\n des:\n \"Bamboo shoots, buck choy, mushrooms, snow peas, green peppers. White sauce.\",\n },\n { name: \"🔥 Garlic Sauce\", des: \"[Basic] + green peppers. Brown sauce.\" },\n { name: \"🔥 Hunan\", des: \"[Basic] + green peppers and onions. Brown sauce.\" },\n {\n name: \"🔥 Szechuan\",\n des:\n \"Green peppers, onions, celery, carrot, baby corn, and snow peas. Brown sauce.\",\n },\n {\n name: \"🔥 Curry\",\n des:\n \"Onions, green pepper, snow peas, carrot, bamboo shoots, baby corn, water chestnuts, mushrooms, and celery. Curry sauce.\",\n },\n { name: \"Black Bean\", des: \"[Curry] + broccoli.\" },\n {\n name: \"Chow Mein\",\n des: \"Cabbage, bean sprouts, onions, celery. White sauce.\",\n },\n {\n name: \"Chop Suey\",\n des:\n \"[Chow Mein] + bamboo shoots, water chestnuts, carrot, snow pea, and mushrooms. White sauce.\",\n },\n {\n name: \"🔥 Kung Pao / Cashew\",\n des:\n \"Mushroom, celery, baby corn, water chestnuts, broccoli, green pepper. Brown sauce.\",\n },\n { name: \"Mu Shu\", des: \"Cabbage, mushrooms, and scallions.\" },\n { name: \"Lo Mein\", des: \"Bean spoutrs, cabbage, onions, and carrot.\" },\n {\n name: \"Rice Noodles\",\n des:\n \"Gluten-Free. Cabbage, carrots, celery, bean sprouts, snow peas, eggs. Stir fried and no sauce.\",\n },\n {\n name: \"Salt and Pepper\",\n des: \"Green peppers and onions. Stir fried and no sauce.\",\n },\n { name: \"Seafood Rice Noodles\", des: \"Shrimp, scallops, and lobster.\" },\n {\n name: \"Lobster Fried Rice/Lo Mein\",\n des: \"Baby lobster and imitation crab meat.\",\n },\n { name: \"Combination / 🔥 Szechuan\", des: \"Shrimp, Chicken, and Beef.\" },\n { name: \"Egg Drop Soup\", des: \"Egg and corn starch.\" },\n {\n name: \"Seafood Soup\",\n des:\n \"Chop Suey vegetables, corn starch (broth), white egg, clear sauce, imitation crab, shrimp, scallops, baby lobster. \",\n },\n];\n\nconst pricing = [\n {\n name: \"Extra Sauces? (sweet & sour, gravy)\",\n cost: \"$1 (1/2 pint) / $2 (pint)\",\n },\n { name: \"Extra Shrimp?\", cost: \"$0.50 for every extra piece\" },\n { name: \"Fried Rice (regular)\", cost: \"$1 / $1.50\" },\n { name: \"Fried Rice (w. meat)\", cost: \"$2.50 / $3.75 \" },\n { name: \"Lo Mein (regular)\", cost: \"$1 / $ 1.50\" },\n { name: \"Lo Mein (w. meat)\", cost: \"$2.50 / $3.75\" },\n];\n\nconst orderTimes = [\n {\n name: \"soups\",\n time:\n \"most soups like hot & sour, egg drop, & wonton broths are always ready\",\n },\n { name: \"appetizers\", time: \"frying them takes anywhere from 5-10 mins\" },\n { name: \"egg foo young\", time: \"these are very meticulous. ~10 minutes\" },\n\n { name: \"dumplings\", time: \"steamed ~ 10 mins / fried ~ 15 mins\" },\n { name: \"most stir fries\", time: \"5-10 mins\" },\n];\n\nexport { ingredients, pricing, orderTimes };\n","import React from \"react\";\n\nimport {withStyles, makeStyles} from \"@material-ui/core/styles\";\nimport {\n Typography,\n Box,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Paper,\n} from \"@material-ui/core\";\nimport {ExpandMore as ExpandMoreIcon} from \"@material-ui/icons\";\n\nimport {ingredients, pricing} from \"../Data/AboutData\";\n\nconst StyledTableCell = withStyles((theme) => ({\n head: {\n backgroundColor: theme.palette.common.black,\n color: theme.palette.common.white,\n },\n body: {\n fontSize: 14,\n },\n}))(TableCell);\n\nconst StyledTableRow = withStyles((theme) => ({\n root: {\n \"&:nth-of-type(odd)\": {\n backgroundColor: theme.palette.action.hover,\n },\n },\n}))(TableRow);\n\nconst useStyles = makeStyles({\n table: {\n minWidth: \"auto\",\n maxWidth: 700,\n },\n});\n\nfunction About() {\n const classes = useStyles();\n\n const ingredientTable = (\n \n \n \n \n Item \n Description \n \n \n \n {ingredients.map((item) => (\n \n \n {item.name}\n \n {item.des} \n \n ))}\n \n
\n \n );\n\n const pricingTable = (\n \n \n \n \n Item \n \n {\" \"}\n Cost (Pint / Quart){\" \"}\n \n \n \n \n {pricing.map((item) => (\n \n \n {item.name}\n \n {item.cost} \n \n ))}\n \n
\n \n );\n\n return (\n \n
\n \n About\n \n \n {\" \"}\n Have more questions? Call us at 410-877-9490 or email us at{\" \"}\n \n {\" \"}\n chinadelightmd@gmail.com{\" \"}\n {\" \"}\n \n \n\n \n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n FAQ: \n \n \n \n \n \n {\" \"}\n What are your Holiday Hours?{\" \"}\n \n \n {\" \"}\n We are open every day of the year{\" \"}\n EXCEPT: Tuesdays & Thanksgiving. Our Holidays\n hours are the same as our regular hours.{\" \"}\n {\" \"}\n \n Do you deliver? \n \n {\" \"}\n Usually not. However, you can order delivery on{\" \"}\n \n {\" \"}\n DoorDash\n \n .{\" \"}\n {\" \"}\n \n What oil do you use? \n \n {\" \"}\n Vegetable oil{\" \"}\n {\" \"}\n \n \n {\" \"}\n Accounts? Favorites? Order History?{\" \"}\n \n \n {\" \"}\n We will try to work on this in future if time allows.{\" \"}\n {\" \"}\n \n \n \n \n \n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n Pricing: \n \n \n \n {pricingTable} \n \n \n \n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n Order Times: \n \n \n \n {\" \"}\n \n \n {\" \"}\n When it is not very busy, orders can be finished with 10-15\n minutes. On busy nights like{\" \"}\n \n Thursdays, Fridays, Saturdays, and Holidays,{\" \"}\n {\" \"}\n orders can take much longer. ~30 min - 1 hour.\n Major holidays such as Thanksgiving,\n Christmas week, and New Years can result in orders taking up to\n 1-2 hours. Thank you for your patience!{\" \"}\n \n {/* These times are only for reference. \n {orderTimesTable} {\" \"} */}\n \n \n \n \n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n Ingredients: \n \n \n \n 🔥 = spicy \n \n {ingredientTable} {\" \"}\n \n \n \n\n \n \n {\" \"}\n \n {\" \"}\n About the site{\" \"}\n \n \n {\" \"}\n This website was made with 💗 by WZ © {new Date().getFullYear()}{\" \"}\n \n \n {\" \"}\n Source code can be found at{\" \"}\n GitHub {\" \"}\n \n \n {\" \"}\n A MERN stack application{\" \"}\n \n \n {\" \"}\n \n \n \n
\n );\n}\n\nexport default About;\n","import axios from \"axios\";\n\n// prod: \"https://chinadelightmd.com\"\n// dev: \"http://localhost:4747\"\nconst api = axios.create({\n baseURL: \"https://chinadelightmd.com\",\n});\n\nexport default api;\n","import React from \"react\";\nimport {Email, Item} from \"react-html-email\";\n\n// import {\n// Button as ButtonIcon,\n// Delete as DeleteIcon,\n// ShoppingCart as ShoppingCartIcon,\n// } from \"@material-ui/icons\";\n// import {\n// IconButton,\n// Button,\n// Typography,\n// Box,\n// Table,\n// TableBody,\n// TableCell,\n// TableContainer,\n// TableHead,\n// TableRow,\n// Paper,\n// makeStyles,\n// } from \"@material-ui/core\";\n\n// const tableStyles = makeStyles((theme) => ({\n// table: {\n// width: \"100%\",\n// maxWidth: 805,\n// },\n// }));\n\nconst formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n});\n\nconst MyEmail = ({order}) => {\n // const { orderPaid } = useCartContext();\n\n // const tableClasses = tableStyles();\n\n // const [cartSubtotal, setCartSubtotal] = useState(0);\n // var subt1 = 0;\n // cart.forEach((item) => (subt1 = subt1 + item.cartUnitPrice * item.quantity));\n // var taxes = subt1 * 0.06;\n // var total = subt1 * 1.06;\n\n const name = order.name;\n const email = order.email;\n const phone = order.phone;\n const cart = order.cart;\n const orderRequests = order.orderReqs;\n const estimatedTime = order.estimatedTime;\n const paymentMethod = order.paymentMethod;\n const amountPaid = order.amountPaid;\n\n function getClockTime() {\n var now = new Date();\n var hour = now.getHours();\n var minute = now.getMinutes();\n var second = now.getSeconds();\n var ap = \"AM\";\n if (hour > 11) {\n ap = \"PM\";\n }\n if (hour > 12) {\n hour = hour - 12;\n }\n if (hour === 0) {\n hour = 12;\n }\n if (hour < 10) {\n hour = \"0\" + hour;\n }\n if (minute < 10) {\n minute = \"0\" + minute;\n }\n if (second < 10) {\n second = \"0\" + second;\n }\n var timeString = hour + \":\" + minute + \" \" + ap;\n return timeString;\n }\n const orderTime = getClockTime();\n\n const month = new Date().getMonth() + 1;\n const date = new Date().getDate();\n const year = new Date().getFullYear();\n const fullDate = `${month}/${date}/${year}`;\n\n var subtotal = 0;\n cart.forEach(\n (item) => (subtotal = subtotal + item.cartUnitPrice * item.quantity)\n );\n var taxes = subtotal * 0.06;\n var total = subtotal * 1.06;\n\n // convert pickUpTime to 12 hour format\n const pickUpTime = order.pickUpTime;\n const pickUpTimeArr = pickUpTime ? pickUpTime.split(\":\") : [\"00\", \"00\"];\n const pickUpHour = pickUpTimeArr[0];\n const pickUpMinute = pickUpTimeArr[1];\n const pickUpTime12Hour =\n Number(pickUpHour) > 12 ? Number(pickUpHour) - 12 : pickUpHour;\n const meridiem = Number(pickUpHour) >= 12 ? \"PM\" : \"AM\";\n const pickUpTime12HourStr = `${pickUpTime12Hour}:${pickUpMinute} ${meridiem}`;\n\n const pickUpDetails = (\n \n \n \n Pickup{\" \"}\n {order.pickUpOption === \"ASAP\"\n ? `ASAP around ${estimatedTime}`\n : \"Custom Pick-Up Time\"}{\" \"}\n {order.pickUpOption === \"custom time\" ? (\n ⏰ Pick up time: {pickUpTime12HourStr}
\n ) : null}{\" \"}\n \n \n );\n\n const paidOnline = (\n \n \n Customer Paid Online {formatter.format(amountPaid)} (includes 1.15 fee)\n ✅ \n {total - amountPaid === 0 || total - amountPaid < 0 ? null : (\n \n Amount Due \n {formatter.format(total - amountPaid)}\n
\n )}\n \n \n );\n\n const payInPerson = (\n \n \n 💵 Paying In Person\n \n \n \n );\n\n const filledCart = (\n \n {cart.map((item, index) => {\n const sizeToStr = () => {\n switch (item.options.sizeValue) {\n case \"Pint\":\n return \"Pt.\";\n case \"Quart\":\n return \"Qt.\";\n default:\n return \"\";\n }\n };\n const itemSize = sizeToStr();\n const itemOptions =\n itemSize +\n \" \" +\n Object.entries(item.options)\n .map(([key, value]) => {\n if (key === \"sizeValue\") {\n return \"\";\n }\n switch (value) {\n case \"Lunch\":\n return \"L\";\n case \"Dinner\":\n return \"#\";\n case \"White Rice\":\n return \"WR\";\n case \"Fried Rice\":\n return \"FR\";\n default:\n return value;\n }\n })\n .join(\", \");\n const itemTotalPrice = item.cartUnitPrice * item.quantity;\n const requestContent = (\n <>\n
Note: {item.requestContent} \n >\n );\n\n return (\n
\n \n \n
\n 🍱\n \n {\" \"}\n ({item.quantity}) {itemSize} {item.title}\n \n \n \n {itemOptions}
\n \n \n \n \n {item.requestContent === \"\" ? null : requestContent}\n
\n \n
QTY: {item.quantity}
\n
\n {formatter.format(item.cartUnitPrice)} (x{item.quantity}) ={\" \"}\n {formatter.format(itemTotalPrice)}\n
\n
\n \n \n );\n })}\n
\n );\n\n const orderEmail = (\n \n - \n
\n
China Delight \n
\n {\" \"}\n {name.split(\" \")[0]}'s Order #{phone}\n \n {name} | {email} | {phone}\n
\n {fullDate} | {orderTime}\n
\n
{pickUpDetails}
\n
{paymentMethod === \"In Person\" ? payInPerson : paidOnline}
\n
\n \n \n \n
Today's Receipt \n \n \n \n {filledCart}\n\n \n \n \n
\n
\n {orderRequests && (\n
Customer's requests for the order: \n )}\n
\n {orderRequests}\n
\n
\n
Subtotal: {formatter.format(subtotal)}\n
Taxes (6%): {\" \"}\n {formatter.format(taxes)}\n
\n
\n
\n Total \n
\n
\n {formatter.format(total)}\n
\n
\n
\n \n \n
\n
\n
\n Any questions?\n
\n Don't hesitate to email us at chinadelightmd@gmail.com.
\n Or, call us at 410-877-9490!\n
\n \n \n );\n\n return {orderEmail}
;\n};\n\nexport default MyEmail;\n","import React, {useEffect, useRef} from \"react\";\n\nimport {useCartContext} from \"../CartContext\";\n\nconst Paypal = (props) => {\n let {\n orderTotal,\n setAmountPaid,\n sendEmail,\n setPrevOrder,\n setCart,\n setBackdrop,\n handleClose,\n order,\n setFinalPage,\n setPaymentPage,\n } = props;\n\n const {orderPaid, setOrderPaid} = useCartContext();\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n const paypal = useRef();\n let paypalTotal = orderTotal;\n paypalTotal = formatter.format(paypalTotal + 1.15);\n\n const handlePlaceOrder = () => {\n order[\"amountPaid\"] = paypalTotal;\n order[\"paymentMethod\"] = \"Paid Online\";\n //commenting out adding order for now\n // addOrder(order);\n sendEmail();\n // redirect\n // window.location.href = \"/\"\n\n //empty our cart\n setPrevOrder(order);\n setCart([]);\n setBackdrop(true);\n handleClose();\n };\n\n useEffect(() => {\n window.paypal\n .Buttons({\n createOrder: (data, actions, err) => {\n return actions.order.create({\n intent: \"CAPTURE\",\n purchase_units: [\n {\n description: \"China Delight Online Order\",\n amount: {\n currency_code: \"USD\",\n value: paypalTotal,\n },\n },\n ],\n });\n },\n onApprove: async (data, actions) => {\n const order = await actions.order.capture();\n console.log(\"successful order: \" + order);\n setOrderPaid(true);\n // setPaymentMethod(\"Paid Online\");\n setAmountPaid(paypalTotal);\n order[\"amountPaid\"] = paypalTotal;\n order[\"paymentMethod\"] = \"Paid Online\";\n handlePlaceOrder();\n setPaymentPage(false);\n setFinalPage(true);\n },\n onError: (err) => {\n console.log(err);\n alert(\"Sorry, looks like something went wrong. Please try again.\");\n },\n })\n .render(paypal.current);\n }, [orderTotal]);\n\n return (\n \n {orderPaid ? null : (\n
\n )}\n
\n );\n};\n\nexport default Paypal;\n","import {React, useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {Close as CloseIcon} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Button,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n Backdrop,\n CircularProgress,\n Snackbar,\n} from \"@material-ui/core\";\nimport MuiAlert from \"@material-ui/lab/Alert\";\nimport {AlertTitle} from \"@material-ui/lab\";\n\nimport {useCartContext} from \"../CartContext\";\n//email\nimport MyEmail from \"./MyEmail\";\nimport {renderEmail} from \"react-html-email\";\nimport api from \"../api\";\nimport Paypal from \"./Paypal\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n backdrop: {\n zIndex: theme.zIndex.drawer + 1,\n color: \"#fff\",\n },\n boldHeading: {\n fontWeight: 800,\n },\n}));\n\nconst CheckoutDialog = (props) => {\n const {onClose, open, total} = props;\n\n const {cart, setCart, setPrevOrder, orderPaid} = useCartContext();\n\n const [orderReqs, setOrderReqs] = useState(\"\");\n const [name, setName] = useState(\"\");\n const [email, setEmail] = useState(\"\");\n const [phoneNum, setPhoneNum] = useState();\n const [pickUpOption, setPickUpOption] = useState(\"ASAP\");\n const [customTime, setCustomTime] = useState(\"16:00\");\n const [paymentPage, setPaymentPage] = useState(false);\n const [finalPage, setFinalPage] = useState(false);\n const [firstPage, setFirstPage] = useState(true);\n const [showPayPal, setShowPayPal] = useState(false);\n const [paymentMethod, setPaymentMethod] = useState(\"In Person\");\n const [amountPaid, setAmountPaid] = useState(0);\n\n const [backdrop, setBackdrop] = useState(false);\n\n // handling alerts\n const [formAlert, setFormAlert] = useState(false);\n const formAlertClose = () => {\n setFormAlert(false);\n };\n\n const [emptyAlert, setEmptyAlert] = useState(false);\n const emptyAlertClose = () => {\n setEmptyAlert(false);\n };\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n let order = {};\n let date = new Date().toString();\n\n // Calculate Order Wait Time, for ASAP orders which take 30 minutes usually, or 1 hour on weekends.\n // For scheduled orders, the wait time is the difference between the scheduled time and the current time.\n const currTime = new Date();\n\n // Check if Th, Fr, Sa and time is 4-8pm\n const busy =\n currTime.getDay() >= 4 &&\n currTime.getDay() <= 6 &&\n currTime.getHours() >= 16 &&\n currTime.getHours() < 20;\n\n const offset = busy ? 60 * 60 * 1000 : 40 * 60 * 1000;\n const pickUpTime = new Date(currTime.getTime() + offset);\n // Convert the hours to 12-hour format\n var hours = pickUpTime.getHours();\n var amPm = hours >= 12 ? \"PM\" : \"AM\";\n hours = hours % 12;\n hours = hours === 0 ? 12 : hours;\n\n // Format the future time as a string\n var pickUpTimeStr =\n hours.toString().padStart(2, \"0\") +\n \":\" +\n pickUpTime.getMinutes().toString().padStart(2, \"0\") +\n \" \" +\n amPm;\n\n // Determine device type:\n let userAgent = navigator.userAgent;\n const mobileRegex =\n /Andrio|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;\n const desktopRegex = /Chrome|Safari|Firefox|Edge|MSIE|Opera/i;\n\n let deviceType = \"desktop\";\n if (mobileRegex.test(userAgent)) {\n deviceType = \"mobile\";\n } else if (desktopRegex.test(userAgent)) {\n deviceType = \"desktop\";\n }\n\n if (pickUpOption === \"ASAP\") {\n order = {\n name: name,\n email: email,\n phone: phoneNum,\n pickUpOption: pickUpOption,\n cart: cart,\n orderReqs: orderReqs,\n total: total,\n timePlaced: date,\n estimatedTime: pickUpTimeStr,\n paymentMethod: paymentMethod,\n amountPaid: amountPaid,\n deviceType: deviceType,\n };\n } else {\n order = {\n name: name,\n email: email,\n phone: phoneNum,\n pickUpOption: pickUpOption,\n pickUpTime: customTime,\n cart: cart,\n orderReqs: orderReqs,\n total: total,\n timePlaced: date,\n estimatedTime: pickUpTimeStr,\n paymentMethod: paymentMethod,\n amountPaid: amountPaid,\n deviceType: deviceType,\n };\n }\n\n const handleClose = () => {\n onClose();\n };\n\n const addOrder = async (newOrder) => {\n await api.post(\"/api/order/add\", newOrder).catch((err) => console.log(err));\n };\n\n const sendEmail = async () => {\n const messageHtml = renderEmail( );\n const response = await api.post(\"/api/send\", {\n name: name,\n email: email,\n messageHtml: messageHtml,\n });\n if (response.data.msg === \"success\") {\n window.location.href = \"/confirmation\";\n } else if (response.data.msg === \"fail\") {\n alert(\"Oops, something went wrong. Try again\");\n }\n };\n\n const handlePlaceOrder = async (e) => {\n if (Object.keys(cart).length <= 0) {\n setEmptyAlert(true);\n } else {\n handleClose();\n setBackdrop(true);\n console.log(\"placing order ...\");\n await addOrder(order);\n window.localStorage.setItem(\"order\", JSON.stringify(order));\n console.log(\"order added to DB ...\");\n await sendEmail();\n console.log(\"sent email ...\");\n // redirect\n // window.location.href = \"/\"\n e.preventDefault();\n\n //empty our cart\n setPrevOrder(order);\n setCart([]);\n setBackdrop(true);\n handleClose();\n }\n };\n\n const handlePickUpOptionChange = (e) => {\n var text = e.target.value;\n setPickUpOption(text);\n };\n\n const handleCustomTimeChange = (e) => {\n var time = e.target.value;\n setCustomTime(time);\n console.log(\"Want to be picked up at \", customTime);\n };\n\n const handleOrderReqsChange = (e) => {\n var text = e.target.value;\n setOrderReqs(text);\n };\n const handleNameChange = (e) => {\n var text = e.target.value;\n setName(text);\n };\n const handleEmailChange = (e) => {\n var text = e.target.value;\n setEmail(text);\n };\n const handlePhoneNumChange = (e) => {\n var text = e.target.value;\n setPhoneNum(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const customTimeChooser = (\n \n );\n\n const page1 = (\n \n \n\n \n \n );\n\n const page2 = (\n \n \n {\n setPaymentPage(!paymentPage);\n setFirstPage(!firstPage);\n }}\n >\n Back\n \n \n \n Choose a payment method\n \n \n After finishing the order or finish the paypal payment, you will be\n redirected to the order confirmation page and should receive an email\n confirmation from{\" \"}\n \n chinadelightmd@gmail.com.\n \n \n \n Please note, we do not deliver in either case. \n \n \n \n \n \n \n Want to Pay Online?\n \n \n \n \n \n {orderPaid ? (\n \n \n Thank you! Your online order status will be updated as paid ✅\n Amount Paid: {formatter.format(amountPaid)} (Inludes 1.15 fee)\n \n {total - amountPaid === 0 || total - amountPaid < 0 ? null : (\n \n Have to Pay: \n {formatter.format(total - amountPaid)}\n
\n )}\n \n \n ) : (\n setShowPayPal(!showPayPal)}\n >\n {showPayPal ? \"NEVERMIND\" : \"Pay Online\"}\n \n )}\n {showPayPal && (\n \n \n \n DISCLAIMER\n \n \n There is a $1.15 fee and any special requests\n not calculated online may require you to pay extra in-person.\n Please see pricing for more details on\n what costs you can expect.\n \n \n We do not deliver. \n PayPal may ask for a shipping address as their service requires\n it but we will not deliver to that address. If you want food\n delivered, try 3rd-party apps like Grubhub, DoorDash, UberEats\n etc.\n \n \n Once the PayPal payment goes through, an email will be sent\n and you will be redirected to the confirmation page. If\n nothing happens, call us to see if we got your order. Make\n sure to add all your items in your cart and\n do not reload or leave the page. \n \n \n \n\n \n {/* Working on this feature... */}\n \n )}\n \n \n \n \n {showPayPal ? null : (\n \n \n I'll Pay In Person\n \n \n Amount Due: {formatter.format(total)}\n \n \n Finish Order\n \n
\n )}\n\n \n \n \n );\n\n return (\n <>\n \n \n \n \n CHECKOUT\n \n \n \n \n
\n \n \n \n \n {firstPage && page1}\n {paymentPage ? page2 : null}\n\n {/* {paymentPage ? (\n \n \n {\" \"}\n \n {\" \"}\n Want to Pay Online?\n \n {\" \"}\n \n \n {orderPaid ? (\n \n {\" \"}\n \n {\" \"}\n Thanks for paying! Your online order status will be\n updated as paid ✅ Amount Paid:{\" \"}\n {formatter.format(amountPaid)} (Inludes .50 fee)\n \n {total - amountPaid === 0 ||\n total - amountPaid < 0 ? null : (\n \n {\" \"}\n Have to Pay: {\" \"}\n {formatter.format(total - amountPaid)}{\" \"}\n
\n )}\n \n \n ) : (\n setPaymentPage(!paymentPage)}\n >\n {\" \"}\n {paymentPage ? \"❌ Cancel\" : \"💳 Pay Now\"}\n \n )}\n \n \n ) : null} */}\n \n \n \n\n \n \n \n {formatter.format(total)}\n \n \n\n \n {firstPage ? (\n {\n if (name === \"\" || email === \"\" || phoneNum === \"\") {\n setFormAlert(true);\n } else {\n setPaymentPage(!paymentPage);\n setFirstPage(!firstPage);\n }\n }}\n >\n Next\n \n ) : (\n \n Finish Order\n \n )}\n \n \n \n \n \n {\" \"}\n Error Please fill out the form!{\" \"}\n \n {\" \"}\n \n \n {\" \"}\n Error Your cart is empty!{\" \"}\n \n \n \n \n \n \n \n {\" \"}\n Sending... don't close the window{\" \"}\n \n \n {\" \"}\n \n {/* \n {\" \"}\n ...if it takes longer than a few minutes, check your email or try\n again.{\" \"}\n */}\n \n >\n );\n};\n\nexport default CheckoutDialog;\n","import React, {useState, useEffect} from \"react\";\nimport api from \"../api\";\n\nimport {\n Delete as DeleteIcon,\n ShoppingCart as ShoppingCartIcon,\n} from \"@material-ui/icons\";\nimport {\n IconButton,\n Button,\n Typography,\n Box,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Paper,\n makeStyles,\n Snackbar,\n} from \"@material-ui/core\";\nimport MuiAlert from \"@material-ui/lab/Alert\";\nimport {AlertTitle} from \"@material-ui/lab\";\n// context provider\nimport {useCartContext} from \"../CartContext\";\n\nimport CheckoutDialog from \"./CheckoutDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst tableStyles = makeStyles((theme) => ({\n table: {\n width: \"100%\",\n maxWidth: 805,\n },\n}));\n\nconst formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n});\n\nfunction Cart() {\n const [onlineStatus, setOnlineStatus] = useState(false);\n\n const getOnlineStatus = async () => {\n const res = await api.get(\"/api/online\");\n setOnlineStatus(res.data);\n };\n\n useEffect(() => {\n getOnlineStatus();\n }, []);\n\n const tableClasses = tableStyles();\n //handle empty cart alert\n const [emptyAlert, setEmptyAlert] = useState(false);\n const emptyAlertClose = () => {\n setEmptyAlert(false);\n };\n\n //handle ordering on tuesdays alert\n const [tuesdayAlert, setTuesdayAlert] = useState(false);\n const tuesdayAlertClose = () => {\n setTuesdayAlert(false);\n };\n\n // handling orders in the morning\n const [morningAlert, setMorningAlert] = useState(false);\n const morningAlertClose = () => {\n setMorningAlert(false);\n };\n\n const [holidayAlert, setHolidayAlert] = useState(false);\n const holidayAlertClose = () => {\n setHolidayAlert(false);\n };\n\n const {cart, setCart, userCartCount} = useCartContext();\n const [open, setOpen] = React.useState(false);\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleDelete = (i) => {\n console.log(\"deleting item @ index : \", i);\n setCart((prevItems) => {\n return prevItems.filter((cartItem, index) => {\n return index !== i;\n });\n });\n };\n\n // for holiday alert. remember: .getMonth is i = 0 ... 11 (month -1)\n\n const handleCheckout = () => {\n // testing to allow opening cart\n // handleClickOpen();\n let today = new Date();\n // checkers\n const holiday =\n today.getDate() === 6 &&\n today.getMonth() === 5 &&\n today.getFullYear() === 2023;\n const emptyCart = userCartCount === 0;\n const morning = today.getHours() < 11;\n let valentines = today.getDate() === 14 && today.getMonth() === 1;\n\n // using checkers\n if (onlineStatus === false) {\n setHolidayAlert(true);\n } else if (today.getDay() === 2 && !valentines) {\n setTuesdayAlert(true);\n } else if (holiday) {\n setHolidayAlert(true);\n } else if (morning) {\n setMorningAlert(true);\n } else if (emptyCart) {\n setEmptyAlert(true);\n } else {\n handleClickOpen();\n console.log(\"Checking out...\");\n }\n };\n\n var subt1 = 0;\n cart.forEach((item) => (subt1 = subt1 + item.cartUnitPrice * item.quantity));\n var taxes = subt1 * 0.06;\n var total = subt1 * 1.06;\n\n const filledCart = (\n \n \n \n \n \n {\" \"}\n \n Order {\" \"}\n \n \n \n \n \n \n Subtotal: {formatter.format(subt1)}\n Taxes (6%): {formatter.format(taxes)}\n Total: {formatter.format(total)}\n \n \n \n Checkout\n \n \n \n \n \n {cart.map((item, index) => {\n const itemOptions = Object.entries(item.options)\n .map(([key, value]) => {\n return value;\n })\n .join(\", \");\n const itemTotalPrice = item.cartUnitPrice * item.quantity;\n\n return (\n \n \n 🍱 {item.title} \n \n {\" \"}\n 🥠 {itemOptions}{\" \"}\n {\" \"}\n \n {\" \"}\n 👩🍳 Requests? {item.requestContent}{\" \"}\n \n \n {\" \"}\n Qty: {item.quantity} \n \n {\" \"}\n {formatter.format(item.cartUnitPrice)}\n \n \n {\" \"}\n {formatter.format(itemTotalPrice)}{\" \"}\n \n handleDelete(index)}\n >\n \n {\" \"}\n \n \n \n );\n })}\n\n {/* \n \n Subtotal \n {ccyFormat(invoiceSubtotal)} \n \n \n Tax \n {`${(TAX_RATE * 100).toFixed(\n 0\n )} %`} \n {ccyFormat(invoiceTaxes)} \n \n \n Total \n {ccyFormat(invoiceTotal)} \n */}\n \n
\n \n );\n\n const emptyCart = (\n \n Woops! Looks like your cart is empty! head over to the\n Menu and add items to your cart ~\n \n );\n\n return (\n \n
\n {/* CART PAGE ALERT */}\n {/* \n {\" \"}\n \n {\" \"}\n Alert for Friday 6/24 \n {\" \"}\n Our phone lines are down for the day and will not be able to process\n credit cards in-person. Please pay in cash or by credit card online.\n Sorry for any inconveniences and thank you!\n */}\n \n \n 🥡 My Cart\n \n \n \n {userCartCount > 0 ? filledCart : emptyCart}{\" \"}\n \n\n \n \n \n Checkout{\" \"}\n \n \n {/* setCart([])}> Confirm & Place Order \n setCart([1, 2, 3])}>\n {\" \"}\n Reset Cart to default{\" \"}\n */}\n \n \n \n
{\" \"}\n
\n \n {\" \"}\n Error Your cart is empty!{\" \"}\n \n \n
\n \n \n CLOSED ON TUESDAYS \n \n We are not open on Tuesdays! Apologies for any inconveniences.\n \n \n
\n \n \n ONLINE ORDERS CLOSED IN THE MORNING \n \n We are not accepting online orders in the morning (before 11) to avoid\n any inconveniences.\n \n \n
\n \n \n Online Orders Closed \n \n Apologies, we are closed for today!\n \n \n
\n );\n}\n\nexport default Cart;\n","import React from \"react\";\n\nimport {\n Typography,\n Box,\n Table,\n TableBody,\n TableCell,\n TableContainer,\n TableHead,\n TableRow,\n Paper,\n makeStyles,\n} from \"@material-ui/core\";\nimport {AccountCircle, CalendarToday} from \"@material-ui/icons\";\n\n// context provider\nimport {useCartContext} from \"../CartContext\";\n\nconst tableStyles = makeStyles((theme) => ({\n table: {\n maxWidth: 650,\n },\n}));\n\nconst formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n});\n\nfunction Confirmation() {\n const tableClasses = tableStyles();\n\n const {prevOrder} = useCartContext();\n\n const cart = prevOrder.cart;\n const name = prevOrder.name;\n const email = prevOrder.email;\n const phone = prevOrder.phone;\n\n const pickUpOption = prevOrder.pickUpOption;\n const pickUpTime = prevOrder.pickUpTime;\n const timePlaced = prevOrder.timePlaced;\n const orderReqs = prevOrder.orderReqs;\n\n const estimatedTime = prevOrder.estimatedTime;\n const pickUpTimeArr = pickUpTime ? pickUpTime.split(\":\") : [\"00\", \"00\"];\n const pickUpHour = pickUpTimeArr[0];\n const pickUpMinute = pickUpTimeArr[1];\n const pickUpTime12Hour =\n Number(pickUpHour) > 12 ? Number(pickUpHour) - 12 : pickUpHour;\n const meridiem = Number(pickUpHour) >= 12 ? \"PM\" : \"AM\";\n const pickUpTime12HourStr = `${pickUpTime12Hour}:${pickUpMinute} ${meridiem}`;\n\n const paymentMethod = prevOrder.paymentMethod;\n const amountPaid = prevOrder.amountPaid;\n\n var subt1 = 0;\n cart.forEach((item) => (subt1 = subt1 + item.cartUnitPrice * item.quantity));\n var taxes = subt1 * 0.06;\n var total = subt1 * 1.06;\n\n const filledCart = (\n \n \n \n \n \n \n ‿୨ order ୧‿ {\" \"}\n \n \n \n \n \n \n Subtotal: {formatter.format(subt1)} Taxes (6%):{\" \"}\n {formatter.format(taxes)}\n Total \n {formatter.format(total)} \n \n \n \n \n \n {cart.map((item, index) => {\n const itemOptions = Object.entries(item.options)\n .map(([key, value]) => {\n return value;\n })\n .join(\", \");\n const itemTotalPrice = item.cartUnitPrice * item.quantity;\n subt1 = subt1 + itemTotalPrice;\n\n return (\n \n \n 🍱 {item.title} \n \n {\" \"}\n 🥠 {itemOptions}{\" \"}\n {\" \"}\n \n {\" \"}\n 👩🍳 Requests? {item.requestContent}{\" \"}\n \n \n {\" \"}\n qty: {item.quantity} \n \n {\" \"}\n {formatter.format(item.cartUnitPrice)} ( x {item.quantity}{\" \"}\n ) = {formatter.format(itemTotalPrice)}\n \n \n \n \n );\n })}\n \n \n \n Order Requests: {orderReqs === \"\" ? \"N/A\" : orderReqs}\n \n \n \n \n
\n \n );\n\n // minions gif:\n // https://i.pinimg.com/originals/5e/65/93/5e659326c2027e01b2c56a8c6d7908e7.gif\n // quby (little monk)\n // https://1.bp.blogspot.com/-SQd93ExJA70/W9h0023ZyQI/AAAAAAA0VjY/pTA1Op9ysxQQqinq6V1v4aFJvGO7ujnvACLcBGAs/s1600/AW2158645_18.gif\n // thank you girl\n // https://i.pinimg.com/originals/fd/4a/58/fd4a58bfd60ee8d07ca3acc265c4b72a.gif\n return (\n <>\n \n \n \n \n {/* */}\n \n \n Order Confirmed!\n \n \n \n \n \n {name.split(\" \")[0]}\n \n \n {email} \n \n \n \n \n \n \n Estimated Pick Up Time\n \n \n \n {\" \"}\n {pickUpOption === \"ASAP\" ? estimatedTime : pickUpTime12HourStr}\n \n \n \n \n \n It will usually take our staff around 25-40 minutes to\n prepare your order. Larger orders or orders placed during dinner\n time (4-9PM) and holidays, may take upwards to an hour. Thank you so\n much for your patience!\n \n \n \n Note, we do not deliver - just come in and let us know you placed\n an online order!\n \n \n \n \n More Info: \n \n \n \n Thank you for your order! You should receive a confirmation email\n shortly at\n {email} .\n \n \n Check your spam/junk if you can't find it - or call us at\n 410-877-9490 and ask if we received your order.\n \n See Order times for more details on estimated\n order times.\n \n See Pricing for more details on what costs you\n can expect.\n \n \n \n If we have any questions, updates, or concerns about your order, we\n will contact you at {phone}.\n \n \n \n How was the experience? \n \n \n Enjoyed the food? Click\n here \n to leave us a review on Google! Any feedback is appreciated and\n helps us grow!\n \n Also feel free to email\n \n {\" \"}\n chinadelightmd@gmail.com{\" \"}\n \n with any suggestions or feedback.\n \n \n \n Order Time {timePlaced}\n Pick Up Option {pickUpOption}\n {pickUpOption === \"custom time\" ? (\n <>\n {\" \"}\n Picking Up At {pickUpTime}{\" \"}\n >\n ) : null}\n {pickUpOption === \"ASAP\" ? (\n <>\n {\" \"}\n Estimated Pick Up Time {estimatedTime}{\" \"}\n >\n ) : null}\n {\" \"}\n {paymentMethod === \"In Person\" ? (\n \n {\" \"}\n Payment {paymentMethod} {\" \"}\n
\n ) : (\n \n
✅ Payment {paymentMethod}
{\" \"}\n
✅ Paid {formatter.format(amountPaid)}{\" \"}\n (includes 1.15 fee)
{\" \"}\n {total - amountPaid === 0 || total - amountPaid < 0 ? null : (\n
\n {\" \"}\n ⛔ Have to pay: {\" \"}\n {formatter.format(total - amountPaid)}{\" \"}\n
\n )}\n
\n )}\n \n {\" \"}\n \n\n {filledCart} \n \n >\n );\n}\n\nexport default Confirmation;\n","import React, {useState} from \"react\";\nimport {Favorite as FavoriteIcon} from \"@material-ui/icons\";\nimport {\n Box,\n Button,\n Typography,\n TextField,\n makeStyles,\n Divider,\n withStyles,\n Snackbar,\n} from \"@material-ui/core\";\nimport Rating from \"@material-ui/lab/Rating\";\nimport Pagination from \"@material-ui/lab/Pagination\";\nimport MuiAlert from \"@material-ui/lab/Alert\";\nimport {AlertTitle} from \"@material-ui/lab\";\n\nimport api from \"../api\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\nconst StyledRating = withStyles({\n iconFilled: {\n color: \"#ff6d75\",\n },\n iconHover: {\n color: \"#ff3d47\",\n },\n})(Rating);\n\nconst Review = React.memo((props) => {\n const classes = useStyles();\n const {title, reviews, category} = props;\n const [reviewed, setReviewed] = useLocalStorage(\"reviewed\", false);\n\n // handling alerts\n const [alertOpen, setAlertOpen] = useState(false);\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n // for the item review\n // post request to the api/review/add/appetizer/ name of dish\n const addReview = (newReview) => {\n api\n .post(`api/review/add/${category}/${title}`, newReview)\n .catch((err) => console.log(err));\n };\n var itemRating = 0;\n\n reviews.forEach((review) => {\n itemRating = itemRating + review.rating;\n });\n\n let itemAverageRating = itemRating / reviews.length;\n const [newReview, setNewReview] = useState({\n name: \"\",\n rating: 5,\n reviewContent: \"\",\n });\n\n //pagination\n const [page, setPage] = useState(1);\n const [rowsPerPage] = useState(5);\n const handleChangePage = (e, newPage) => {\n setPage(newPage);\n };\n\n const [noOfPages] = useState(Math.ceil(reviews.length / rowsPerPage));\n const reviewsDiv = (\n \n {reviews\n .slice((page - 1) * rowsPerPage, (page - 1) * rowsPerPage + rowsPerPage)\n .map((review) => (\n
\n {\" \"}\n \"{review.reviewContent}\" - {review.name} ({review.rating}\n /5){\" \"}\n
\n ))}{\" \"}\n
\n \n \n
\n );\n\n const handleReviewChange = (e) => {\n var text = e.target.value;\n setNewReview((prev) => {\n return {...prev, reviewContent: text};\n });\n };\n const handleNameChange = (e) => {\n var text = e.target.value;\n setNewReview((prev) => {\n return {...prev, name: text};\n });\n };\n const handleRatingChange = (e) => {\n var rating = e.target.value;\n setNewReview((prev) => {\n return {...prev, rating: rating};\n });\n };\n\n const handleAddNewReview = (e) => {\n console.log(\"new review is: \", newReview);\n setAlertOpen(true);\n // setReviewed(true);\n addReview(newReview);\n e.preventDefault();\n setNewReview({\n name: \"\",\n reviewContent: \"\",\n rating: 5,\n });\n };\n\n const oldAddReview = reviewed ? (\n \n {\" \"}\n Thank you for your review! 😊\n If you just submitted a review, it should show up when you reload!{\" \"}\n \n ) : (\n \n );\n\n return (\n \n \n
\n }\n readOnly\n />{\" \"}\n \n
\n\n {reviews.length === 0 ? (\n
Be the first to review!
\n ) : (\n reviewsDiv\n )}\n
\n
{\" \"}\n \n {\" \"}\n \n \n {\" \"}\n Sucess Thanks for the review! It should show\n up when you refresh{\" \"}\n \n \n \n );\n});\n\nfunction useLocalStorage(key, initialValue) {\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState(() => {\n try {\n // Get from local storage by key\n const item = window.localStorage.getItem(key);\n // Parse stored json or if none return initialValue\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n // If error also return initialValue\n console.log(error);\n return initialValue;\n }\n });\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue = (value) => {\n try {\n // Allow value to be a function so we have same API as useState\n const valueToStore =\n value instanceof Function ? value(storedValue) : value;\n // Save state\n setStoredValue(valueToStore);\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n } catch (error) {\n // A more advanced implementation would handle the error case\n console.log(error);\n }\n };\n\n return [storedValue, setValue];\n}\n\nexport default Review;\n","import React, {useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n Snackbar,\n} from \"@material-ui/core\";\nimport MuiAlert from \"@material-ui/lab/Alert\";\nimport {AlertTitle} from \"@material-ui/lab\";\n\nimport {useCartContext} from \"../CartContext\";\nimport Reviews from \"./Reviews\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst LunchDialog = React.memo((props) => {\n const {onClose, open, onAdd, title, description, img, price, reviews} = props;\n\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [sideValue, setSideValue] = useState(\"No Side\");\n const [quantity, setQuantity] = useState(1);\n const [addedPrice, setAddedPrice] = useState(0);\n const [finalPrice, setFinalPrice] = useState(price);\n let cartUnitPrice = finalPrice + addedPrice;\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n // customer request\n const [requestContent, setRequestContent] = useState(\"\");\n\n // handling alerts\n const [alertOpen, setAlertOpen] = useState(false);\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n // context cart\n const {addNewItem} = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n const currentTime = new Date().getHours();\n if (currentTime < 16 && currentTime > 7) {\n onAdd();\n const type = \"Lunch\";\n let options = {};\n if (\n title === \"Egg Foo Young\" ||\n title === \"Lo Mein\" ||\n title === \"Fried Rice\" ||\n title === \"Chow Mein\"\n ) {\n options = {type, meatValue, riceValue, sideValue};\n } else {\n options = {type, riceValue, sideValue};\n }\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n } else {\n setAlertOpen(true);\n }\n };\n\n //handling price changes\n const handleRiceChange = (e) => {\n const riceChosen = e.target.value;\n setRiceValue(riceChosen);\n if (riceChosen === \"Lo Mein\" || riceChosen === \"Pork Fried Rice\") {\n setAddedPrice(2);\n } else {\n setAddedPrice(0);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleTextFieldChange = (e) => {\n const text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n let cartPrice = quantity * (finalPrice + addedPrice);\n\n const EFYMeatOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n } label=\"Pork\" />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n } label=\"Beef\" />\n \n {\" \"}\n \n \n \n );\n const meatOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n } label=\"Pork\" />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n } label=\"Beef\" />\n }\n label=\"Combo\"\n />\n \n {\" \"}\n \n \n \n );\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n Please choose from the options below:\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n \n {riceValue}\n \n \n\n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />\n }\n label=\"Lo Mein (+2)\"\n />\n }\n label=\"Pork Fried Rice (+2)\"\n />\n \n {\" \"}\n \n \n \n {/* \n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n \n Sides (+.75):\n \n \n {sideValue}\n \n \n\n \n \n \n Select one: \n \n }\n label=\"No Side\"\n />\n }\n label=\"Egg Roll\"\n />\n }\n label=\"Soda\"\n />\n }\n label=\"Wonton Soup\"\n />\n }\n label=\"Egg Drop Soup\"\n />\n }\n label=\"Hot & Sour Soup\"\n />\n \n \n \n \n */}\n {title === \"Egg Foo Young\" ? EFYMeatOptions : null}\n {title === \"Fried Rice\" ||\n title === \"Lo Mein\" ||\n title === \"Chow Mein\"\n ? meatOptions\n : null}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n {\" \"}\n \n \n {\" \"}\n Error It's not lunch time right now!{\" \"}\n \n \n \n >\n );\n});\n\nexport default LunchDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport {Add as AddIcon} from \"@material-ui/icons\";\n\nimport LunchDialog from \"./LunchDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst LunchMenuCard = (props) => {\n const {itemName, itemDescription, img, price, priceSm, priceLg, reviews} =\n props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n \n \n \n {\" \"}\n \n {\" \"}\n from {price === null ? `$ ${priceSm} / $ ${priceLg}` : price}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default LunchMenuCard;\n","import React, {useState, useEffect} from \"react\";\nimport {Typography, Box, Grid, makeStyles, TextField} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport LunchMenuCard from \"../MenuParts/LunchMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: {margin: theme.spacing(6)},\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst LunchSpecials = (props) => {\n const classes = useStyles();\n const [lunches, setLunches] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(() => {\n api.get(\"/api/lunches\").then((res) => {\n setLunches(res.data);\n });\n }, []);\n\n const lunchGrid = lunches.map((lunch, index) => (\n \n \n \n ));\n\n const filteredLunchGrid = lunches.map((lunch, index) => {\n if (lunch.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Lunch{\" \"}\n \n \n Served with the choice of:{\" \"}\n \n {\" \"}\n Fried Rice, White Rice, Lo Mein (+2), or Pork Fried Rice (+2).{\" \"}\n \n \n \n {\" \"}\n Note: Available daily until 3:30 PM{\" \"}\n \n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? lunchGrid : filteredLunchGrid}\n \n \n \n );\n};\n\nexport default LunchSpecials;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst SoupDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Soup\";\n let options = {};\n if (title === \"Yat Gai Mei\") {\n options = { type, meatValue };\n } else if (price !== null) {\n options = { type };\n } else {\n options = { type, sizeValue };\n }\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n No options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default SoupDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport {Add as AddIcon} from \"@material-ui/icons\";\n\nimport SoupDialog from \"./SoupDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst LunchMenuCard = (props) => {\n const {itemName, itemDescription, img, price, priceSm, priceLg, reviews} =\n props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default LunchMenuCard;\n","import React, {useState, useEffect} from \"react\";\nimport {Typography, Box, Grid, makeStyles} from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport SoupMenuCard from \"../MenuParts/SoupMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: {margin: theme.spacing(6)},\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Soups = (props) => {\n const classes = useStyles();\n const [soups, setSoups] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/soups\").then((res) => {\n setSoups(res.data);\n }),\n []\n );\n\n const soupGrid = soups.map((soup) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n Soups\n \n \n Something to warm you up on cold nights.\n Each soup comes with a bag of fried noodles.\n (Pints come with 1 bag; quarts come with 2 bags)\n \n
\n\n \n \n {soupGrid}\n \n \n \n );\n};\n\nexport default Soups;\n","import {React, useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport Review from \"./Reviews\";\n\nimport {useCartContext} from \"../CartContext\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst AppetizerDialog = (props) => {\n const {onClose, open, onAdd, title, description, img, price, reviews} = props;\n\n const [styleValue, setStyleValue] = useState(\"Fried\");\n const [fillingValue, setFillingValue] = useState(\"Pork\");\n const [quantity, setQuantity] = useState(1);\n const [addedPrice, setAddedPrice] = useState(0);\n const [finalPrice, setFinalPrice] = useState(price);\n let cartUnitPrice = finalPrice + addedPrice;\n // customer request\n const [requestContent, setRequestContent] = useState(\"\");\n\n // context cart\n const {addNewItem} = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Appetizer\";\n let options = {};\n if (title === \"Dumplings\") {\n options = {type, styleValue, fillingValue};\n } else {\n options = {type};\n }\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n //handling price changes\n const handleStyleChange = (e) => {\n var styleChosen = e.target.value;\n setStyleValue(styleChosen);\n };\n\n const handleFillingChange = (e) => {\n const fillingChosen = e.target.value;\n setFillingValue(fillingChosen);\n if (fillingChosen === \"Chicken\") {\n setFinalPrice(price + 2);\n } else {\n setFinalPrice(price);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleTextFieldChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n let cartPrice = quantity * (finalPrice + addedPrice);\n\n const dumplingOptions = (\n \n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Style: \n \n {styleValue}\n \n \n \n \n \n Select one: \n \n }\n label=\"Fried\"\n />\n }\n label=\"Steamed\"\n />\n \n {\" \"}\n \n \n \n
\n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n Filling: \n \n {fillingValue}\n \n \n \n \n \n Select one: \n \n }\n label=\"Pork\"\n />\n }\n label=\"Vegetable\"\n />\n }\n label=\"Chicken (+2)\"\n />\n \n \n \n \n {\" \"}\n
\n );\n\n const eggRollOptions = (\n \n please choose from the options below:\n
\n }\n aria-controls=\"panel2a-content\"\n id=\"panel2a-header\"\n >\n type: \n \n {fillingValue}\n \n \n \n \n \n select one: \n \n }\n label=\"pork\"\n />\n }\n label=\"vegetable\"\n />\n }\n label=\"shrimp (+.10) \"\n />\n \n \n \n \n {\" \"}\n
\n );\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {\" \"}\n {title === \"Dumplings\" ? (\n dumplingOptions\n ) : (\n no options to choose from 🧐 \n )}{\" \"}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n\n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nfunction useLocalStorage(key, initialValue) {\n // State to store our value\n // Pass initial state function to useState so logic is only executed once\n const [storedValue, setStoredValue] = useState(() => {\n try {\n // Get from local storage by key\n const item = window.localStorage.getItem(key);\n // Parse stored json or if none return initialValue\n return item ? JSON.parse(item) : initialValue;\n } catch (error) {\n // If error also return initialValue\n console.log(error);\n return initialValue;\n }\n });\n\n // Return a wrapped version of useState's setter function that ...\n // ... persists the new value to localStorage.\n const setValue = (value) => {\n try {\n // Allow value to be a function so we have same API as useState\n const valueToStore =\n value instanceof Function ? value(storedValue) : value;\n // Save state\n setStoredValue(valueToStore);\n // Save to local storage\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n } catch (error) {\n // A more advanced implementation would handle the error case\n console.log(error);\n }\n };\n\n return [storedValue, setValue];\n}\n\nexport default AppetizerDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport {Add as AddIcon} from \"@material-ui/icons\";\n\nimport AppetizerDialog from \"./AppetizerDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst AppetizerMenuCard = (props) => {\n const {itemName, itemDescription, img, price, priceSm, priceLg, reviews} =\n props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n from {price === null ? `$ ${priceSm} / $ ${priceLg}` : price}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default AppetizerMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport {\n Typography,\n Box,\n Grid,\n makeStyles,\n TextField,\n} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport axios from \"axios\";\nimport api from \"../api\";\n\nimport AppetizerMenuCard from \"../MenuParts/AppetizerMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // paddingBottom: 30,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Appetizers = (props) => {\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/appetizers\").then((res) => {\n console.log(res.data);\n setItems(res.data);\n }),\n []\n );\n\n const classes = useStyles();\n\n // loop thru out appetizer collection\n const itemGrid = items.map((appetizer) => (\n \n \n \n ));\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Appetizers{\" \"}\n \n \n Classic chinese appetizers to tease the appetite\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? itemGrid : filteredItemGrid}\n \n \n \n );\n};\n\nexport default Appetizers;\n","import React, { useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst DinnerDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [sideValue, setSideValue] = useState(\"None\");\n const [addedPrice, setAddedPrice] = useState(0);\n const [finalPrice, setFinalPrice] = useState(price);\n const [requestContent, setRequestContent] = useState(\"\");\n const [quantity, setQuantity] = useState(1);\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n\n const [expanded, setExpanded] = useState(false);\n\n const { cart, setCart, addNewItem } = useCartContext();\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Dinner\";\n let options = {};\n if (\n title === \"Egg Foo Young\" ||\n title === \"Lo Mein\" ||\n title === \"Fried Rice\" ||\n title === \"Chow Mein\"\n ) {\n options = { type, meatValue, riceValue, sideValue };\n } else {\n options = { type, riceValue, sideValue };\n }\n let cartUnitPrice = finalPrice + addedPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleRiceChange = (e) => {\n var riceChosen = e.target.value;\n setRiceValue(riceChosen);\n if (riceChosen === \"Lo Mein\" || riceChosen === \"Pork Fried Rice\") {\n setAddedPrice(2);\n } else {\n setAddedPrice(0);\n }\n };\n\n const handleSideChange = (e) => {\n const sideChosen = e.target.value;\n setSideValue(sideChosen);\n if (!(sideChosen === \"None\")) {\n setFinalPrice(price + 1);\n } else {\n setFinalPrice(price);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleTextFieldChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n let cartPrice = quantity * (finalPrice + addedPrice);\n\n const EFYMeatOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n } label=\"Pork\" />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n } label=\"Beef\" />\n \n {\" \"}\n \n \n \n );\n const meatOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n } label=\"Pork\" />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n } label=\"Beef\" />\n }\n label=\"Combo\"\n />\n \n {\" \"}\n \n \n \n );\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n Please choose from the options below:\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n \n Rice: {riceValue}\n \n {\" \"}\n \n\n \n \n Select one: \n\n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />\n }\n label=\"Lo Mein ( + $2 )\"\n />\n }\n label=\"Pork Fried Rice ( + $2 )\"\n />\n \n {\" \"}\n \n {\" \"}\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n \n Soup? ( + $1 ) : {sideValue}\n \n {\" \"}\n \n\n \n \n Select one: \n \n }\n label=\"None\"\n />\n }\n label=\"Wonton Soup\"\n />\n }\n label=\"Egg Drop Soup\"\n />\n }\n label=\"Hot & Sour Soup\"\n />\n \n \n \n {\" \"}\n {title === \"Egg Foo Young\" ? EFYMeatOptions : null}\n {title === \"Fried Rice\" ||\n title === \"Lo Mein\" ||\n title === \"Chow Mein\"\n ? meatOptions\n : null}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default DinnerDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Button,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n IconButton,\n Fab,\n Box,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n useMediaQuery,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport DinnerDialog from \"./DinnerDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst DinnerMenuCard = React.memo((props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `from ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n {alertOpen && (\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n )}\n \n \n );\n});\n\nexport default DinnerMenuCard;\n","import React, {useState, useEffect} from \"react\";\nimport {Typography, Box, Grid, makeStyles, TextField} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport DinnerMenuCard from \"../MenuParts/DinnerMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: {margin: theme.spacing(6)},\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst DinnerCombo = (props) => {\n const classes = useStyles();\n const [dinners, setDinners] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(() => {\n api.get(\"/api/dinners\").then((res) => {\n setDinners(res.data);\n });\n }, []);\n\n const dinnerGrid = dinners.map((dinner) => (\n \n \n \n ));\n\n const filteredDinnerGrid = dinners.map((dinner) => {\n if (dinner.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Dinner{\" \"}\n \n \n * AKA Combo platters or Dinner platters *\n Can choose between Fried or White Rice \n (free of charge) \n Each comes with an Egg Roll {\" \"}\n (free of charge) \n Can choose to add a Soup for +$1\n {\" \"}\n
{\" \"}\n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n \n {filter === \"\" ? dinnerGrid : filteredDinnerGrid}\n \n \n \n );\n};\n\nexport default DinnerCombo;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst SSDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"S/S\";\n let options = {};\n if (title === \"Sweet & Sour Combination\") {\n options = { type };\n } else {\n options = { type, sizeValue };\n }\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default SSDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport SSDialog from \"./SSDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst SSMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default SSMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport SSMenuCard from \"../MenuParts/SSMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst SweetAndSour = (props) => {\n const classes = useStyles();\n const [sss, setSss] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/ss\").then((res) => {\n setSss(res.data);\n }),\n []\n );\n\n const ssGrid = sss.map((ss) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Sweet and Sour{\" \"}\n \n \n Breaded meats deep-fried served with sweet and sour sauce on the side.\n {\" \"}\n
\n\n \n \n {ssGrid}\n \n \n \n );\n};\n\nexport default SweetAndSour;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst EFYDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"EFY\";\n let options = {};\n options = { type, riceValue };\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n if (rice === \"Fried Rice\") {\n setRicePrice(1.5);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {riceOptions}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default EFYDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport EFYDialog from \"./EFYDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst EFYMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default EFYMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport EFYMenuCard from \"../MenuParts/EFYMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst EFY = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/efy\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Egg Foo Young{\" \"}\n \n \n An omelette-type dish served with gravy with meats of your choice. Served with\n white rice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default EFY;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst FriedRiceDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Fried Rice\";\n let options = {};\n\n options = { sizeValue };\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default FriedRiceDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport {Add as AddIcon} from \"@material-ui/icons\";\n\nimport FriedRiceDialog from \"./FriedRiceDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst FriedRiceMenuCard = (props) => {\n const {itemName, itemDescription, img, price, priceSm, priceLg, reviews} =\n props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default FriedRiceMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport FriedRiceMenuCard from \"../MenuParts/FriedRiceMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst FriedRice = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/friedrice\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Fried Rice{\" \"}\n \n \n Just simple fried rice with peas, onions, and carrots with meats of\n your choice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default FriedRice;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst LoMeinDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Lo Mein\";\n let options = {};\n\n options = { sizeValue };\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default LoMeinDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport {Add as AddIcon} from \"@material-ui/icons\";\n\nimport LoMeinDialog from \"./LoMeinDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst LoMeinMenuCard = (props) => {\n const {itemName, itemDescription, img, price, priceSm, priceLg, reviews} =\n props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default LoMeinMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport LoMeinMenuCard from \"../MenuParts/LoMeinMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst LoMein = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/lomein\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Lo Mein{\" \"}\n \n \n Classic lo mein noodles cooked in soy sauce with meats & styles of your choice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default LoMein;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst MeiFunDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Mei Fun\";\n let options = {};\n options = { type };\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default MeiFunDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport MeiFunDialog from \"./MeiFunDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst MeiFunMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default MeiFunMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport MeiFunMenuCard from \"../MenuParts/MeiFunMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst MeiFun = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/meifun\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Mei Fun{\" \"}\n \n \n Also known as Rice Noodles. Stir-fried rice-based noodles with\n meats of your choice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default MeiFun;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst ChowMeinDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [style, setStyle] = useState(\"Chow Mein\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n\n let options = {};\n\n options = { style, sizeValue, riceValue };\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n console.log(typeof finalPrice);\n if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleStyleChange = (e) => {\n const meat = e.target.value;\n setStyle(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const styleOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Style: \n {style} \n \n \n \n \n Select one: \n \n }\n label=\"Chow Mein\"\n />\n }\n label=\"Chop Suey\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {sizeOptions}\n {riceOptions}\n {styleOptions}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default ChowMeinDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport ChowMeinDialog from \"./ChowMeinDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst ChowMeinMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default ChowMeinMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport ChowMeinMenuCard from \"../MenuParts/ChowMeinMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst ChowMein = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/chowmein\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Chow Mein{\" \"}\n \n \n Mixed vegetables in a white sauce with a meat of your choice. Served\n with steamed rice and fried noodles.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default ChowMein;\n","import {React} from \"react\";\nimport {ExpandMore as ExpandMoreIcon} from \"@material-ui/icons\";\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Typography,\n FormControl,\n FormLabel,\n FormControlLabel,\n Radio,\n RadioGroup,\n makeStyles,\n} from \"@material-ui/core\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst SauceOptions = (props) => {\n const {sauceValue, handleSauceChange} = props;\n const classes = useStyles();\n\n return (\n \n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Sauce: \n \n {sauceValue}\n \n \n \n \n \n Select one: \n \n }\n label=\"Brown Sauce\"\n />\n }\n label=\"White Sauce\"\n />\n }\n label=\"No Sauce\"\n />\n \n \n \n \n \n
\n );\n};\n\nexport default SauceOptions;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\nimport SauceOptions from \"../Utils/SauceOptions\"\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst PoultryDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [sauceValue, setSauceValue] = useState(\"Brown\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Entree\";\n let options = {};\n if (price === null && title === \"Chicken w. Mixed Vegetables\") {\n options = { type, sizeValue, riceValue, sauceValue };\n } else if (price === null) {\n options = { type, sizeValue, riceValue };\n } else if (title === \"Chicken w. Mixed Vegetables\") { \n options = { type, riceValue, sauceValue}\n }\n else {\n options = { type, riceValue };\n }\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n\n if (rice === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleSauceChange = (e) => { \n const sauceChosen = e.target.value \n setSauceValue(sauceChosen); \n\n }\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price === null ? sizeOptions : null}\n {riceOptions}\n {title === \"Chicken w. Broccoli\" || title === \"Chicken w. Mixed Vegetables\" ?\n : null}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default PoultryDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport PoultryDialog from \"./PoultryDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst PoultryMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default PoultryMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport {\n Typography,\n Box,\n Grid,\n makeStyles,\n TextField,\n} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport PoultryMenuCard from \"../MenuParts/PoultryMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Poultry = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/poultry\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Poultry{\" \"}\n \n \n Land fish served with white rice.\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? itemGrid : filteredItemGrid}\n \n \n \n );\n};\n\nexport default Poultry;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst PorkDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Entree\";\n let options = {};\n if (price === null) {\n options = { type, sizeValue, riceValue };\n } else {\n options = { type, riceValue };\n }\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n\n if (rice === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price === null ? sizeOptions : null}\n {riceOptions}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default PorkDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport PorkDialog from \"./PorkDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst PorkMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default PorkMenuCard;\n","import React, {useState, useEffect} from \"react\";\nimport {Typography, Box, Grid, makeStyles, TextField} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport PorkMenuCard from \"../MenuParts/PorkMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: {margin: theme.spacing(6)},\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Pork = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/pork\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n return (\n \n \n {\" \"}\n \n Pork\n \n \n Land fish served with white rice.\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {/* {filter === \"\" ? itemGrid : filteredItemGrid} */}\n Oops! Something went wrong.\n \n \n \n );\n};\n\nexport default Pork;\n","import {React, useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport {useCartContext} from \"../CartContext\";\nimport Review from \"./Reviews\";\nimport SauceOptions from \"../Utils/SauceOptions\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst SeafoodDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [sauceValue, setSauceValue] = useState(\"White Sauce\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const {addNewItem} = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Entree\";\n let options = {};\n if (\n price === null &&\n (title === \"Shrimp w. Broccoli\" || title === \"Shrimp w. Mixed Vegetables\")\n ) {\n options = {type, sizeValue, riceValue, sauceValue};\n } else if (price === null) {\n options = {type, sizeValue, riceValue};\n } else if (\n title === \"Shrimp w. Broccoli\" ||\n title === \"Shrimp w. Mixed Vegetables\"\n ) {\n options = {type, riceValue, sauceValue};\n } else {\n options = {type, riceValue};\n }\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n\n if (rice === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleSauceChange = (e) => {\n const sauceChosen = e.target.value;\n setSauceValue(sauceChosen);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price === null ? sizeOptions : null}\n {riceOptions}\n {title === \"Shrimp w. Broccoli\" ||\n title === \"Shrimp w. Mixed Vegetables\" ? (\n \n ) : null}{\" \"}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default SeafoodDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport SeafoodDialog from \"./SeafoodDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst SeafoodMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default SeafoodMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport {\n Typography,\n Box,\n Grid,\n makeStyles,\n TextField,\n} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport SeafoodMenuCard from \"../MenuParts/SeafoodMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Seafood = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/seafood\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Seafood{\" \"}\n \n \n Meat of the sea served with white rice.\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? itemGrid : filteredItemGrid}\n \n \n \n );\n};\n\nexport default Seafood;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\nimport SauceOptions from \"../Utils/SauceOptions\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst BeefDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Entree\";\n let options = {};\n if (price === null) {\n options = { type, sizeValue, riceValue };\n } else {\n options = { type, riceValue };\n }\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n\n if (rice === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price === null ? sizeOptions : null}\n {riceOptions}\n \n \n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default BeefDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport BeefDialog from \"./BeefDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst BeefMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default BeefMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport {\n Typography,\n Box,\n Grid,\n makeStyles,\n TextField,\n} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\nimport api from \"../api\";\n\nimport BeefMenuCard from \"../MenuParts/BeefMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Beef = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/beef\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Beefs{\" \"}\n \n \n Land fish served with white rice.\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? itemGrid : filteredItemGrid}\n \n \n \n );\n};\n\nexport default Beef;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst MuShuDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Mu Shu\";\n let options = {};\n options = { type, riceValue };\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n if (rice === \"Fried Rice\") {\n setRicePrice(1.5);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {riceOptions}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default MuShuDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport MuShuDialog from \"./MuShuDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst LunchMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default LunchMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport MuShuMenuCard from \"../MenuParts/MuShuMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst MuShu = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/mushu\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Mu Shu{\" \"}\n \n \n Mixed vegetables with a meat of your choice. Put some in the included\n wraps and dab on some of the included Hoison sauce. Served with white\n rice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default MuShu;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst VegetableDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Entree\";\n let options = {};\n if (price === null) {\n options = { type, sizeValue, riceValue };\n } else {\n options = { type, riceValue };\n }\n\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n if (riceValue === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Quart\") {\n setRicePrice(1.5);\n } else if (riceValue === \"Fried Rice\" && size === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n\n if (rice === \"Fried Rice\" && price !== null) {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Quart\") {\n setRicePrice(1.5);\n } else if (rice === \"Fried Rice\" && sizeValue === \"Pint\") {\n setRicePrice(1);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price === null ? sizeOptions : null}\n {riceOptions}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default VegetableDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport VegetableDialog from \"./VegetableDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst VegetableMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default VegetableMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport VegetableMenuCard from \"../MenuParts/VegetableMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Vegetable = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/vegetable\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Vegetable{\" \"}\n \n \n Healthy vegetable and tofu options served with white rice.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default Vegetable;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst UdonDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Udon\";\n let options = {};\n options = { type };\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default UdonDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport UdonDialog from \"./UdonDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst UdonMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default UdonMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport UdonMenuCard from \"../MenuParts/UdonMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Udon = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/udon\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Udon{\" \"}\n \n \n Stir-fried thick udon noodles.\n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default Udon;\n","import { React, useState } from \"react\";\nimport { useTheme } from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport { useCartContext } from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: { margin: theme.spacing(3) },\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst ChefDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const { cart, setCart, addNewItem } = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Chef Special\";\n let options = {};\n options = { type, riceValue };\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n if (rice === \"Fried Rice\") {\n setRicePrice(1.5);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {riceOptions}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default ChefDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport ChefDialog from \"./ChefDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst ChefMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default ChefMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport {\n Typography,\n Box,\n Grid,\n makeStyles,\n TextField,\n} from \"@material-ui/core\";\nimport InputAdornment from \"@material-ui/core/InputAdornment\";\nimport SearchIcon from \"@material-ui/icons/Search\";\n// fetching data from db\nimport api from \"../api\";\n\nimport ChefMenuCard from \"../MenuParts/ChefMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Chef = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n const [filter, setFilter] = useState(\"\");\n\n useEffect(\n () =>\n api.get(\"/api/chefspecial\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n const filteredItemGrid = items.map((item) => {\n if (item.name.toLowerCase().includes(filter.toLowerCase())) {\n return (\n \n \n \n );\n }\n });\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Chef Specials{\" \"}\n \n \n Our specialiltes served with white rice.\n {\" \"}\n
\n\n \n \n \n \n ),\n }}\n value={filter}\n onChange={(e) => setFilter(e.target.value)}\n />{\" \"}\n \n \n {filter === \"\" ? itemGrid : filteredItemGrid}\n \n \n \n );\n};\n\nexport default Chef;\n","import {React, useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport {useCartContext} from \"../CartContext\";\nimport Review from \"./Reviews\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst DietDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [riceValue, setRiceValue] = useState(\"White Rice\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n const [ricePrice, setRicePrice] = useState(0);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const {addNewItem} = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Diet\";\n let options = {};\n options = {type, riceValue};\n let cartUnitPrice = finalPrice + ricePrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleRiceChange = (e) => {\n const rice = e.target.value;\n setRiceValue(rice);\n if (rice === \"Fried Rice\") {\n setRicePrice(1.5);\n } else {\n setRicePrice(0);\n }\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const riceOptions = (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Rice: \n {riceValue} \n \n \n \n \n Select one: \n \n }\n label=\"White Rice\"\n />\n }\n label=\"Fried Rice\"\n />{\" \"}\n \n {\" \"}\n \n \n \n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * (finalPrice + ricePrice);\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {riceOptions}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n Reviews\n \n\n \n \n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default DietDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport DietDialog from \"./DietDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst DietMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default DietMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport DietMenuCard from \"../MenuParts/DietMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Diet = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/diet\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Diet{\" \"}\n \n \n Plain Steamed with Original Flavor, no M.S.G. Salt and Oil Used.\n \n Seasoning Sauce be Served on the Side (White or Brown Sauce).\n Fried Rice Instead of White Rice $1.5 Extra\n \n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default Diet;\n","import {React, useState} from \"react\";\nimport {useTheme} from \"@material-ui/core/styles\";\nimport {\n Add as AddIcon,\n Close as CloseIcon,\n ExpandMore as ExpandMoreIcon,\n} from \"@material-ui/icons\";\nimport {\n Grid,\n Box,\n Fab,\n Typography,\n IconButton,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n FormLabel,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n useMediaQuery,\n makeStyles,\n Divider,\n} from \"@material-ui/core\";\n\nimport {useCartContext} from \"../CartContext\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {margin: 10},\n gridPadding: {\n padding: 15,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n flexWrap: \"wrap\",\n },\n img: {\n maxWidth: 300,\n maxHeight: 300,\n height: 230,\n width: \"100%\",\n objectFit: \"cover\",\n },\n\n dialogWrapper: {\n padding: theme.spacing(2),\n position: \"absolute\",\n },\n dialogTitle: {\n paddingRight: \"0px\",\n },\n heading: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n },\n divider: {margin: theme.spacing(3)},\n selectedValue: {\n fontSize: theme.typography.pxToRem(15),\n fontWeight: theme.typography.fontWeightRegular,\n color: theme.palette.text.secondary,\n marginLeft: 10,\n },\n formControl: {\n marginTop: theme.spacing(2),\n minWidth: 120,\n },\n selectEmpty: {\n marginTop: theme.spacing(2),\n },\n textFields: {\n \"& .MuiTextField-root\": {\n margin: theme.spacing(1),\n width: \"25ch\",\n },\n },\n}));\n\nconst SideDialog = (props) => {\n const {\n onClose,\n open,\n onAdd,\n title,\n description,\n img,\n price,\n priceSm,\n priceLg,\n } = props;\n\n var initialPrice = 1;\n if (price == null) {\n initialPrice = priceSm;\n } else {\n initialPrice = price;\n }\n const [sizeValue, setSizeValue] = useState(\"Pint\");\n const [meatValue, setMeatValue] = useState(\"Chicken\");\n const [quantity, setQuantity] = useState(1);\n const [finalPrice, setFinalPrice] = useState(initialPrice);\n\n const [requestContent, setRequestContent] = useState(\"\");\n const {addNewItem} = useCartContext();\n\n const theme = useTheme();\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"xs\"));\n const classes = useStyles();\n\n const handleClose = () => {\n onClose();\n };\n\n const handleAddItem = () => {\n onAdd();\n const type = \"Side\";\n let options = {};\n if (title === \"White Rice\") {\n options = {type, sizeValue};\n } else {\n options = {type};\n }\n let cartUnitPrice = finalPrice;\n\n const newItem = {\n title,\n cartUnitPrice,\n options,\n requestContent,\n quantity,\n };\n addNewItem(newItem);\n };\n\n const handleSizeChange = (e) => {\n const size = e.target.value;\n setSizeValue(size);\n if (size === \"Quart\") {\n setFinalPrice(priceLg);\n } else if (size === \"Pint\") {\n setFinalPrice(priceSm);\n }\n };\n\n const handleMeatChange = (e) => {\n const meat = e.target.value;\n setMeatValue(meat);\n };\n\n const handleQuantityChange = (e) => {\n setQuantity(e.target.value);\n };\n\n const handleRequestContentChange = (e) => {\n var text = e.target.value;\n setRequestContent(text);\n };\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n const meatOptions = (\n \n {\" \"}\n Please choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Meat: \n {meatValue} \n \n \n \n \n Select one: \n \n }\n label=\"Chicken\"\n />\n }\n label=\"Pork\"\n />{\" \"}\n }\n label=\"Shrimp\"\n />{\" \"}\n }\n label=\"Beef\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n const sizeOptions = (\n \n {\" \"}\n Slease choose from the options below:\n
\n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n >\n Size: \n {sizeValue} \n \n \n \n \n Select one: \n \n }\n label=\"Pint\"\n />\n }\n label=\"Quart\"\n />\n \n {\" \"}\n \n \n {\" \"}\n
\n );\n\n let cartPrice = quantity * finalPrice;\n\n return (\n <>\n \n \n \n {\" \"}\n \n {title}{\" \"}\n {\" \"}\n \n {\" \"}\n \n \n
\n \n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n {\" \"}\n \n \n \n {price !== null ? (\n title === \"Yat Gai Mei\" ? (\n meatOptions\n ) : (\n no options to choose from 🧐 \n )\n ) : (\n sizeOptions\n )}\n {/* {title === \"Yat Gai Mei\" ? meatOptions : null} */}\n \n \n {\" \"}\n \n {\" \"}\n \n \n \n \n \n \n {\" \"}\n \n \n About\n \n\n {description} \n \n\n \n {/* */}\n \n \n \n \n {\" \"}\n \n \n {\" \"}\n {formatter.format(cartPrice)}{\" \"}\n \n \n \n \n \n {\" \"}\n qty{\" \"}\n \n \n {[...Array(20)].map((_id, i) => (\n {i + 1} \n ))}\n \n \n \n \n \n {\" \"}\n \n Add to Cart{\" \"}\n \n \n \n \n >\n );\n};\n\nexport default SideDialog;\n","import React from \"react\";\n\nimport {\n Card,\n CardActions,\n CardContent,\n CardMedia,\n Typography,\n CardHeader,\n makeStyles,\n useTheme,\n Fab,\n Box,\n Snackbar,\n} from \"@material-ui/core\";\n\nimport MuiAlert from \"@material-ui/lab/Alert\";\n\nimport { Add as AddIcon } from \"@material-ui/icons\";\n\nimport SideDialog from \"./SideDialog\";\n\nfunction Alert(props) {\n return ;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: { margin: 10 },\n cards: {\n margin: 5,\n },\n media: {\n height: 0,\n paddingTop: \"56.25%\",\n },\n addIcon: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n },\n bottomText: {\n justifyContent: \"center\",\n },\n container: {\n display: \"flex\",\n justifyContent: \"space-evenly\",\n paddingBottom: theme.spacing(3),\n },\n}));\n\nconst SideMenuCard = (props) => {\n const {\n itemName,\n itemDescription,\n img,\n price,\n priceSm,\n priceLg,\n reviews,\n } = props;\n const [open, setOpen] = React.useState(false);\n const [alertOpen, setAlertOpen] = React.useState(false);\n const theme = useTheme();\n const classes = useStyles();\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleAdd = () => {\n setAlertOpen(true);\n setOpen(false);\n };\n\n const handleAlertClose = () => {\n setAlertOpen(false);\n };\n\n return (\n \n {\" \"}\n \n {/* {itemDescription} */} \n \n \n {\" \"}\n \n {\" \"}\n {price === null ? `$ ${priceSm} / $ ${priceLg}` : `$ ${price}`}\n \n {\" \"}\n \n {\" \"}\n \n Customize{\" \"}\n \n {open && (\n \n )}\n \n \n {\" \"}\n added to cart ! ~{\" \"}\n \n \n \n \n );\n};\n\nexport default SideMenuCard;\n","import React, { useState, useEffect } from \"react\";\nimport { Typography, Box, Grid, makeStyles } from \"@material-ui/core\";\n\n// fetching data from db\nimport api from \"../api\";\n\nimport SideMenuCard from \"../MenuParts/SideMenuCard\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: { margin: theme.spacing(6) },\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n pBottom: {\n paddingBottom: theme.spacing(6),\n },\n pTop: {\n paddingTop: theme.spacing(6),\n },\n}));\n\nconst Side = (props) => {\n const classes = useStyles();\n const [items, setItems] = useState([]);\n\n useEffect(\n () =>\n api.get(\"/api/sides\").then((res) => {\n setItems(res.data);\n }),\n []\n );\n\n const itemGrid = items.map((item) => (\n \n \n \n ));\n\n return (\n \n \n {\" \"}\n \n {\" \"}\n Sides{\" \"}\n \n \n Need something extra? \n {\" \"}\n
\n\n \n \n {itemGrid}\n \n \n \n );\n};\n\nexport default Side;\n","import React from \"react\";\nimport {\n Typography,\n Box,\n makeStyles,\n Divider,\n Fab,\n Button,\n} from \"@material-ui/core\";\nimport {ArrowUpward as ArrowUpwardIcon} from \"@material-ui/icons\";\n\nimport LunchSpecials from \"../MenuPages/LunchSpecials\";\nimport Soups from \"../MenuPages/Soups\";\nimport Appetizers from \"../MenuPages/Appetizers\";\nimport DinnerCombo from \"../MenuPages/DinnerCombo\";\nimport SweetAndSour from \"../MenuPages/SweetAndSour\";\nimport EFY from \"../MenuPages/EggFooYoung\";\nimport FR from \"../MenuPages/FriedRice\";\nimport LoMein from \"../MenuPages/LoMein\";\nimport MeiFun from \"../MenuPages/MeiFun\";\nimport ChowMein from \"../MenuPages/ChowMein\";\nimport Poultry from \"../MenuPages/Poultry\";\nimport Pork from \"../MenuPages/Pork\";\nimport Seafood from \"../MenuPages/Seafood\";\nimport Beef from \"../MenuPages/Beef\";\nimport MuShu from \"../MenuPages/MuShu\";\nimport Vegetable from \"../MenuPages/Vegetable\";\nimport Udon from \"../MenuPages/Udon\";\nimport Chef from \"../MenuPages/Chef\";\nimport Diet from \"../MenuPages/Diet\";\nimport Side from \"../MenuPages/Side\";\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n flexGrow: 1,\n },\n divider: {margin: theme.spacing(6)},\n subheadings: {\n marginBottom: 50,\n },\n menuHeadings: {\n // marginBottom: 20,\n },\n menuCards: {\n padding: theme.spacing(2),\n textAlign: \"center\",\n alignItems: \"center\",\n },\n bold: {\n fontWeight: \"bold\",\n },\n}));\n\nfunction Menu() {\n const classes = useStyles();\n\n return (\n \n
\n \n \n ゜・ Menu ・ ゜\n \n \n {\" \"}\n Items here will be added to your cart (see top left). Use the\n quick-links below or the sidebar to quickly navigate through our\n menu. \n \n \n \n Note: If your requests contain extra sauce, extra meat, or anything\n extra, they are liable to extra fees not calculated in the final\n price below. Please see pricing for more\n details on what costs you can expect.{\" \"}\n \n \n \n {\" \"}\n
\n Disclaimer: The {\" \"}\n \n {\" \"}\n photos not exact replications of our dishes and are to serve as\n references.{\" \"}\n \n {\" \"}\n \n \n Quick Links\n {\" \"}\n \n \n {\" \"}\n Lunch \n \n \n {\" \"}\n Dinner \n \n \n {\" \"}\n Soup {\" \"}\n {\" \"}\n \n {\" \"}\n Appetizer {\" \"}\n \n \n {\" \"}\n Sweet & Sour \n \n \n Egg Foo Young {\" \"}\n \n \n {\" \"}\n Fried Rice {\" \"}\n \n \n {\" \"}\n Lo Mein \n {\" \"}\n \n {\" \"}\n Mei Fun {\" \"}\n \n \n {\" \"}\n Chow Mein \n {\" \"}\n \n {\" \"}\n Poultry {\" \"}\n {\" \"}\n \n {\" \"}\n Pork {\" \"}\n {\" \"}\n \n {\" \"}\n Seafood {\" \"}\n {\" \"}\n \n {\" \"}\n Beef {\" \"}\n {\" \"}\n \n {\" \"}\n Mu Shu {\" \"}\n {\" \"}\n \n {\" \"}\n Vegetable {\" \"}\n {\" \"}\n \n {\" \"}\n Udon {\" \"}\n {\" \"}\n \n {\" \"}\n Specials {\" \"}\n \n \n {\" \"}\n Diet {\" \"}\n \n \n Sides {\" \"}\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n
\n \n \n \n \n
\n );\n}\n\nexport default Menu;\n","import React, {useState, useEffect} from \"react\";\nimport axios from \"axios\";\n\nimport {\n Typography,\n Box,\n Table,\n TableCell,\n TableContainer,\n TableRow,\n Paper,\n} from \"@material-ui/core\";\n\nconst AxiosTest = () => {\n const [body, setBody] = useState(\"initial body\");\n\n const [cart, setCart] = useState([]);\n\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 2,\n });\n\n var subt1 = 0;\n const randomData = () => {\n axios\n .get(\"https://jsonplaceholder.typicode.com/posts/1\")\n .then((response) => {\n setBody(response.data.body);\n console.log(response);\n });\n console.log(\"button hit\");\n };\n\n const myPost = () => {\n console.log(\"Hitting our local server:\");\n axios.get(\"http://localhost:4747/\").then((res) => console.log(res.data));\n };\n\n useEffect(\n () =>\n axios.get(\"http://localhost:4747/suck\").then((res) => {\n console.log(res.data);\n setCart(res.data);\n }),\n []\n );\n\n console.log(cart);\n\n return (\n \n {\" \"}\n
Axios Test Page \n {/*
*/}\n
\n
server data:
\n
\n {\" \"}\n my cart:{\" \"}\n
\n \n {\" \"}\n subtotal: {formatter.format(subt1)} taxes (6%):{\" \"}\n {formatter.format(subt1 * 0.06)}\n total: {formatter.format(subt1 * 1.06)} \n \n \n {cart.map((item, index) => {\n const itemOptions = Object.entries(item.options)\n .map(([key, value]) => {\n return value;\n })\n .join(\", \");\n const itemTotalPrice = item.cartUnitPrice * item.quantity;\n subt1 = subt1 + itemTotalPrice;\n\n return (\n
\n \n \n \n 🍱 {item.title} \n \n {\" \"}\n 🥠 {itemOptions}{\" \"}\n {\" \"}\n \n {\" \"}\n 👩🍳 requests? {item.textFieldValue}{\" \"}\n \n \n {\" \"}\n qty: {item.quantity} \n \n {\" \"}\n {formatter.format(item.cartUnitPrice)}\n \n \n \n \n
\n \n );\n })}\n
\n
randomData()}> hit me \n
myPost()}> my server \n
\n );\n};\n\nexport default AxiosTest;\n","import React, {useState, useEffect} from \"react\";\n\nimport {\n Typography,\n Box,\n Grid,\n Select,\n MenuItem,\n FormControl,\n} from \"@material-ui/core\";\n\nimport {ViewWeek, CalendarToday, QueryBuilder} from \"@material-ui/icons\";\n\nimport api from \"../api\";\nfunction Graph() {\n const [allStats, setAllStats] = useState({});\n const [loaded, setLoaded] = useState(false);\n\n const [year, setYear] = useState(\"y2022\");\n const [stat, setStat] = useState(\"count\");\n\n const years = [\"y2021\", \"y2022\", \"y2023\"];\n const [compare, setCompare] = useState(true);\n\n const handleStatSelect = (event) => {\n setStat(event.target.value);\n };\n const handleYearSelect = (event) => {\n setYear(event.target.value);\n if (event.target.value !== \"y2021\") setCompare(true);\n else setCompare(false);\n };\n\n const loadStats = async () => {\n const res = await api.get(\"/api/stats\");\n setAllStats(res.data);\n setLoaded(true);\n };\n\n useEffect(() => {\n loadStats();\n }, []);\n\n let index = years.indexOf(year) - 1;\n let lastYear = years[index];\n let lastYearsRevenue;\n let revenueChange;\n let orderChange;\n let avgChange;\n\n // Dashboard & Helpers\n function formatToUSD(number) {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n }).format(number);\n }\n const HourlyGraph = ({stat}) => {\n const hours = Array.from({length: 11}, (_, i) => `h${i + 11}`);\n const hourLabels = Array.from({length: 11}, (_, i) => {\n if (i + 11 > 12) return `${i + 11 - 12} pm`;\n else if (i + 11 === 12) return `${i + 11} pm`;\n else return `${i + 11} am`;\n });\n const maxVal = Math.max(\n ...hours.map((hr) => allStats[stat][year].hours[hr])\n );\n\n const bar = (hr, i) => {\n return (\n \n \n \n {hourLabels[i].split(\" \")[0]}\n \n {\" \"}\n {hourLabels[i].split(\" \")[1]}\n \n \n \n ({stat === \"revenue\" ? formatToUSD(hr) : hr})\n \n \n );\n };\n\n const BarGraph = () => {\n return (\n \n {hours.map((hr, i) => {\n const hrVal = allStats[stat][year].hours[hr];\n\n return bar(hrVal, i);\n })}\n \n );\n };\n\n return (\n \n \n \n Daily View\n \n \n \n );\n };\n const DailyGraph = ({stat}) => {\n const allDays = [\"Sun\", \"Mon\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n const minVal =\n Math.min(...allDays.map((day) => allStats[stat][year].days[day])) * 0.8;\n const maxVal =\n Math.max(...allDays.map((day) => allStats[stat][year].days[day])) -\n minVal;\n\n const bar = (day, i) => {\n return (\n \n \n \n {allDays[i][0]}\n \n \n ({stat === \"revenue\" ? formatToUSD(day) : day})\n \n \n );\n };\n\n const BarGraph = () => {\n return (\n \n {allDays.map((day, i) => {\n const dayVal = allStats[stat][year].days[day];\n return bar(dayVal, i);\n })}\n \n );\n };\n\n return (\n \n \n \n Weekly View\n \n \n \n );\n };\n const MonthlyGraph = ({stat}) => {\n const months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ];\n const monthsLabel = [\n \"J\",\n \"F\",\n \"M\",\n \"A\",\n \"M\",\n \"J\",\n \"J\",\n \"A\",\n \"S\",\n \"O\",\n \"N\",\n \"D\",\n ];\n\n const minVal =\n Math.min(...months.map((month) => allStats[stat][year].months[month])) *\n 0.8;\n const maxVal =\n Math.max(...months.map((month) => allStats[stat][year].months[month])) -\n minVal;\n\n const bar = (month, i) => {\n return (\n \n \n \n {monthsLabel[i]}\n \n \n ({stat === \"revenue\" ? formatToUSD(month) : month})\n \n \n );\n };\n\n const BarGraph = () => {\n return (\n \n {months.map((month, i) => {\n const monthVal = allStats[stat][year].months[month];\n return bar(monthVal, i);\n })}\n \n );\n };\n\n return (\n \n \n \n Monthly View\n \n \n \n );\n };\n\n const MonthlyTable = ({stat}) => {\n const lastYear = years[years.indexOf(year) - 1];\n\n const months = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n ];\n\n const row = (month, i) => {\n const monthVal = allStats[stat][year].months[month];\n let prevYearMonth;\n let diff;\n if (compare) {\n prevYearMonth = allStats[stat][lastYear].months[month];\n diff = monthVal - prevYearMonth;\n }\n return (\n \n \n \n {month}\n \n \n {stat === \"revenue\" ? formatToUSD(monthVal) : monthVal}\n \n 0 ? \"#4caf50\" : \"#f44336\",\n fontWeight: \"500\",\n fontSize: \"0.9rem\",\n }}\n >\n {compare && (\n <>\n {diff > 0 ? \"+\" : \"\"}\n {stat === \"revenue\" ? formatToUSD(diff) : diff}\n >\n )}\n \n \n \n );\n };\n\n const Table = () => {\n return (\n \n {months.map((month, i) => {\n return row(month, i);\n })}\n \n );\n };\n\n return (\n \n \n \n Monthly Table\n \n \n \n );\n };\n\n const Dashboard = ({stats = allStats, title = \"Year to date\"}) => {\n if (compare) {\n lastYearsRevenue = allStats.revenue[lastYear].total;\n revenueChange = Math.round(\n ((allStats.revenue[year].total - lastYearsRevenue) / lastYearsRevenue) *\n 100\n );\n let lastYearsOrders = allStats.count[lastYear].total;\n orderChange = Math.round(\n ((allStats.count[year].total - lastYearsOrders) / lastYearsOrders) * 100\n );\n let lastYearAvg = allStats.averageOrderTotal[lastYear].total;\n avgChange = Math.round(\n ((allStats.averageOrderTotal[year].total - lastYearAvg) / lastYearAvg) *\n 100\n );\n }\n return (\n \n \n {title}\n \n \n \n \n Total Online Revenue \n \n {formatToUSD(stats.revenue[year].total)}\n {compare && (\n 0 ? \"green\" : \"red\",\n }}\n >\n {revenueChange > 0 ? \"+\" : \"\"}\n {revenueChange}%\n \n )}\n \n \n \n \n \n Total Orders \n \n {stats.count[year].total}\n {compare && (\n 0 ? \"green\" : \"red\",\n }}\n >\n {orderChange > 0 ? \"+\" : \"\"}\n {orderChange}%\n \n )}\n \n \n \n\n \n \n Average Order Total \n \n {formatToUSD(stats.averageOrderTotal[year].total)}\n {compare && (\n 0 ? \"green\" : \"red\",\n }}\n >\n {avgChange > 0 ? \"+\" : \"\"}\n {avgChange}%\n \n )}\n \n \n \n \n \n );\n };\n\n if (!loaded) {\n return <> Loading.. >;\n } else {\n return (\n \n \n Order Statistics\n \n \n \n \n \n Year\n \n \n {years.map((year) => (\n {year} \n ))}\n \n \n \n \n Stat\n \n \n Order Counts \n Order Revenues \n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default Graph;\n","import React, {useState, useEffect} from \"react\";\n\nimport {Typography, Box, Switch, Grid} from \"@material-ui/core\";\n\nimport Graph from \"../Utils/Graph\";\n\nimport api from \"../api\";\nfunction Admin() {\n const [log, setLog] = useState(\"Everything is working fine. :)\");\n const [status, setStatus] = useState(\"null\");\n const [localStatus, setLocalStatus] = useState(status);\n const [allStats, setAllStats] = useState({});\n const [loaded, setLoaded] = useState(false);\n\n const getOnlineStatus = async () => {\n const res = await api.get(\"/api/online\");\n setStatus(res.data);\n setLocalStatus(res.data);\n };\n\n const loadStats = async () => {\n const res = await api.get(\"/api/stats\");\n setAllStats(res.data);\n setLoaded(true);\n };\n\n useEffect(() => {\n getOnlineStatus();\n loadStats();\n }, []);\n\n const turnOff = async () => {\n const response = await api.post(\"/api/online/off\");\n if (response.status !== 200) {\n setLog(\"Something went wrong :(\");\n }\n getOnlineStatus();\n setLocalStatus(false);\n };\n const turnOn = async () => {\n const response = await api.post(\"/api/online/on\");\n if (response.status !== 200) {\n setLog(\"Something went wrong :(\");\n }\n getOnlineStatus();\n setLocalStatus(true);\n };\n\n const handleSwitch = async () => {\n if (localStatus) {\n await turnOff();\n } else {\n await turnOn();\n }\n };\n\n // Dashboard & Helpers\n function formatToUSD(number) {\n return new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n }).format(number);\n }\n\n const Dashboard = ({stats = allStats, title = \"Year to date\"}) => {\n return (\n \n \n {title}\n \n \n \n \n Total Online Revenue \n \n {formatToUSD(stats.revenue.all)}\n \n \n \n \n \n Total Orders \n \n {stats.count.all}\n \n \n \n\n \n \n Average Order Total \n \n {formatToUSD(stats.averageOrderTotal.all)}\n \n \n \n \n \n );\n };\n\n if (!loaded) {\n return <> Loading.. >;\n } else {\n return (\n \n \n Welcome, Admin.\n \n \n {log} \n \n\n \n \n Control Panel\n \n \n \n Remote Status: {status ? \"Live\" : \"Offline\"}\n \n \n \n Local Status: \n {localStatus ? \"Live\" : \"Offline\"}\n \n \n \n Off\n \n handleSwitch()}\n color=\"primary\"\n />\n \n On\n \n \n \n \n \n );\n }\n}\n\nexport default Admin;\n","import React from \"react\";\nimport {Route, Switch} from \"react-router-dom\";\n\nimport Home from \"./Pages/Home\";\nimport About from \"./Pages/About\";\nimport Cart from \"./Pages/Cart\";\nimport OrderConfirmation from \"./Pages/OrderConfirmation\";\nimport Menu from \"./Pages/Menu\";\nimport LunchSpecials from \"./MenuPages/LunchSpecials\";\nimport Soups from \"./MenuPages/Soups\";\nimport DinnerCombo from \"./MenuPages/DinnerCombo\";\nimport Appetizers from \"./MenuPages/Appetizers\";\nimport SweetAndSour from \"./MenuPages/SweetAndSour\";\nimport EFY from \"./MenuPages/EggFooYoung\";\nimport FR from \"./MenuPages/FriedRice\";\nimport LoMein from \"./MenuPages/LoMein\";\nimport MeiFun from \"./MenuPages/MeiFun\";\nimport ChowMein from \"./MenuPages/ChowMein\";\nimport Poultry from \"./MenuPages/Poultry\";\nimport Pork from \"./MenuPages/Pork\";\nimport Seafood from \"./MenuPages/Seafood\";\nimport Beef from \"./MenuPages/Beef\";\nimport MuShu from \"./MenuPages/MuShu\";\nimport Vegetable from \"./MenuPages/Vegetable\";\nimport Udon from \"./MenuPages/Udon\";\nimport Chef from \"./MenuPages/Chef\";\nimport Diet from \"./MenuPages/Diet\";\nimport Side from \"./MenuPages/Side\";\n\nimport AxiosTest from \"./AxiosTest\";\nimport MyEmail from \"./Pages/MyEmail\";\nimport Admin from \"./Pages/Admin\";\nimport Graph from \"./Utils/Graph\";\n\nconst Routes = () => {\n return (\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/* menu list */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default Routes;\n","import {createMuiTheme} from \"@material-ui/core/styles\";\n\nconst theme = createMuiTheme({\n typography: {\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Helvetica Neue', acumin-pro, Merriweather, Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',sans-serif\",\n h1: {\n color: \"#B18944\",\n fontWeight: \"bold\",\n fontFamily: \"Hogback\",\n fontSize: \"8.5rem\",\n },\n h2: {\n color: \"#B18944\",\n fontWeight: \"bold\",\n fontFamily: \"Hogback\",\n fontSize: \"7rem\",\n },\n h3: {\n color: \"#B18944\",\n fontWeight: \"bold\",\n fontFamily: \"Hogback\",\n fontSize: \"5.5rem\",\n },\n h4: {\n color: \"#B18944\",\n fontWeight: \"bold\",\n fontFamily: \"Hogback\",\n fontSize: \"3rem\",\n },\n },\n palette: {\n background: {\n default: \"\",\n },\n primary: {\n main: \"#B41E22\",\n },\n secondary: {\n main: \"#B18944\",\n },\n text: {\n secondary: \"#5e5e5e\",\n },\n },\n // add attribute to palette for dark mode: type: \"dark\",\n transitions: {\n // So we have `transition: none;` everywhere\n create: () => \"none\",\n },\n components: {\n // Name of the component\n MuiButton: {\n styleOverrides: {\n // Name of the slot\n root: {\n // Some CSS\n },\n },\n },\n },\n});\n\nexport default theme;\n","// react library\nimport React from \"react\";\nimport {BrowserRouter as Router} from \"react-router-dom\";\n// material-ui library\nimport {makeStyles, ThemeProvider, CssBaseline} from \"@material-ui/core/\";\n\n//helmet & meta tags\nimport {Helmet} from \"react-helmet\";\n\n// self made components\nimport HeaderNav from \"./HeaderNav\";\nimport Routes from \"./Routes\";\nimport theme from \"./Theme\";\nimport \"./App.css\";\n\n//Context Provider\nimport {CartProvider} from \"./CartContext\";\n\n// react google analytics\nimport ReactGA from \"react-ga\";\nconst TRACKING_ID = \"G-9RK4LGZH98\";\nReactGA.initialize(TRACKING_ID);\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n toolbar: theme.mixins.toolbar,\n content: {\n diplay: \"flex\",\n flexFlow: \"column nowrap\",\n justifyContent: \"center\",\n alignContent: \"center\",\n alignItems: \"center\",\n width: \"100%\",\n paddingBottom: theme.spacing(20),\n },\n}));\n\nfunction App() {\n const classes = useStyles();\n\n return (\n \n
\n \n \n \n \n \n \n Menu \n Dinner \n Specials \n Sides \n Appetizers \n China Delight - Forest Hill MD \n {/* google ads */}\n \n {/* */}\n \n \n
\n \n {/* */}\n \n \n \n\n \n
\n \n \n \n \n \n
\n );\n}\n\nexport default App;\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport App from \"./components/App\";\n\nReactDOM.render(\n \n \n ,\n document.getElementById(\"root\")\n);\n"],"sourceRoot":""}