mirror of
https://github.com/Awesome-Technologies/synapse-admin.git
synced 2024-10-23 03:05:50 +03:00
Federation dark theme improvements
This commit is contained in:
parent
06030e158e
commit
307490443b
1 changed files with 20 additions and 5 deletions
|
@ -1,9 +1,11 @@
|
||||||
|
import { get } from "lodash";
|
||||||
import { MouseEvent } from "react";
|
import { MouseEvent } from "react";
|
||||||
|
|
||||||
import AutorenewIcon from "@mui/icons-material/Autorenew";
|
import AutorenewIcon from "@mui/icons-material/Autorenew";
|
||||||
import DestinationsIcon from "@mui/icons-material/CloudQueue";
|
import DestinationsIcon from "@mui/icons-material/CloudQueue";
|
||||||
import FolderSharedIcon from "@mui/icons-material/FolderShared";
|
import FolderSharedIcon from "@mui/icons-material/FolderShared";
|
||||||
import ViewListIcon from "@mui/icons-material/ViewList";
|
import ViewListIcon from "@mui/icons-material/ViewList";
|
||||||
|
import { blue } from "@mui/material/colors";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Datagrid,
|
Datagrid,
|
||||||
|
@ -27,6 +29,7 @@ import {
|
||||||
useNotify,
|
useNotify,
|
||||||
useRefresh,
|
useRefresh,
|
||||||
useTranslate,
|
useTranslate,
|
||||||
|
useTheme,
|
||||||
DateFieldProps,
|
DateFieldProps,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
|
|
||||||
|
@ -34,8 +37,18 @@ import { DATE_FORMAT } from "../components/date";
|
||||||
|
|
||||||
const DestinationPagination = () => <Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />;
|
const DestinationPagination = () => <Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />;
|
||||||
|
|
||||||
const destinationRowSx = (record: RaRecord) => ({
|
const destinationRowSxLight = (record: RaRecord) => ({
|
||||||
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : "white",
|
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
const destinationRowSxDark = (record: RaRecord) => ({
|
||||||
|
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : undefined,
|
||||||
|
"& > td": {
|
||||||
|
color: record.retry_last_ts > 0 ? "black" : "white",
|
||||||
|
"& > button": {
|
||||||
|
color: blue[600],
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const destinationFilters = [<SearchInput source="destination" alwaysOn />];
|
const destinationFilters = [<SearchInput source="destination" alwaysOn />];
|
||||||
|
@ -96,12 +109,14 @@ const DestinationTitle = () => {
|
||||||
const RetryDateField = (props: DateFieldProps) => {
|
const RetryDateField = (props: DateFieldProps) => {
|
||||||
const record = useRecordContext(props);
|
const record = useRecordContext(props);
|
||||||
if (props.source && get(record, props.source) === 0) {
|
if (props.source && get(record, props.source) === 0) {
|
||||||
return <DateField {...props} record={{...record, [props.source]: null}} />
|
return <DateField {...props} record={{ ...record, [props.source]: null }} />;
|
||||||
}
|
}
|
||||||
return <DateField {...props} />
|
return <DateField {...props} />;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const DestinationList = (props: ListProps) => {
|
export const DestinationList = (props: ListProps) => {
|
||||||
|
const [theme] = useTheme();
|
||||||
|
const destinationRowSx = theme === "light" ? destinationRowSxLight : destinationRowSxDark;
|
||||||
return (
|
return (
|
||||||
<List
|
<List
|
||||||
{...props}
|
{...props}
|
||||||
|
|
Loading…
Reference in a new issue