Skip to content

Commit af68fbd

Browse files
authored
Merge branch 'master' into fix-modal-jump-on-open
2 parents 939076c + ef3811b commit af68fbd

File tree

8 files changed

+66
-21
lines changed

8 files changed

+66
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Check out the official docs: [web-ridge.github.io/react-native-paper-dates](http
3838

3939
## Maintainers
4040

41-
[RichardLindhout](https://twitter.com/RichardLindhout) from [web_ridge](https://twitter.com/web_ridge)
41+
[RichardLindhout](https://twitter.com/RichardLindhout) from [web_ridge](https://twitter.com/web_ridge)
4242
[Brandon Fitzwater](https://github.com/iM-GeeKy)
4343

4444

docusaurus/docs/date-picker/input-date-picker.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default function App() {
1919

2020
return (
2121
<SafeAreaProvider>
22-
<View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
22+
<View style={{ justifyContent: 'center', flex: 1, alignItems: 'center' }}>
2323
<DatePickerInput
2424
locale="en"
2525
label="Birthdate"
@@ -29,7 +29,7 @@ export default function App() {
2929
/>
3030
</View>
3131
</SafeAreaProvider>
32-
);
32+
)
3333
}
3434
```
3535

@@ -103,4 +103,15 @@ The end year when the component is rendered. Defaults to `2200`.
103103
`Type: boolean | undefined`
104104
Flag indicating if the component should be enabled or not. Behavior similarly to `disabled`. Defaults to `true`.
105105

106-
* Other [react-native TextInput props](https://reactnative.dev/docs/textinput#props).*
106+
**presentationStyle**
107+
`Type: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'`
108+
Determines the visual presentation style of the date picker modal. This prop allows you to define how the modal appears on the screen when it is displayed.
109+
110+
- `'fullScreen'`: Presents the modal as a full-screen overlay.
111+
- `'pageSheet'`: Displays the modal as a card-style sheet that covers a portion of the screen.
112+
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
113+
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.
114+
115+
For example, if you set `presentationStyle` to `'pageSheet'`, the modal will be presented as a card-like sheet.
116+
117+
- Other [react-native TextInput props](https://reactnative.dev/docs/textinput#props).\*

docusaurus/docs/date-picker/multiple-dates-picker.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function App() {
3131

3232
return (
3333
<SafeAreaProvider>
34-
<View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
34+
<View style={{ justifyContent: 'center', flex: 1, alignItems: 'center' }}>
3535
<Button onPress={() => setOpen(true)} uppercase={false} mode="outlined">
3636
Pick multiple dates
3737
</Button>
@@ -45,7 +45,7 @@ export default function App() {
4545
/>
4646
</View>
4747
</SafeAreaProvider>
48-
);
48+
)
4949
}
5050
```
5151

@@ -142,3 +142,14 @@ The edit icon used to toggle between calendar and input. Defaults to `pencil`. Y
142142
**calendarIcon**
143143
`Type: string | undefined`
144144
The edit icon used to toggle between input and calendar. Defaults to `calendar`. You can pass the name of an icon from [MaterialCommunityIcons](https://materialdesignicons.com/).
145+
146+
**presentationStyle**
147+
`Type: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'`
148+
Determines the visual presentation style of the date picker modal. This prop allows you to define how the modal appears on the screen when it is displayed.
149+
150+
- `'fullScreen'`: Presents the modal as a full-screen overlay.
151+
- `'pageSheet'`: Displays the modal as a card-style sheet that covers a portion of the screen.
152+
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
153+
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.
154+
155+
For example, if you set `presentationStyle` to `'pageSheet'`, the modal will be presented as a card-like sheet.

docusaurus/docs/date-picker/range-date-picker.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export default function App() {
1919
const [range, setRange] = React.useState({ startDate: undefined, endDate: undefined });
2020
const [open, setOpen] = React.useState(false);
2121

22-
const onDismiss = React.useCallback(() => {
22+
const onDismiss = React.useCallback(() => {
2323
setOpen(false);
2424
}, [setOpen]);
2525

26-
const onConfirm = React.useCallback(
26+
const onConfirm = React.useCallback(
2727
({ startDate, endDate }) => {
2828
setOpen(false);
2929
setRange({ startDate, endDate });
@@ -33,7 +33,7 @@ export default function App() {
3333

3434
return (
3535
<SafeAreaProvider>
36-
<View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
36+
<View style={{ justifyContent: 'center', flex: 1, alignItems: 'center' }}>
3737
<Button onPress={() => setOpen(true)} uppercase={false} mode="outlined">
3838
Pick range
3939
</Button>
@@ -48,7 +48,7 @@ export default function App() {
4848
/>
4949
</View>
5050
</SafeAreaProvider>
51-
);
51+
)
5252
}
5353
```
5454

@@ -149,3 +149,14 @@ The edit icon used to toggle between input and calendar. Defaults to `calendar`.
149149
**inputEnabled**
150150
`Type: boolean | undefined`
151151
Flag indicating if the component should be enabled or not. Defaults to `true`.
152+
153+
**presentationStyle**
154+
`Type: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'`
155+
Determines the visual presentation style of the date picker modal. This prop allows you to define how the modal appears on the screen when it is displayed.
156+
157+
- `'fullScreen'`: Presents the modal as a full-screen overlay.
158+
- `'pageSheet'`: Displays the modal as a card-style sheet that covers a portion of the screen.
159+
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
160+
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.
161+
162+
For example, if you set `presentationStyle` to `'pageSheet'`, the modal will be presented as a card-like sheet.

docusaurus/docs/date-picker/single-date-picker.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function App() {
3333

3434
return (
3535
<SafeAreaProvider>
36-
<View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
36+
<View style={{ justifyContent: 'center', flex: 1, alignItems: 'center' }}>
3737
<Button onPress={() => setOpen(true)} uppercase={false} mode="outlined">
3838
Pick single date
3939
</Button>
@@ -47,7 +47,7 @@ export default function App() {
4747
/>
4848
</View>
4949
</SafeAreaProvider>
50-
);
50+
)
5151
}
5252
```
5353

@@ -136,3 +136,14 @@ The edit icon used to toggle between input and calendar. Defaults to `calendar`.
136136
**inputEnabled**
137137
`Type: boolean | undefined`
138138
Flag indicating if the component should be enabled or not. Defaults to `true`.
139+
140+
**presentationStyle**
141+
`Type: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'`
142+
Determines the visual presentation style of the date picker modal. This prop allows you to define how the modal appears on the screen when it is displayed.
143+
144+
- `'fullScreen'`: Presents the modal as a full-screen overlay.
145+
- `'pageSheet'`: Displays the modal as a card-style sheet that covers a portion of the screen.
146+
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
147+
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.
148+
149+
For example, if you set `presentationStyle` to `'pageSheet'`, the modal will be presented as a card-like sheet.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-paper-dates",
3-
"version": "0.18.14",
3+
"version": "0.18.16",
44
"description": "Performant Date Picker for React Native Paper",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/Date/DatePickerModal.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
Platform,
99
StatusBar,
1010
} from 'react-native'
11-
1211
import { useTheme } from 'react-native-paper'
1312
import DatePickerModalContent, {
1413
DatePickerModalContentMultiProps,
@@ -22,6 +21,11 @@ interface DatePickerModalProps {
2221
disableStatusBar?: boolean
2322
disableStatusBarPadding?: boolean
2423
inputEnabled?: boolean
24+
presentationStyle?:
25+
| 'fullScreen'
26+
| 'pageSheet'
27+
| 'formSheet'
28+
| 'overFullScreen'
2529
}
2630

2731
export interface DatePickerModalSingleProps
@@ -50,6 +54,7 @@ export function DatePickerModal(
5054
disableStatusBar,
5155
disableStatusBarPadding,
5256
inputEnabled,
57+
presentationStyle,
5358
...rest
5459
} = props
5560
const animationTypeCalculated =
@@ -63,10 +68,10 @@ export function DatePickerModal(
6368
<View style={[StyleSheet.absoluteFill]} pointerEvents="box-none">
6469
<Modal
6570
animationType={animationTypeCalculated}
66-
transparent={true}
71+
transparent={isTransparent}
6772
visible={visible}
6873
onRequestClose={rest.onDismiss}
69-
presentationStyle="overFullScreen"
74+
presentationStyle={presentationStyle || 'overFullScreen'}
7075
supportedOrientations={supportedOrientations}
7176
//@ts-ignore
7277
statusBarTranslucent={true}
@@ -114,6 +119,7 @@ export function DatePickerModal(
114119
</View>
115120
)
116121
}
122+
117123
const supportedOrientations: any = [
118124
'portrait',
119125
'portrait-upside-down',

src/Date/DatePickerModalHeader.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export default function DatePickerModalHeader(
4848
/>
4949
<Appbar.Content title={''} />
5050
<Button
51-
color={color}
5251
textColor={theme.isV3 ? theme.colors.primary : color}
5352
onPress={props.onSave}
5453
disabled={props.saveLabelDisabled ?? false}
@@ -63,13 +62,9 @@ export default function DatePickerModalHeader(
6362
}
6463

6564
const styles = StyleSheet.create({
66-
fill: {
67-
flex: 1,
68-
},
6965
animated: {
7066
elevation: 4,
7167
},
72-
7368
header: {
7469
height: 75,
7570
alignItems: 'center',

0 commit comments

Comments
 (0)