Compare commits

..
11 Commits
Author SHA1 Message Date
Brad Bumbalough 8448370658 Merge pull request #141 from expo/chore/yarn-release
chore: use yarn instead of npm for action
2019-11-05 07:31:39 -06:00
Brad Bumbalough 223d35fb85 chore: use yarn instead of npm for action 2019-11-05 07:30:58 -06:00
Brad Bumbalough 979da65d59 Merge pull request #140 from expo/fix/android-nested-action-sheet
[Android] Fix nested action sheets... again
2019-11-05 07:23:19 -06:00
Brad Bumbalough b4f1ae39f9 fix: android calling nested action sheets
- Shouldn't wait until isAnimating since onSelect gets called before _animateOut().
2019-11-04 22:48:40 -06:00
Brad Bumbalough 817582e054 chore: add nested action sheet example 2019-11-04 22:47:30 -06:00
Brad Bumbalough 1a34e86f43 chore: remove package-lock.json
- Accidentally commited this in #136.
2019-11-04 22:40:19 -06:00
Brad Bumbalough e571b97653 chore: sync package-lock and fix audit issues (#139) 2019-10-30 07:44:44 -05:00
Brad Bumbalough a4e11daeec chore(release): configure semantic-release (#136)
- Updates changelog
- Deploys to npm, github tag
- Create github workflow to run release on merges to master
2019-10-30 07:36:54 -05:00
Brad Bumbalough 08a929d477 chore(release): configure semantic-release
- Updates changelog
- Deploys to npm, github tag
- Create github workflow to run release on merges to master
2019-10-30 07:35:28 -05:00
soh335 cd966b48ad style(types): export ActionSheetProps (#135)
When using connectActionSheet, component props should have Context.
So need to type `showActionSheetWithOptions: (options:
ActionSheetOptions, callback: (i: number) => void) => void;` many times.

Context is exported, but it is too common name and cant import from
`'@expo/react-native-action-sheet'`.
2019-10-30 07:31:49 -05:00
dependabot[bot] 3fc5e9f478 fix: update eslint-utils to resolve security issue (#137)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.3)

Signed-off-by: dependabot[bot] <[email protected]>
2019-10-28 17:25:01 -05:00
10 changed files with 78 additions and 24 deletions

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: yarn
- name: Type check
run: npm run type-check
- name: Lint
run: npm run lint
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
+9
View File
@@ -0,0 +1,9 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github"
]
}
+1
View File
@@ -0,0 +1 @@
# Changelog
+18 -3
View File
@@ -4,12 +4,11 @@ import {
ActionSheetProvider,
connectActionSheet,
ActionSheetOptions,
ActionSheetProps,
} from '@expo/react-native-action-sheet';
import ShowActionSheetButton from './ShowActionSheetButton';
interface Props {
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void) => void;
}
type Props = ActionSheetProps;
interface State {
selectedIndex: number | null;
@@ -63,6 +62,22 @@ class App extends React.Component<Props, State> {
onSelection={this._updateSelectionText}
showActionSheetWithOptions={showActionSheetWithOptions}
/>
<ShowActionSheetButton
title="Nested Action Sheets"
onSelection={index => {
if (index < 3) {
showActionSheetWithOptions(
{
title: 'Sub Action Sheet',
options: ['One', 'Two', 'Three', 'Done'],
cancelButtonIndex: 3,
},
this._updateSelectionText
);
}
}}
showActionSheetWithOptions={showActionSheetWithOptions}
/>
{this._renderSectionHeader('Android-Only Options')}
<ShowActionSheetButton
title="Icons"
+4 -1
View File
@@ -14,7 +14,8 @@
"build": "bob build",
"type-check": "tsc --noEmit",
"lint": "eslint . --ext .ts,.tsx --fix",
"fmt": "prettier --write \"{src,example}/**/*.{ts,tsx}\""
"fmt": "prettier --write \"{src,example}/**/*.{ts,tsx}\"",
"semantic-release": "semantic-release"
},
"repository": {
"type": "git",
@@ -34,6 +35,7 @@
"devDependencies": {
"@react-native-community/bob": "^0.6.1",
"@react-native-community/eslint-config": "^0.0.5",
"@semantic-release/changelog": "^3.0.5",
"@types/react": "^16.8.23",
"@types/react-native": "^0.57.65",
"@typescript-eslint/eslint-plugin": "^1.12.0",
@@ -46,6 +48,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",
"typescript": "^3.5.3"
},
"peerDependencies": {
+1 -5
View File
@@ -140,12 +140,8 @@ export default class ActionSheet extends React.Component<Props, State> {
showActionSheetWithOptions = (options: ActionSheetOptions, onSelect: (i: number) => void) => {
const { isVisible, isAnimating, overlayOpacity, sheetOpacity } = this.state;
if (isVisible && isAnimating) {
this._deferNextShow = this.showActionSheetWithOptions.bind(this, options, onSelect);
return;
}
if (isVisible) {
this._deferNextShow = this.showActionSheetWithOptions.bind(this, options, onSelect);
return;
}
+3 -2
View File
@@ -1,9 +1,10 @@
import * as React from 'react';
import { Consumer, Context } from './context';
import { Consumer } from './context';
import hoistNonReactStatic from 'hoist-non-react-statics';
import { ActionSheetProps } from './types';
export default function connectActionSheet<OwnProps = any>(
WrappedComponent: React.ComponentType<OwnProps & Context>
WrappedComponent: React.ComponentType<OwnProps & ActionSheetProps>
) {
const ConnectedActionSheet = (props: OwnProps) => {
return (
+2 -6
View File
@@ -1,11 +1,7 @@
import * as React from 'react';
import { ActionSheetOptions } from './types';
import { ActionSheetOptions, ActionSheetProps } from './types';
export interface Context {
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void) => void;
}
const context = React.createContext<Context>({
const context = React.createContext<ActionSheetProps>({
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void) => {},
});
+4
View File
@@ -1,6 +1,10 @@
import * as React from 'react';
import { TextStyle, ViewStyle } from 'react-native';
export interface ActionSheetProps {
showActionSheetWithOptions: (options: ActionSheetOptions, callback: (i: number) => void) => void;
}
// for iOS
export interface ActionSheetIOSOptions {
options: string[];
+9 -7
View File
@@ -1893,14 +1893,16 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3:
estraverse "^4.1.1"
eslint-utils@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"
integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==
version "1.4.3"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f"
integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==
dependencies:
eslint-visitor-keys "^1.1.0"
eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
eslint@^6.0.1:
version "6.0.1"