Skip to content

Commit a3fa81c

Browse files
Right prettier, presentationStyle
Used the right prettier and removed the ; from the code.
1 parent 4856e59 commit a3fa81c

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

src/Date/DatePickerModal.tsx

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
import * as React from 'react';
1+
import * as React from 'react'
22
import {
33
Modal,
44
StyleSheet,
55
TouchableWithoutFeedback,
66
useWindowDimensions,
77
View,
88
Platform,
9-
StatusBar,
10-
} from 'react-native';
9+
StatusBar
10+
} from 'react-native'
1111

12-
import { useTheme } from 'react-native-paper';
12+
import { useTheme } from 'react-native-paper'
1313
import DatePickerModalContent, {
1414
DatePickerModalContentMultiProps,
1515
DatePickerModalContentRangeProps,
16-
DatePickerModalContentSingleProps,
17-
} from './DatePickerModalContent';
18-
import { useHeaderBackgroundColor, useHeaderColorIsLight } from '../utils';
19-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
16+
DatePickerModalContentSingleProps
17+
} from './DatePickerModalContent'
18+
import { useHeaderBackgroundColor, useHeaderColorIsLight } from '../utils'
19+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
2020

2121
interface DatePickerModalProps {
22-
visible: boolean;
23-
animationType?: 'slide' | 'fade' | 'none';
24-
disableStatusBar?: boolean;
25-
disableStatusBarPadding?: boolean;
26-
inputEnabled?: boolean;
27-
presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen';
22+
visible: boolean
23+
animationType?: 'slide' | 'fade' | 'none'
24+
disableStatusBar?: boolean
25+
disableStatusBarPadding?: boolean
26+
inputEnabled?: boolean
27+
presentationStyle?: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'
2828
}
2929

3030
export interface DatePickerModalSingleProps
@@ -45,8 +45,8 @@ export function DatePickerModal(
4545
| DatePickerModalSingleProps
4646
| DatePickerModalMultiProps
4747
) {
48-
const theme = useTheme();
49-
const dimensions = useWindowDimensions();
48+
const theme = useTheme()
49+
const dimensions = useWindowDimensions()
5050
const {
5151
visible,
5252
animationType,
@@ -55,26 +55,26 @@ export function DatePickerModal(
5555
inputEnabled,
5656
presentationStyle,
5757
...rest
58-
} = props;
58+
} = props
5959
const animationTypeCalculated =
6060
animationType ||
6161
Platform.select({
6262
web: 'none',
63-
default: 'slide',
64-
});
63+
default: 'slide'
64+
})
6565

66-
const isLight = useHeaderColorIsLight();
67-
const headerBackgroundColor = useHeaderBackgroundColor();
68-
const insets = useSafeAreaInsets();
69-
const isTransparent = presentationStyle === 'pageSheet' ? false : true;
66+
const isLight = useHeaderColorIsLight()
67+
const headerBackgroundColor = useHeaderBackgroundColor()
68+
const insets = useSafeAreaInsets()
69+
const isTransparent = presentationStyle === 'pageSheet' ? false : true
7070
return (
7171
<View style={[StyleSheet.absoluteFill]} pointerEvents="box-none">
7272
<Modal
7373
animationType={animationTypeCalculated}
7474
transparent={isTransparent}
7575
visible={visible}
7676
onRequestClose={rest.onDismiss}
77-
presentationStyle={presentationStyle || "overFullScreen"}
77+
presentationStyle={presentationStyle || 'overFullScreen'}
7878
supportedOrientations={supportedOrientations}
7979
//@ts-ignore
8080
statusBarTranslucent={true}
@@ -85,19 +85,16 @@ export function DatePickerModal(
8585
style={[
8686
StyleSheet.absoluteFill,
8787
styles.modalBackground,
88-
{ backgroundColor: theme.colors.backdrop },
88+
{ backgroundColor: theme.colors.backdrop }
8989
]}
9090
/>
9191
</TouchableWithoutFeedback>
92-
<View
93-
style={[StyleSheet.absoluteFill, styles.modalRoot]}
94-
pointerEvents="box-none"
95-
>
92+
<View style={[StyleSheet.absoluteFill, styles.modalRoot]} pointerEvents="box-none">
9693
<View
9794
style={[
9895
styles.modalContent,
9996
{ backgroundColor: theme.colors.surface },
100-
dimensions.width > 650 ? styles.modalContentBig : null,
97+
dimensions.width > 650 ? styles.modalContentBig : null
10198
]}
10299
>
103100
{disableStatusBar ? null : (
@@ -111,8 +108,8 @@ export function DatePickerModal(
111108
style={[
112109
{
113110
height: insets.top,
114-
backgroundColor: headerBackgroundColor,
115-
},
111+
backgroundColor: headerBackgroundColor
112+
}
116113
]}
117114
/>
118115
)}
@@ -126,37 +123,37 @@ export function DatePickerModal(
126123
</>
127124
</Modal>
128125
</View>
129-
);
126+
)
130127
}
131128

132129
const supportedOrientations: any = [
133130
'portrait',
134131
'portrait-upside-down',
135132
'landscape',
136133
'landscape-left',
137-
'landscape-right',
138-
];
134+
'landscape-right'
135+
]
139136

140137
const styles = StyleSheet.create({
141138
modalRoot: {
142139
justifyContent: 'center',
143140
alignItems: 'center',
144-
flex: 1,
141+
flex: 1
145142
},
146143
modalBackground: {
147-
flex: 1,
144+
flex: 1
148145
},
149146
modalContent: {
150147
flex: 1,
151-
width: '100%',
148+
width: '100%'
152149
},
153150
modalContentBig: {
154151
maxWidth: 600,
155152
maxHeight: 800,
156153
borderRadius: 10,
157154
width: '100%',
158-
overflow: 'hidden',
159-
},
160-
});
155+
overflow: 'hidden'
156+
}
157+
})
161158

162-
export default React.memo(DatePickerModal);
159+
export default React.memo(DatePickerModal)

0 commit comments

Comments
 (0)