feat: add userInterfaceStyle option for iOS (#206)

This commit is contained in:
Manu authored and GitHub committed 2021-03-11 14:13:29 -06:00
1 parent 1af3809e07
commit 735cfa54ba
3 files changed
+9 -3

No files matched your search

+7 -3
View File
@@ -98,13 +98,17 @@ The same options available on React Native's [ActionSheetIOS](https://facebook.g
### iOS Only Props
| Name | Type | Required | Default |
| -----------------| -------| -------- | ------- |
| anchor | number | No | |
| Name | Type | Required | Default |
| -------------------| -------| -------- | ------- |
| anchor | number | No | |
| userInterfaceStyle | string | No | |
#### `anchor` (optional)
iPad only option that allows for docking the action sheet to a node. See [ShowActionSheetButton.tsx](/example/ShowActionSheetButton.tsx) for an example on how to implement this.
#### `userInterfaceStyle` (optional)
The interface style used for the action sheet, can be set to `light` or `dark`, otherwise the default system style will be used.
### Android/Web-Only Props
The below props allow modification of the Android ActionSheet. They have no effect on the look on iOS as the native iOS Action Sheet does not have options for modifying these options.
+1
View File
@@ -32,6 +32,7 @@ export default class ActionSheet extends React.Component<Props> {
title: dataOptions.title || undefined,
message: dataOptions.message || undefined,
anchor: dataOptions.anchor || undefined,
userInterfaceStyle: dataOptions.userInterfaceStyle || undefined,
};
ActionSheetIOS.showActionSheetWithOptions(iosOptions, onSelect);
}
+1
View File
@@ -14,6 +14,7 @@ export interface ActionSheetIOSOptions {
cancelButtonIndex?: number;
destructiveButtonIndex?: number;
anchor?: number;
userInterfaceStyle?: 'light' | 'dark';
}
// for Android or Web