Skip to content

Commit c67769c

Browse files
authored
fix: disable status bar prop causing android status bar change (#502)
* fix: disable status bar prop causing android status bar change * refactor: fix linting error
1 parent 6c5fd65 commit c67769c

9 files changed

Lines changed: 24 additions & 2 deletions

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Flag indicating if the calendar icon should be disabled. When set to `true`, the
5151
`Type: boolean | undefined`
5252
Flag indicating if the status bar padding should be enabled or not. Defaults to `false`.
5353

54+
**disableStatusBar**
55+
`Type: boolean | undefined`
56+
Flag indicating if the date picker modal should avoid manipulating the status bar. When set to `true`, the modal will not modify the status bar's appearance or translucency. Defaults to `false`.
57+
5458
**endYear**
5559
`Type: number | undefined`
5660
The end year when the component is rendered. Defaults to `2200`.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ The date values used to populate the component.
7575
`Type: boolean | undefined`
7676
Flag indicating if the status bar padding should be enabled or not. Defaults to `false`.
7777

78+
**disableStatusBar**
79+
`Type: boolean | undefined`
80+
Flag indicating if the date picker modal should avoid manipulating the status bar. When set to `true`, the modal will not modify the status bar's appearance or translucency. Defaults to `false`.
81+
7882
**editIcon**
7983
`Type: string | undefined`
8084
The edit icon used to toggle between calendar and input. Defaults to `pencil`. You can pass the name of an icon from [MaterialCommunityIcons](https://materialdesignicons.com/).

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ The icon used to close the component. Defaults to `close`. You can pass the name
7474
`Type: boolean | undefined`
7575
Flag indicating if the status bar padding should be enabled or not. Defaults to `false`.
7676

77+
**disableStatusBar**
78+
`Type: boolean | undefined`
79+
Flag indicating if the date picker modal should avoid manipulating the status bar. When set to `true`, the modal will not modify the status bar's appearance or translucency. Defaults to `false`.
80+
7781
**editIcon**
7882
`Type: string | undefined`
7983
The edit icon used to toggle between calendar and input. Defaults to `pencil`. You can pass the name of an icon from [MaterialCommunityIcons](https://materialdesignicons.com/).

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ The date value used to populate the component.
7777
`Type: boolean | undefined`
7878
Flag indicating if the status bar padding should be enabled or not. Defaults to `false`.
7979

80+
**disableStatusBar**
81+
`Type: boolean | undefined`
82+
Flag indicating if the date picker modal should avoid manipulating the status bar. When set to `true`, the modal will not modify the status bar's appearance or translucency. Defaults to `false`.
83+
8084
**editIcon**
8185
`Type: string | undefined`
8286
The edit icon used to toggle between calendar and input. Defaults to `pencil`. You can pass the name of an icon from [MaterialCommunityIcons](https://materialdesignicons.com/).

src/Date/DatePickerInput.shared.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type DatePickerInputProps = {
2626
onChangeText?: (text: string | undefined) => void
2727
inputEnabled?: boolean
2828
disableStatusBarPadding?: boolean
29+
disableStatusBar?: boolean
2930
animationType?: 'slide' | 'fade' | 'none'
3031
presentationStyle?: 'pageSheet' | 'overFullScreen'
3132
startWeekOnMonday?: boolean

src/Date/DatePickerInput.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function DatePickerInput(
6565
endYear,
6666
inputEnabled,
6767
disableStatusBarPadding,
68+
disableStatusBar,
6869
startWeekOnMonday,
6970
}) =>
7071
withModal ? (
@@ -84,6 +85,7 @@ function DatePickerInput(
8485
endYear={endYear ?? defaultEndYear}
8586
inputEnabled={inputEnabled}
8687
disableStatusBarPadding={disableStatusBarPadding ?? false}
88+
disableStatusBar={disableStatusBar}
8789
animationType={animationType}
8890
presentationStyle={presentationStyle}
8991
label={rest.label as any}

src/Date/DatePickerInputWithoutModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function DatePickerInputWithoutModal(
2828
onChangeText,
2929
inputEnabled,
3030
disableStatusBarPadding,
31+
disableStatusBar,
3132
startWeekOnMonday,
3233
...rest
3334
}: DatePickerInputProps & {
@@ -43,6 +44,7 @@ function DatePickerInputWithoutModal(
4344
endYear: DatePickerInputProps['endYear']
4445
inputEnabled: DatePickerInputProps['inputEnabled']
4546
disableStatusBarPadding: DatePickerInputProps['disableStatusBarPadding']
47+
disableStatusBar: DatePickerInputProps['disableStatusBar']
4648
startWeekOnMonday?: DatePickerInputProps['startWeekOnMonday']
4749
}) => any
4850
inputButton?: ReactNode
@@ -119,6 +121,7 @@ function DatePickerInputWithoutModal(
119121
endYear,
120122
inputEnabled,
121123
disableStatusBarPadding,
124+
disableStatusBar,
122125
startWeekOnMonday,
123126
})}
124127
</>

src/Date/DatePickerModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function DatePickerModal(
7373
onRequestClose={rest.onDismiss}
7474
presentationStyle={isPageSheet ? 'pageSheet' : 'overFullScreen'}
7575
supportedOrientations={supportedOrientations}
76-
statusBarTranslucent={true}
76+
statusBarTranslucent={!disableStatusBar}
7777
>
7878
<TouchableWithoutFeedback onPress={rest.onDismiss}>
7979
<View

src/Time/TimeInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function TimeInput(
102102
Platform.OS === 'android'
103103
? Math.max(inputFontSize, 48)
104104
: undefined,
105-
paddingTop: Platform.OS === 'android' ? 10 : undefined,
105+
paddingTop: Platform.OS === 'android' ? 0 : undefined,
106106
paddingBottom: Platform.OS === 'android' ? 0 : undefined,
107107
textAlign: 'center',
108108
},

0 commit comments

Comments
 (0)