forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add variant="static" * More variant="static" examples
- Loading branch information
1 parent
973dc27
commit 15a44a0
Showing
12 changed files
with
101 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useState } from 'react'; | ||
import { DatePicker } from '@material-ui/pickers'; | ||
|
||
const StaticDatePicker = () => { | ||
const [date, changeDate] = useState(new Date()); | ||
|
||
return ( | ||
<> | ||
<DatePicker autoOk variant="static" openTo="year" value={date} onChange={changeDate} /> | ||
<DatePicker autoOk variant="static" openTo="date" value={date} onChange={changeDate} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default StaticDatePicker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useState } from 'react'; | ||
import { TimePicker } from '@material-ui/pickers'; | ||
|
||
const StaticTimePicker = () => { | ||
const [date, changeDate] = useState(new Date()); | ||
|
||
return ( | ||
<> | ||
<TimePicker autoOk variant="static" openTo="hours" value={date} onChange={changeDate} /> | ||
<TimePicker autoOk variant="static" openTo="minutes" value={date} onChange={changeDate} /> | ||
</> | ||
); | ||
}; | ||
|
||
export default StaticTimePicker; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,5 +111,3 @@ ModalWrapper.defaultProps = { | |
clearable: false, | ||
showTodayButton: false, | ||
}; | ||
|
||
export default ModalWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import * as React from 'react'; | ||
import { makeStyles } from '@material-ui/core'; | ||
import { DIALOG_WIDTH } from '../constants/dimensions'; | ||
|
||
const useStyles = makeStyles( | ||
theme => ({ | ||
staticWrapperRoot: { | ||
overflow: 'hidden', | ||
width: DIALOG_WIDTH, | ||
display: 'flex', | ||
flexDirection: 'column', | ||
backgroundColor: theme.palette.background.paper, | ||
}, | ||
}), | ||
{ name: 'MuiPickersStaticWrapper' } | ||
); | ||
|
||
export const StaticWrapper: React.FC = ({ children }) => { | ||
const classes = useStyles(); | ||
|
||
return <div className={classes.staticWrapperRoot} children={children} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters