Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ node_modules
dist
build
lib
coverage
ios
android
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# History

## 1.1.0

- [`new`] react-native support

## 1.0.2

- [`fix`] error if this.refs.left/right is []
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rc-swipeout
---

iOS-style swipeout buttons that appear from behind a component
iOS-style swipeout buttons that appear from behind a component (web & react-native support)

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
Expand All @@ -25,8 +25,12 @@ iOS-style swipeout buttons that appear from behind a component
## Development

```
web:
npm install
npm start

rn:
tnpm run rn-start
```

## Example
Expand Down
49 changes: 49 additions & 0 deletions examples/reactNative.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { View, Text, AppRegistry } from 'react-native';
import Swipeout from './src';
import React from 'react';

class SwipeoutExample extends React.Component {
render() {
return (
<View style={{ marginTop: 40 }}>
<Swipeout
style={{ backgroundColor: '#c1c1c1' }}
autoClose
right={[
{ text: 'more',
onPress: () => console.log('more'),
style: { backgroundColor: 'orange', color: 'white' },
},
{ text: 'delete',
onPress: () => console.log('delete'),
style: { backgroundColor: 'red', color: 'white' },
},
]}
left={[
{
text: 'read',
onPress: () => console.log('read'),
style: { backgroundColor: 'blue', color: 'white' },
},
{
text: 'reply',
onPress: () => console.log('reply'),
style: { backgroundColor: 'green', color: 'white' },
},
]}
onOpen={() => console.log('open')}
onClose={() => console.log('close')}
>
<Text style={{
height: 44,
backgroundColor: '#c1c1c1',
lineHeight: 30,
}}
>this is Demo</Text>
</Swipeout>
</View>
);
}
}

AppRegistry.registerComponent('swipeout', () => SwipeoutExample);
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
module.exports = require('./src/');
import Swipeout from './src/';
export default Swipeout;
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rc-swipeout",
"version": "1.0.2",
"description": "swipe out ui component for react",
"version": "1.1.0",
"description": "swipe out ui component for react(web and react-native)",
"keywords": [
"react",
"react-component",
Expand All @@ -23,7 +23,7 @@
"assets/*.css"
],
"licenses": "MIT",
"main": "./lib/index",
"main": "./lib/index.web",
"config": {
"port": 8000
},
Expand All @@ -34,22 +34,25 @@
"pub": "rc-tools run pub",
"lint": "rc-tools run lint",
"karma": "rc-tools run karma",
"saucelabs": "rc-tools run saucelabs",
"test": "rc-tools run test",
"chrome-test": "rc-tools run chrome-test",
"coverage": "rc-tools run coverage"
"coverage": "rc-tools run coverage",
"rn-start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react-hammerjs": "^0.4.6"
"object.omit": "~2.0.0",
"react-hammerjs": "^0.5.0",
"react-native-swipeout": "https://github.com/dancormier/react-native-swipeout.git#master"
},
"devDependencies": {
"expect.js": "0.3.x",
"hammer-simulator": "0.0.1",
"pre-commit": "1.x",
"rc-tools": "5.x",
"react": "0.14.x",
"react-addons-test-utils": "0.14.x",
"react-dom": "0.14.x"
"react": "~15.2.1",
"react-addons-test-utils": "~15.2.1",
"react-dom": "~15.2.1",
"react-native": "0.28.0"
},
"pre-commit": [
"lint"
Expand Down
Loading