-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate classes naming #1950
Changes from all commits
85ae0c0
0568a89
554d34e
d75bf55
2b4274d
1d2bf35
737f343
73a144d
33f4f12
e7b8b48
1720a0b
3e2cd6c
1e72edf
27c5fec
dc073e3
145bfa8
62bed3a
e7d7079
3ce0f32
dc95144
82f6614
3246564
634d638
850a8da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import React, { useState } from 'react'; | ||
import isWeekend from 'date-fns/isWeekend'; | ||
import TextField from '@material-ui/core/TextField'; | ||
import lightBlue from '@material-ui/core/colors/lightBlue'; | ||
import { createMuiTheme, ThemeProvider } from '@material-ui/core'; | ||
|
@@ -7,25 +8,25 @@ import { DatePicker, DatePickerProps } from '@material-ui/pickers'; | |
const materialTheme = createMuiTheme({ | ||
overrides: { | ||
MuiPickersToolbar: { | ||
toolbar: { | ||
root: { | ||
backgroundColor: lightBlue.A200, | ||
}, | ||
}, | ||
MuiPickersCalendarHeader: { | ||
switchHeader: { | ||
root: { | ||
// backgroundColor: lightBlue.A200, | ||
// color: 'white', | ||
}, | ||
}, | ||
MuiPickersDay: { | ||
day: { | ||
root: { | ||
color: lightBlue.A700, | ||
}, | ||
daySelected: { | ||
backgroundColor: lightBlue['400'], | ||
}, | ||
dayDisabled: { | ||
color: lightBlue['100'], | ||
'&$disabled': { | ||
color: lightBlue['100'], | ||
}, | ||
'&$selected': { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding the change of pseudo classes, I think that we could have handled in a different pull request, keeping our focus on a single topic at the time :) |
||
backgroundColor: lightBlue['400'], | ||
}, | ||
}, | ||
today: { | ||
color: lightBlue['900'], | ||
|
@@ -45,12 +46,12 @@ function CssOverrides() { | |
return ( | ||
<ThemeProvider theme={materialTheme}> | ||
<DatePicker | ||
renderInput={props => <TextField {...props} />} | ||
label="Light blue picker" | ||
value={selectedDate} | ||
onChange={date => handleDateChange(date)} | ||
renderInput={props => <TextField {...props} />} | ||
// @ts-ignore | ||
shouldDisableDate={day => day && day.getDay() === 0} | ||
shouldDisableDate={isWeekend} | ||
/> | ||
</ThemeProvider> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import { IUtils } from '@date-io/core/IUtils'; | ||
import { Day, DayProps } from '@material-ui/pickers'; | ||
import { PickersDay, PickersDayProps } from '@material-ui/pickers'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect! |
||
|
||
export const createRegressionDay = (utils: IUtils<any>) => ( | ||
day: any, | ||
selectedDate: any, | ||
dayProps: DayProps | ||
dayProps: PickersDayProps | ||
) => { | ||
return <Day {...dayProps} data-day={utils.formatByString(day, 'dd/MM/yyyy')} />; | ||
return <PickersDay {...dayProps} data-day={utils.formatByString(day, 'dd/MM/yyyy')} />; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, look like
eslint-plugin-pretty-imports
comes with a new cost I didn't see coming (first one is that it requires running eslint --fix): it creates harder review and git diff: it's moving code around.