removed mui v4
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
import RouteEditView from "./route-edit";
|
||||
import RouteListView from "./route-list";
|
||||
|
||||
export default { RouteEditView, RouteListView };
|
||||
@@ -4,12 +4,12 @@ import {LocaleContext} from "shared/locale";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
TextField,
|
||||
CircularProgress, styled,
|
||||
} from "@material-ui/core";
|
||||
} from "@mui/material";
|
||||
import * as React from "react";
|
||||
import RouteForm from "./route-form";
|
||||
import {KeyboardArrowLeft, Save} from "@material-ui/icons";
|
||||
import {TextField} from "@mui/material";
|
||||
import {KeyboardArrowLeft, Save} from "@mui/icons-material";
|
||||
|
||||
const ButtonBar = styled(Box)((props) => ({
|
||||
"& > button": {
|
||||
@@ -74,7 +74,7 @@ export default function RouteEditView(props) {
|
||||
setFetchRoute(false);
|
||||
api.getRoute(routeId).then((res) => {
|
||||
if (!res.success) {
|
||||
showDialog(res.msg, L("Error fetching route"));
|
||||
showDialog(res.msg, L("routes.fetch_route_error"));
|
||||
navigate("/admin/routes");
|
||||
} else {
|
||||
setRoute(res.route);
|
||||
@@ -93,7 +93,7 @@ export default function RouteEditView(props) {
|
||||
if (res.success) {
|
||||
navigate("/admin/routes/" + res.routeId);
|
||||
} else {
|
||||
showDialog(res.msg, L("Error saving route"));
|
||||
showDialog(res.msg, L("routes.save_route_error"));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -101,7 +101,7 @@ export default function RouteEditView(props) {
|
||||
api.updateRoute(...args).then(res => {
|
||||
setSaving(false);
|
||||
if (!res.success) {
|
||||
showDialog(res.msg, L("Error saving route"));
|
||||
showDialog(res.msg, L("routes.save_route_error"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {Box, Checkbox, FormControl, FormControlLabel, Select, styled, TextField} from "@material-ui/core";
|
||||
import {Box, Checkbox, FormControl, FormControlLabel, Select, styled, TextField} from "@mui/material";
|
||||
import * as React from "react";
|
||||
import {useCallback, useContext, useEffect, useRef} from "react";
|
||||
import {LocaleContext} from "shared/locale";
|
||||
import {CheckCircle, ErrorRounded} from "@material-ui/icons";
|
||||
import {CheckCircle, ErrorRounded} from "@mui/icons-material";
|
||||
|
||||
const RouteFormControl = styled(FormControl)((props) => ({
|
||||
"& > label": {
|
||||
|
||||
@@ -8,11 +8,12 @@ import {
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
IconButton, Button, Checkbox
|
||||
} from "@material-ui/core";
|
||||
Button,
|
||||
IconButton, Checkbox
|
||||
} from "@mui/material";
|
||||
import {useCallback, useContext, useEffect, useState} from "react";
|
||||
import {LocaleContext} from "shared/locale";
|
||||
import {Add, Cached, Delete, Edit, Refresh} from "@material-ui/icons";
|
||||
import {Add, Cached, Delete, Edit, Refresh} from "@mui/icons-material";
|
||||
import Dialog from "shared/elements/dialog";
|
||||
|
||||
const RouteTableRow = styled(TableRow)((props) => ({
|
||||
@@ -136,15 +137,16 @@ export default function RouteListView(props) {
|
||||
<div className={"col-6"} />
|
||||
<div className={"col-6 text-right"}>
|
||||
<div className={"form-group"}>
|
||||
<Button variant={"outlined"} color={"primary"} className={"m-1"} startIcon={<Refresh />} onClick={() => onFetchRoutes(true)}>
|
||||
<Button variant={"outlined"} color={"primary"} className={"m-1"} size={"small"}
|
||||
startIcon={<Refresh />} onClick={() => onFetchRoutes(true)}>
|
||||
{L("general.reload")}
|
||||
</Button>
|
||||
<Button variant={"outlined"} className={"m-1"} startIcon={<Add />}
|
||||
<Button variant={"outlined"} className={"m-1"} startIcon={<Add />} size={"small"}
|
||||
disabled={!props.api.hasPermission("routes/add")}
|
||||
onClick={() => navigate("/admin/routes/new")} >
|
||||
{L("general.add")}
|
||||
</Button>
|
||||
<Button variant={"outlined"} className={"m-1"} startIcon={<Cached />}
|
||||
<Button variant={"outlined"} className={"m-1"} startIcon={<Cached />} size={"small"}
|
||||
disabled={!props.api.hasPermission("routes/generateCache") || isGeneratingCache}
|
||||
onClick={onRegenerateCache} >
|
||||
{isGeneratingCache ? L("routes.regenerating_cache") + "…" : L("routes.regenerate_cache")}
|
||||
|
||||
Reference in New Issue
Block a user