Skip to content

Commit 6babb04

Browse files
Usage of presentationStyle prop added in documentation
1 parent 59de956 commit 6babb04

File tree

4 files changed

+97
-50
lines changed

4 files changed

+97
-50
lines changed

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ The input date picker provides a text field allowing for a date to be input or t
99
## Usage
1010

1111
```jsx
12-
import React from "react";
13-
import { View, Text } from "react-native";
14-
import { DatePickerInput } from 'react-native-paper-dates';
15-
import { SafeAreaProvider } from "react-native-safe-area-context";
12+
import React from 'react'
13+
import { View, Text } from 'react-native'
14+
import { DatePickerInput } from 'react-native-paper-dates'
15+
import { SafeAreaProvider } from 'react-native-safe-area-context'
1616

1717
export default function App() {
1818
const [inputDate, setInputDate] = React.useState(undefined)
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: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ The multiple dates picker provides a modal allowing for multiple dates selection
99
## Usage
1010

1111
```jsx
12-
import React from "react";
13-
import { View, Text } from "react-native";
14-
import { Button } from 'react-native-paper';
15-
import { DatePickerModal } from 'react-native-paper-dates';
16-
import { SafeAreaProvider } from "react-native-safe-area-context";
12+
import React from 'react'
13+
import { View, Text } from 'react-native'
14+
import { Button } from 'react-native-paper'
15+
import { DatePickerModal } from 'react-native-paper-dates'
16+
import { SafeAreaProvider } from 'react-native-safe-area-context'
1717

1818
export default function App() {
19-
const [dates, setDates] = React.useState();
20-
const [open, setOpen] = React.useState(false);
19+
const [dates, setDates] = React.useState()
20+
const [open, setOpen] = React.useState(false)
2121

2222
const onDismiss = React.useCallback(() => {
23-
setOpen(false);
24-
}, [setOpen]);
23+
setOpen(false)
24+
}, [setOpen])
2525

2626
const onConfirm = React.useCallback((params) => {
27-
setOpen(false);
28-
setDates(params.dates);
29-
console.log('[on-change-multi]', params);
30-
}, []);
27+
setOpen(false)
28+
setDates(params.dates)
29+
console.log('[on-change-multi]', params)
30+
}, [])
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: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,34 @@ The range date picker provides a modal allowing the selection of a date range.
99
## Usage
1010

1111
```jsx
12-
import React from "react";
13-
import { View, Text } from "react-native";
14-
import { Button } from 'react-native-paper';
15-
import { DatePickerModal } from 'react-native-paper-dates';
16-
import { SafeAreaProvider } from "react-native-safe-area-context";
12+
import React from 'react'
13+
import { View, Text } from 'react-native'
14+
import { Button } from 'react-native-paper'
15+
import { DatePickerModal } from 'react-native-paper-dates'
16+
import { SafeAreaProvider } from 'react-native-safe-area-context'
1717

1818
export default function App() {
19-
const [range, setRange] = React.useState({ startDate: undefined, endDate: undefined });
20-
const [open, setOpen] = React.useState(false);
19+
const [range, setRange] = React.useState({
20+
startDate: undefined,
21+
endDate: undefined,
22+
})
23+
const [open, setOpen] = React.useState(false)
2124

2225
const onDismiss = React.useCallback(() => {
23-
setOpen(false);
24-
}, [setOpen]);
26+
setOpen(false)
27+
}, [setOpen])
2528

2629
const onConfirm = React.useCallback(
2730
({ startDate, endDate }) => {
28-
setOpen(false);
29-
setRange({ startDate, endDate });
31+
setOpen(false)
32+
setRange({ startDate, endDate })
3033
},
3134
[setOpen, setRange]
32-
);
35+
)
3336

3437
return (
3538
<SafeAreaProvider>
36-
<View style={{justifyContent: 'center', flex: 1, alignItems: 'center'}}>
39+
<View style={{ justifyContent: 'center', flex: 1, alignItems: 'center' }}>
3740
<Button onPress={() => setOpen(true)} uppercase={false} mode="outlined">
3841
Pick range
3942
</Button>
@@ -48,7 +51,7 @@ export default function App() {
4851
/>
4952
</View>
5053
</SafeAreaProvider>
51-
);
54+
)
5255
}
5356
```
5457

@@ -149,3 +152,14 @@ The edit icon used to toggle between input and calendar. Defaults to `calendar`.
149152
**inputEnabled**
150153
`Type: boolean | undefined`
151154
Flag indicating if the component should be enabled or not. Defaults to `true`.
155+
156+
**presentationStyle**
157+
`Type: 'fullScreen' | 'pageSheet' | 'formSheet' | 'overFullScreen'`
158+
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.
159+
160+
- `'fullScreen'`: Presents the modal as a full-screen overlay.
161+
- `'pageSheet'`: Displays the modal as a card-style sheet that covers a portion of the screen.
162+
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
163+
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.
164+
165+
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: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ The single date picker provides a modal allowing only a single date selection.
99
## Usage
1010

1111
```jsx
12-
import React from "react";
13-
import { View, Text } from "react-native";
14-
import { Button } from 'react-native-paper';
15-
import { DatePickerModal } from 'react-native-paper-dates';
16-
import { SafeAreaProvider } from "react-native-safe-area-context";
12+
import React from 'react'
13+
import { View, Text } from 'react-native'
14+
import { Button } from 'react-native-paper'
15+
import { DatePickerModal } from 'react-native-paper-dates'
16+
import { SafeAreaProvider } from 'react-native-safe-area-context'
1717

1818
export default function App() {
19-
const [date, setDate] = React.useState(undefined);
20-
const [open, setOpen] = React.useState(false);
19+
const [date, setDate] = React.useState(undefined)
20+
const [open, setOpen] = React.useState(false)
2121

2222
const onDismissSingle = React.useCallback(() => {
23-
setOpen(false);
24-
}, [setOpen]);
23+
setOpen(false)
24+
}, [setOpen])
2525

2626
const onConfirmSingle = React.useCallback(
2727
(params) => {
28-
setOpen(false);
29-
setDate(params.date);
28+
setOpen(false)
29+
setDate(params.date)
3030
},
3131
[setOpen, setDate]
32-
);
32+
)
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.

0 commit comments

Comments
 (0)