gthdst ghfdrb

This commit is contained in:
Kayashov.SM
2025-04-28 18:39:15 +04:00
parent 3e3f33bebb
commit 56ffb21b91
6 changed files with 12 additions and 67 deletions

View File

@@ -34,16 +34,7 @@ function renderRating(handleChangeRating, row) {
)
}
export function Cocktail({row, handleFavourite, handleChangeRating, handleSelect, editMenuBlock}) {
const {createAlert, createError} = useAlert();
const {session, user} = useUser();
function pay(cocktailId) {
api().post(`${requests.bar.pay}cocktail=${cocktailId}`)
.then(() => createAlert("Ожидайте свой заказ", "success"))
.catch(() => createError("Ошибка во время создания заказа"))
}
export function Cocktail({row, handleFavourite, handleChangeRating, handleSelect}) {
return (
<Grid item sx={{pr: 2}}>
<CocktailItemStyled>
@@ -71,6 +62,9 @@ export function Cocktail({row, handleFavourite, handleChangeRating, handleSelect
<Typography variant="h5" minHeight={'50px'} mt={2}>{row.name} </Typography>
<CocktailDescription row={row}/>
</CardContent>
<CardActions>
<Button variant={'contained'} color={"error"}>Удалить</Button>
</CardActions>
</Box>
</CocktailItemStyled>
</Grid>

View File

@@ -15,22 +15,10 @@ import {useAlert} from "../../hooks/useAlert";
import {api} from "../../lib/clients/api";
import {sortList} from "./sortingList";
const inMenuFilter = [
{
id: true,
name: "Есть в меню"
},
{
id: false,
name: "Нет в меню"
}
]
export function FilterBlock({filter, handleFilterChange, handleClearFilter, barmen}) {
const {createError} = useAlert();
const [glass, setGlass] = useState([]);
const [category, setCategory] = useState([]);
const [tags, setTags] = useState([])
const alcohol = [
{
name: "Алкогольный",
@@ -70,10 +58,6 @@ export function FilterBlock({filter, handleFilterChange, handleClearFilter, barm
api().get(requests.bar.glass)
.then((r) => setGlass(r.data))
.catch(() => createError("Ошибка получения посуды"))
api().get(requests.bar.tags)
.then((r) => setTags(r.data))
.catch(() => createError("Ошибка получения тегов"))
// eslint-disable-next-line
}, []);
@@ -141,9 +125,6 @@ export function FilterBlock({filter, handleFilterChange, handleClearFilter, barm
{/*Фильтр по посуде*/}
{glass.length > 0 && (<CheckMarks rows={glass} name={"Подача"} handleChange={handleFilterChange}
filterValue={filter.glass} filterName={"glass"}/>)}
{/*Фильтр по тегам*/}
{tags.length > 0 && (<CheckMarks rows={tags} name={"Теги"} handleChange={handleFilterChange}
filterValue={filter.tags} filterName={"tags"}/>)}
{/*Фильтр по нехватке ингредиентов*/}
{(barmen && filter.all) && (<CheckMarks rows={ingredientCount} name={"Не хватает ингредиентов"}
handleChange={handleFilterChange}