1
1
import React from "react" ;
2
+ import PropTypes from "prop-types" ;
2
3
import { makeStyles } from "@material-ui/core/styles" ;
3
4
import {
4
5
Grid ,
5
6
MenuItem ,
6
7
FormControl ,
8
+ IconButton ,
7
9
InputLabel ,
8
10
Select ,
9
11
TextField ,
10
12
} from "@material-ui/core" ;
11
13
import { CancelIconButton } from "./Buttons" ;
14
+ import { WrapText } from "@material-ui/icons" ;
12
15
13
16
const useStyles = makeStyles ( ( theme ) => ( {
14
17
row : {
@@ -43,11 +46,11 @@ const intervals = [
43
46
44
47
function OpenTimeInput ( props ) {
45
48
const classes = useStyles ( ) ;
46
- const { values, onChange, removeInput } = props ;
49
+ const { values, onChange, removeInput, copyInput } = props ;
47
50
48
51
return (
49
52
< Grid container spacing = { 1 } className = { classes . row } >
50
- < Grid item xs = { 12 } sm = { 3 } >
53
+ < Grid item xs = { 12 } sm = { 2 } >
51
54
< FormControl
52
55
variant = "outlined"
53
56
fullWidth
@@ -94,7 +97,7 @@ function OpenTimeInput(props) {
94
97
</ Select >
95
98
</ FormControl >
96
99
</ Grid >
97
- < Grid item xs = { 12 } sm = { 3 } >
100
+ < Grid item xs = { 12 } sm = { 2 } >
98
101
< TextField
99
102
type = "time"
100
103
name = "open"
@@ -109,7 +112,7 @@ function OpenTimeInput(props) {
109
112
< Grid
110
113
item
111
114
xs = { 10 }
112
- sm = { 3 }
115
+ sm = { 2 }
113
116
styles = { { display : "flex" , flexDirection : "column" } }
114
117
>
115
118
< TextField
@@ -126,8 +129,25 @@ function OpenTimeInput(props) {
126
129
< Grid item xs = { 2 } sm = { 1 } >
127
130
< CancelIconButton onClick = { removeInput } />
128
131
</ Grid >
132
+ < Grid item xs = { 2 } sm = { 1 } >
133
+ < IconButton
134
+ variant = "contained"
135
+ color = "default"
136
+ aria-label = "cancel"
137
+ onClick = { copyInput }
138
+ >
139
+ < WrapText />
140
+ </ IconButton >
141
+ </ Grid >
129
142
</ Grid >
130
143
) ;
131
144
}
132
145
146
+ OpenTimeInput . propTypes = {
147
+ values : PropTypes . object ,
148
+ onChange : PropTypes . func ,
149
+ removeInput : PropTypes . func ,
150
+ copyInput : PropTypes . func ,
151
+ } ;
152
+
133
153
export default OpenTimeInput ;
0 commit comments