update
This commit is contained in:
@@ -3,7 +3,6 @@ import ListItemIcon from "@material-ui/core/ListItemIcon";
|
||||
import ListItemText from "@material-ui/core/ListItemText";
|
||||
import ListItem from "@material-ui/core/ListItem";
|
||||
import FastfoodIcon from "@material-ui/icons/Fastfood";
|
||||
import Badge from "@material-ui/core/Badge";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
@@ -25,20 +24,6 @@ const useStyles = makeStyles((theme) => ({
|
||||
|
||||
export default function ListItemRestaurant(props) {
|
||||
const styles = useStyles();
|
||||
const badgeData = {
|
||||
color: "",
|
||||
secondaryText: "",
|
||||
};
|
||||
const badgeInit = () => {
|
||||
if (!props.subscriptionActive || props.subscriptionActive === false) {
|
||||
badgeData.color = "error";
|
||||
badgeData.secondaryText = "Aktywuj sybskrypcję";
|
||||
} else {
|
||||
badgeData.color = "primary";
|
||||
badgeData.secondaryText = "Subskrypcja aktywna";
|
||||
}
|
||||
};
|
||||
badgeInit();
|
||||
|
||||
return (
|
||||
<ListItem
|
||||
@@ -46,19 +31,11 @@ export default function ListItemRestaurant(props) {
|
||||
onClick={() => props.onClick(`/editRestaurant/${props.id}`)}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<Badge
|
||||
className={styles.root}
|
||||
anchorOrigin={{ vertical: "top", horizontal: "left" }}
|
||||
variant="dot"
|
||||
color={badgeData.color}
|
||||
>
|
||||
<FastfoodIcon />
|
||||
</Badge>
|
||||
<FastfoodIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText
|
||||
className={styles.secondary}
|
||||
primary={props.name}
|
||||
secondary={badgeData.secondaryText}
|
||||
/>
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user