mirror of
https://github.com/expo/react-native-action-sheet.git
synced 2026-11-15 09:18:06 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbb48dadea | ||
|
|
735cfa54ba | ||
|
|
1af3809e07 | ||
|
|
d76a61f593 | ||
|
|
3ef49be264 | ||
|
|
18e63e275d | ||
|
|
d48c323e45 | ||
|
|
d0d5182780 | ||
|
|
eb30b1ed14 | ||
|
|
f509356bdd | ||
|
|
86007a32a0 | ||
|
|
76da5f5fe5 | ||
|
|
e1bd0b0415 |
No files matched your search
@@ -1,5 +1,18 @@
|
||||
# Changelog
|
||||
|
||||
# [3.9.0](https://github.com/expo/react-native-action-sheet/compare/v3.8.0...v3.9.0) (2021-03-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow callback to be async ([#183](https://github.com/expo/react-native-action-sheet/issues/183)) ([d0d5182](https://github.com/expo/react-native-action-sheet/commit/d0d518278028556a80deec3d9b57c332b82ba28d))
|
||||
* center icons with titles ([#188](https://github.com/expo/react-native-action-sheet/issues/188)) ([d48c323](https://github.com/expo/react-native-action-sheet/commit/d48c323e4563363c8683c427d1803e1ff4cddcb5))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add `userInterfaceStyle` option for iOS ([#206](https://github.com/expo/react-native-action-sheet/issues/206)) ([735cfa5](https://github.com/expo/react-native-action-sheet/commit/735cfa54ba1bfd90139671489aca525fdbd59626))
|
||||
|
||||
# [3.8.0](https://github.com/expo/react-native-action-sheet/compare/v3.7.0...v3.8.0) (2020-05-19)
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -159,6 +163,14 @@ Wrap the ActionSheet with a Modal, in order to show in front of other Modals tha
|
||||
#### `destructiveColor`: (optional)
|
||||
Modify color for text of destructive option.
|
||||
|
||||
## ActionSheetProvider Props
|
||||
|
||||
The following props can be set directly on the `ActionSheetProvider`
|
||||
|
||||
#### `useNativeDriver` (optional)
|
||||
Windows only option that provides the option to disable the [native animation](https://reactnative.dev/docs/animated#using-the-native-driver) driver for React Native Windows projects targeting _Windows 10 Version-1809 ; Build-10.0.17763.0_ and earlier. `useNativeDriver` is [supported in Version-1903 and later](https://microsoft.github.io/react-native-windows/docs/win10-compat) so if your project is targeting that, you don't need to set this prop.
|
||||
|
||||
|
||||
## Try it out
|
||||
|
||||
Try it in Expo: https://expo.io/@community/react-native-action-sheet-example
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@
|
||||
"description": "A cross-platform ActionSheet component. https://github.com/expo/react-native-action-sheet",
|
||||
"slug": "react-native-action-sheet-example",
|
||||
"privacy": "public",
|
||||
"sdkVersion": "35.0.0",
|
||||
"version": "3.0.0",
|
||||
"orientation": "portrait",
|
||||
"primaryColor": "#cccccc",
|
||||
@@ -15,4 +14,4 @@
|
||||
"web"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,17 +14,17 @@
|
||||
"dependencies": {
|
||||
"@expo/react-native-action-sheet": "../src",
|
||||
"@expo/vector-icons": "^10.0.0",
|
||||
"expo": "^35.0.0",
|
||||
"expo": "^39.0.0",
|
||||
"hoist-non-react-statics": "^3.3.0",
|
||||
"react": "16.8.3",
|
||||
"react-dom": "16.8.3",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
|
||||
"react-native-web": "^0.11.5"
|
||||
"react": "16.13.1",
|
||||
"react-dom": "16.13.1",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz",
|
||||
"react-native-web": "~0.13.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^16.8.23",
|
||||
"@types/react-native": "^0.57.65",
|
||||
"babel-preset-expo": "^7.0.0",
|
||||
"typescript": "^3.5.3"
|
||||
"@types/react": "~16.9.35",
|
||||
"@types/react-native": "~0.63.2",
|
||||
"babel-preset-expo": "^8.3.0",
|
||||
"typescript": "~3.9.2"
|
||||
}
|
||||
}
|
||||
+2753
-1705
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@expo/react-native-action-sheet",
|
||||
"version": "3.8.0",
|
||||
"version": "3.9.0",
|
||||
"description": "A cross-platform ActionSheet for React Native",
|
||||
"react-native": "lib/module/index.js",
|
||||
"types": "lib/typescript/index.d.ts",
|
||||
@@ -49,7 +49,7 @@
|
||||
"prettier": "^1.18.2",
|
||||
"react": "^16.8.6",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
|
||||
"semantic-release": "^15.13.28",
|
||||
"semantic-release": "^17.3.0",
|
||||
"typescript": "^3.5.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -169,6 +169,7 @@ const styles = StyleSheet.create({
|
||||
width: 24,
|
||||
height: 24,
|
||||
marginRight: 32,
|
||||
justifyContent: "center",
|
||||
},
|
||||
message: {
|
||||
marginTop: 12,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { ActionSheetOptions } from './types';
|
||||
|
||||
interface Props {
|
||||
children: React.ReactNode;
|
||||
useNativeDriver?: boolean;
|
||||
}
|
||||
|
||||
export default class ActionSheetProvider extends React.Component<Props> {
|
||||
@@ -27,7 +28,7 @@ export default class ActionSheetProvider extends React.Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<Provider value={this.getContext()}>
|
||||
<ActionSheet ref={this._actionSheetRef}>
|
||||
<ActionSheet ref={this._actionSheetRef} useNativeDriver={this.props.useNativeDriver}>
|
||||
{React.Children.only(this.props.children)}
|
||||
</ActionSheet>
|
||||
</Provider>
|
||||
|
||||
+2
-1
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import { TextStyle, ViewStyle } from 'react-native';
|
||||
|
||||
export interface ActionSheetProps {
|
||||
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void) => void;
|
||||
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void | Promise<void>) => void;
|
||||
}
|
||||
|
||||
// for iOS
|
||||
@@ -14,6 +14,7 @@ export interface ActionSheetIOSOptions {
|
||||
cancelButtonIndex?: number;
|
||||
destructiveButtonIndex?: number;
|
||||
anchor?: number;
|
||||
userInterfaceStyle?: 'light' | 'dark';
|
||||
}
|
||||
|
||||
// for Android or Web
|
||||
|
||||
Reference in new issue
Block a user