@@ -6,7 +6,7 @@ import { LocalizationProvider } from '@mui/x-date-pickers';
6
6
import { Button , ButtonStretch , ButtonVariant } from '../button' ;
7
7
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' ;
8
8
import theme from '../../../theme' ;
9
- import PresetsContent , { PresetType } from './Presets' ;
9
+ import PresetsContent , { PresetType } from './Presets' ;
10
10
import { SearchForm } from './SearchForm' ;
11
11
12
12
export interface DateManagerProps {
@@ -17,8 +17,8 @@ export interface DateManagerProps {
17
17
}
18
18
19
19
const formattedDate = (
20
- date : string | number | dayjs . Dayjs | Date | null | undefined ,
21
- hour : string | number | dayjs . Dayjs | Date | null | undefined
20
+ date : string | number | dayjs . Dayjs | Date | null | undefined ,
21
+ hour : string | number | dayjs . Dayjs | Date | null | undefined
22
22
) => {
23
23
return `${ dayjs ( date ) . format ( 'YYYY-MM-DD' ) } ${ dayjs ( hour ) . format ( 'HH:mm:ss' ) } ` ;
24
24
} ;
@@ -43,59 +43,59 @@ export const DateManager = ({ presets, addClickedHandler, close, loading }: Date
43
43
} , [ hour , date ] ) ;
44
44
45
45
return (
46
- < LocalizationProvider dateAdapter = { AdapterDayjs } adapterLocale = { 'en-gb' } >
47
- < ThemeProvider theme = { theme } >
48
- < Box width = { '530px' } height = { '100%' } color = { '#172D32' } px = { 1 } >
49
- < Typography component = { 'div' } p = { 1 } variant = { 'mediumBold' } >
50
- Compare to previous version
51
- </ Typography >
52
- < Divider sx = { { backgroundColor : '#F8FAFC' } } />
46
+ < LocalizationProvider dateAdapter = { AdapterDayjs } adapterLocale = { 'en-gb' } >
47
+ < ThemeProvider theme = { theme } >
48
+ < Box width = { '530px' } height = { '100%' } color = { '#172D32' } px = { 1 } >
49
+ < Typography component = { 'div' } p = { 1 } variant = { 'mediumBold' } >
50
+ Compare to previous version
51
+ </ Typography >
52
+ < Divider sx = { { backgroundColor : '#F8FAFC' } } />
53
53
54
- < Box display = { 'flex' } >
55
- < SearchForm
56
- setErrorDate = { setErrorDate }
57
- setDisplayName = { setDisplayName }
58
- setDisplayNameTouched = { setDisplayNameTouched }
59
- setHour = { setHour }
60
- hour = { hour }
61
- setDate = { setDate }
62
- date = { date }
63
- displayName = { displayName }
64
- />
54
+ < Box display = { 'flex' } >
55
+ < SearchForm
56
+ setErrorDate = { setErrorDate }
57
+ setDisplayName = { setDisplayName }
58
+ setDisplayNameTouched = { setDisplayNameTouched }
59
+ setHour = { setHour }
60
+ hour = { hour }
61
+ setDate = { setDate }
62
+ date = { date }
63
+ displayName = { displayName }
64
+ />
65
65
66
- < Divider flexItem orientation = { 'vertical' } sx = { { backgroundColor : '#F8FAFC' } } />
66
+ < Divider flexItem orientation = { 'vertical' } sx = { { backgroundColor : '#F8FAFC' } } />
67
67
68
- < Box px = { 1 } py = { 2 } width = { '50%' } >
69
- < PresetsContent presets = { presets } onPresetClick = { ( value ) => setDate ( dayjs ( value ) ) } />
70
- </ Box >
68
+ < Box px = { 1 } py = { 2 } width = { '50%' } >
69
+ < PresetsContent presets = { presets } onPresetClick = { ( value ) => setDate ( dayjs ( value ) ) } />
71
70
</ Box >
71
+ </ Box >
72
72
73
- < Divider sx = { { backgroundColor : '#F8FAFC' } } />
74
- < Box p = { 1 } display = { 'flex' } alignItems = { 'center' } justifyContent = { 'space-between' } >
75
- < Box display = { 'flex' } justifyContent = { 'flex-end' } >
76
- < Typography color = { '#64748B' } component = "div" variant = { 'small' } >
77
- Browser time: (GMT { dayjs ( new Date ( ) ) . format ( 'Z' ) } )
78
- </ Typography >
79
- </ Box >
73
+ < Divider sx = { { backgroundColor : '#F8FAFC' } } />
74
+ < Box p = { 1 } display = { 'flex' } alignItems = { 'center' } justifyContent = { 'space-between' } >
75
+ < Box display = { 'flex' } justifyContent = { 'flex-end' } >
76
+ < Typography color = { '#64748B' } component = "div" variant = { 'small' } >
77
+ Browser time: (GMT { dayjs ( new Date ( ) ) . format ( 'Z' ) } )
78
+ </ Typography >
79
+ </ Box >
80
80
81
- < Box gap = { 1 } display = { 'flex' } justifyContent = { 'flex-end' } >
82
- < Button
83
- stretch = { ButtonStretch . Slim }
84
- variant = { ButtonVariant . OutlineSecondary }
85
- onClick = { close }
86
- label = { 'Cancel' }
87
- />
88
- < Button
89
- stretch = { ButtonStretch . Slim }
90
- variant = { ButtonVariant . Primary }
91
- onClick = { ( ) => addClickedHandler ( { alias : displayName , value } ) }
92
- disabled = { ! date || errorDate || loading }
93
- label = { loading ? 'loading...' : 'Add Field' }
94
- />
95
- </ Box >
81
+ < Box gap = { 1 } display = { 'flex' } justifyContent = { 'flex-end' } >
82
+ < Button
83
+ stretch = { ButtonStretch . Slim }
84
+ variant = { ButtonVariant . OutlineSecondary }
85
+ onClick = { close }
86
+ label = { 'Cancel' }
87
+ />
88
+ < Button
89
+ stretch = { ButtonStretch . Slim }
90
+ variant = { ButtonVariant . Primary }
91
+ onClick = { ( ) => addClickedHandler ( { alias : displayName , value } ) }
92
+ disabled = { ! date || errorDate || loading }
93
+ label = { loading ? 'loading...' : 'Add Field' }
94
+ />
96
95
</ Box >
97
96
</ Box >
98
- </ ThemeProvider >
99
- </ LocalizationProvider >
97
+ </ Box >
98
+ </ ThemeProvider >
99
+ </ LocalizationProvider >
100
100
) ;
101
101
} ;
0 commit comments