Добавлен атрибут картинки для ингредиентов и удален атрибут английского названия
This commit is contained in:
@@ -111,10 +111,6 @@ export function EditIngredientPage() {
|
||||
variant="outlined" label={"Название"}
|
||||
value={ingredient.name}
|
||||
onChange={(e) => changeIngredientValue("name", e.target.value)}/>
|
||||
<TextField sx={{mr: 1, mb: 2, minWidth: 330}}
|
||||
label="Английское название" variant="outlined"
|
||||
value={ingredient.enName}
|
||||
onChange={(e) => changeIngredientValue("enName", e.target.value)}/>
|
||||
</Box>
|
||||
|
||||
<Box height={70} mt={1} ml={1}>
|
||||
|
||||
@@ -39,6 +39,7 @@ export function UserPopover({anchorEl, onClose, open}) {
|
||||
} catch (err) {
|
||||
logger.error('Sign out error', err);
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
}, [checkSession, location]);
|
||||
|
||||
return (
|
||||
@@ -85,7 +86,7 @@ export function UserPopover({anchorEl, onClose, open}) {
|
||||
}
|
||||
|
||||
function userDescriptor(user) {
|
||||
if(!user) {
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
if (!user.name) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import {isNavItemActive} from "../../lib/isNavItemActive";
|
||||
import {isNavItemActive} from "./isNavItemActive";
|
||||
import {navIcons} from "../core/navIcons";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import {useCallback, useEffect} from 'react';
|
||||
import {logger} from "../lib/DefaultLogger";
|
||||
import {tokenUtil} from "../lib/TokenUtil";
|
||||
import {tokenUtil} from "../lib/clients/TokenUtil";
|
||||
|
||||
export const AuthContext = React.createContext(undefined);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from "react";
|
||||
import {createContext, useCallback, useEffect, useState} from "react";
|
||||
import {logger} from "../lib/DefaultLogger";
|
||||
import {userClient} from "../lib/clients/UserClient";
|
||||
import {tokenUtil} from "../lib/TokenUtil";
|
||||
import {tokenUtil} from "../lib/clients/TokenUtil";
|
||||
|
||||
export const UserContext = createContext(undefined);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {decodeToken, isExpired} from "react-jwt";
|
||||
import {requests} from "../requests";
|
||||
import {requests} from "../../requests";
|
||||
import axios from "axios";
|
||||
|
||||
class TokenUtil {
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from "axios";
|
||||
import {tokenUtil} from "../TokenUtil";
|
||||
import {tokenUtil} from "./TokenUtil";
|
||||
|
||||
const host = "localhost:8081"; //дебаг вместе с беком
|
||||
const host = "localhost:8080"; //дебаг вместе с беком
|
||||
// const host = "192.168.1.100:8091"; //дебаг фронта
|
||||
// const host = "bar.kayashov.keenetic.pro"; //прод
|
||||
export const api = () => {
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
export const sliceData = (rows, page, elementOnPage) => {
|
||||
if (!rows || rows.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const maxPage = Math.ceil(rows.length / elementOnPage);
|
||||
// const start = (page - 1) * elementOnPage;
|
||||
const start = 0;
|
||||
console.log(maxPage, start)
|
||||
let end;
|
||||
if (page === maxPage) {
|
||||
end = rows.length;
|
||||
} else {
|
||||
end = start + elementOnPage;
|
||||
}
|
||||
|
||||
return rows.slice(start, end);
|
||||
}
|
||||
@@ -48,10 +48,5 @@ export const requests = {
|
||||
type: routes.ingredient + "/type",
|
||||
crud: routes.ingredient,
|
||||
},
|
||||
// receipt: {
|
||||
// receipts: routes.bar + "receipt?id=",
|
||||
//
|
||||
// },
|
||||
|
||||
unit: routes.unit + "/units"
|
||||
}
|
||||
Reference in New Issue
Block a user