Revert "use secondary colors in date pickers"

This reverts commit d273a99f83.
This accidentally increased the density by making my global CSS
overrides ineffective. I'm struggling to achieve both, and I'd rather
have my desired sizing.
This commit is contained in:
Scott Lamb 2021-03-17 11:10:39 -07:00
parent 76ef6e58b8
commit 85da157cf4

View File

@ -9,11 +9,7 @@ import { zonedTimeToUtc } from "date-fns-tz";
import { addDays, addMilliseconds, differenceInMilliseconds } from "date-fns";
import startOfDay from "date-fns/startOfDay";
import Card from "@material-ui/core/Card";
import {
ThemeProvider,
createMuiTheme,
useTheme,
} from "@material-ui/core/styles";
import { useTheme } from "@material-ui/core/styles";
import TextField from "@material-ui/core/TextField";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import FormLabel from "@material-ui/core/FormLabel";
@ -217,17 +213,6 @@ const TimerangeSelector = ({
setRange90k,
}: Props) => {
const theme = useTheme();
// StaticDatePicker doesn't have an obvious way to use the secondary theme
// colors, so make a new theme with swapped colors.
const swappedTheme = createMuiTheme({
...theme,
palette: {
...theme.palette,
primary: theme.palette.secondary,
secondary: theme.palette.primary,
},
});
const [days, updateDays] = React.useReducer(daysStateReducer, {
allowed: null,
rangeMillis: null,
@ -275,7 +260,6 @@ const TimerangeSelector = ({
<Card sx={{ padding: theme.spacing(1) }}>
<div>
<FormLabel component="legend">From</FormLabel>
<ThemeProvider theme={swappedTheme}>
<StaticDatePicker
displayStaticWrapperAs="desktop"
value={startDate}
@ -289,11 +273,8 @@ const TimerangeSelector = ({
onChange={(d: Date | null) => {
updateDays({ op: "set-start-day", newStartDate: d });
}}
renderInput={(params) => (
<TextField {...params} variant="outlined" />
)}
renderInput={(params) => <TextField {...params} variant="outlined" />}
/>
</ThemeProvider>
<MyTimePicker
value={startTime}
onChange={(newValue) => {
@ -328,7 +309,6 @@ const TimerangeSelector = ({
/>
</RadioGroup>
<Collapse in={days.endType === "other-day"}>
<ThemeProvider theme={swappedTheme}>
<StaticDatePicker
displayStaticWrapperAs="desktop"
value={endDate}
@ -346,7 +326,6 @@ const TimerangeSelector = ({
<TextField {...params} variant="outlined" />
)}
/>
</ThemeProvider>
</Collapse>
<MyTimePicker
value={endTime}