Skip to content

Commit 43f1204

Browse files
author
mcmcphillips
committedOct 11, 2023
fix input label
1 parent 568d655 commit 43f1204

File tree

1 file changed

+60
-65
lines changed

1 file changed

+60
-65
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,80 @@
11
import React from "react";
22
import PropTypes from "prop-types";
3-
import { InputLabel } from "@madie/madie-design-system/dist/react";
3+
import InputLabel from "../InputLabel";
44
import { DateTimePicker } from "@mui/x-date-pickers/DateTimePicker";
55
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
66
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
7-
import dayjs from "dayjs";
8-
import utc from "dayjs/plugin/utc";
7+
import dayjs from 'dayjs'
8+
import utc from 'dayjs/plugin/utc';
99

1010
import { FormControl } from "@mui/material";
1111
import { kebabCase } from "lodash";
1212

13-
dayjs.extend(utc);
13+
dayjs.extend(utc)
1414
export const dateTimeTextFieldStyle = {
15-
width: "240px",
16-
borderRadius: "3px",
17-
height: 40,
18-
border: "1px solid #B0B0B0",
19-
marginTop: "8px",
20-
"& .MuiOutlinedInput-notchedOutline": {
15+
width: "240px",
2116
borderRadius: "3px",
22-
"& legend": {
23-
width: 0,
17+
height: 40,
18+
border: "1px solid #B0B0B0",
19+
marginTop: "8px",
20+
"& .MuiOutlinedInput-notchedOutline": {
21+
borderRadius: "3px",
22+
"& legend": {
23+
width: 0,
24+
},
2425
},
25-
},
26-
"& .MuiOutlinedInput-root": {
27-
"&&": {
28-
borderRadius: "3px",
26+
"& .MuiOutlinedInput-root": {
27+
"&&": {
28+
borderRadius: "3px",
29+
},
2930
},
30-
},
31-
"& .MuiInputBase-input": {
32-
color: "#333333",
33-
fontFamily: "Rubik",
34-
fontSize: 14,
35-
borderRadius: "3px",
36-
padding: "9px",
37-
Width: "240px",
38-
"&::placeholder": {
39-
opacity: 1,
40-
color: "#717171",
41-
fontFamily: "Rubik",
42-
fontSize: 14,
31+
"& .MuiInputBase-input": {
32+
color: "#333333",
33+
fontFamily: "Rubik",
34+
fontSize: 14,
35+
borderRadius: "3px",
36+
padding: "9px",
37+
Width: "240px",
38+
"&::placeholder": {
39+
opacity: 1,
40+
color: "#717171",
41+
fontFamily: "Rubik",
42+
fontSize: 14,
43+
},
4344
},
44-
},
4545
};
4646

47-
const DateTimeField = ({
48-
label,
49-
dateTimeValue,
50-
handleDateTimeChange,
51-
disabled,
52-
}) => {
53-
return (
54-
<FormControl>
55-
<LocalizationProvider dateAdapter={AdapterDayjs}>
56-
<InputLabel
57-
style={{ marginBottom: 0, height: 16 }}
58-
data-testId={`${kebabCase(label)}`}
59-
>
60-
{`${label}`}
61-
</InputLabel>
62-
<DateTimePicker
63-
value={dateTimeValue ? dateTimeValue : null}
64-
onChange={handleDateTimeChange}
65-
views={["year", "day", "hours", "minutes"]}
66-
disabled={disabled}
67-
slotProps={{
68-
textField: {
69-
id: "dateTime",
70-
sx: dateTimeTextFieldStyle,
71-
},
72-
}}
73-
/>
74-
</LocalizationProvider>
75-
</FormControl>
76-
);
47+
const DateTimeField = ({ label, dateTimeValue, handleDateTimeChange,disabled }) => {
48+
return (
49+
<FormControl>
50+
<LocalizationProvider dateAdapter={AdapterDayjs}>
51+
<InputLabel
52+
style={{ marginBottom: 0, height: 16 }}
53+
data-testId={`${kebabCase(label)}`}
54+
>
55+
{`${label}`}
56+
</InputLabel>
57+
<DateTimePicker
58+
value={dateTimeValue ? dateTimeValue : null}
59+
onChange={handleDateTimeChange}
60+
views={["year", "day", "hours", "minutes"]}
61+
disabled={disabled}
62+
slotProps={{
63+
textField: {
64+
id: "dateTime",
65+
sx: dateTimeTextFieldStyle,
66+
},
67+
}}
68+
/>
69+
</LocalizationProvider>
70+
</FormControl>
71+
);
7772
};
7873
DateTimeField.propTypes = {
79-
dateTimeValue: PropTypes.object,
80-
handleDateTimeChange: PropTypes.func.isRequired,
81-
label: PropTypes.string.isRequired,
82-
disabled: PropTypes.bool,
74+
dateTimeValue: PropTypes.object,
75+
handleDateTimeChange: PropTypes.func.isRequired,
76+
label: PropTypes.string.isRequired,
77+
disabled:PropTypes.bool
8378
};
8479

85-
export default DateTimeField;
80+
export default DateTimeField;

0 commit comments

Comments
 (0)
Please sign in to comment.