Analytics added / NewRestaurant.js added
This commit is contained in:
41
src/components/Output/DishesCategory.js
Normal file
41
src/components/Output/DishesCategory.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import React from "react";
|
||||
import Accordion from "@material-ui/core/Accordion";
|
||||
import AccordionSummary from "@material-ui/core/AccordionSummary";
|
||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||
import List from "@material-ui/core/List";
|
||||
import ListItem from "@material-ui/core/ListItem";
|
||||
import CardDish from "./CardDish";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
backgroundColor: "#262626",
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
expandIcon: {
|
||||
color: "#bbbbbb",
|
||||
},
|
||||
}));
|
||||
|
||||
export default function DishesCategory(props) {
|
||||
const classes = useStyles();
|
||||
const dishes = props.dishes;
|
||||
const dishCards = dishes.map((dish) => {
|
||||
return (
|
||||
<ListItem key={dish._id}>
|
||||
<CardDish dish={dish}></CardDish>
|
||||
</ListItem>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<Accordion className={classes.root}>
|
||||
<AccordionSummary
|
||||
expandIcon={<ExpandMoreIcon className={classes.expandIcon} />}
|
||||
>
|
||||
<h4>{props.name}</h4>
|
||||
</AccordionSummary>
|
||||
<List>{dishCards}</List>
|
||||
</Accordion>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user