Skip to content

Commit

Permalink
Federation dark theme improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rkfg committed Nov 4, 2024
1 parent 06030e1 commit 537cd34
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/resources/destinations.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { get } from "lodash";
import { MouseEvent } from "react";

import AutorenewIcon from "@mui/icons-material/Autorenew";
import DestinationsIcon from "@mui/icons-material/CloudQueue";
import FolderSharedIcon from "@mui/icons-material/FolderShared";
import ViewListIcon from "@mui/icons-material/ViewList";
import { blue } from "@mui/material/colors";
import {
Button,
Datagrid,
Expand Down Expand Up @@ -31,13 +33,10 @@ import {
} from "react-admin";

import { DATE_FORMAT } from "../components/date";
import { lighten, useTheme } from '@mui/material';

const DestinationPagination = () => <Pagination rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />;

const destinationRowSx = (record: RaRecord) => ({
backgroundColor: record.retry_last_ts > 0 ? "#ffcccc" : "white",
});

const destinationFilters = [<SearchInput source="destination" alwaysOn />];

export const DestinationReconnectButton = () => {
Expand Down Expand Up @@ -96,12 +95,22 @@ const DestinationTitle = () => {
const RetryDateField = (props: DateFieldProps) => {
const record = useRecordContext(props);
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) => {
const { palette: { error, mode }, } = useTheme();
const destinationRowSx = (record: RaRecord) => ({
backgroundColor: record.retry_last_ts > 0 ? lighten(error[mode], 0.5) : undefined,
"& > td": mode === 'dark' ? {
color: record.retry_last_ts > 0 ? "black" : "white",
"& > button": {
color: blue[700],
},
} : undefined,
});
return (
<List
{...props}
Expand Down

0 comments on commit 537cd34

Please sign in to comment.