Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc #6

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
doc
docs
27 changes: 27 additions & 0 deletions ActionSheet/ActionSheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#### Demo

![ActionSheet](http://wx4.sinaimg.cn/mw690/4c8b519dly1feq4asyl44g20hs0wsguv.gif)

#### Example

```JavaScript
import ActionSheet from 'rnx-ui/ActionSheet';

function Example(props) {
return (
<ActionSheet
visible={this.state.visible}
onClose={this.hide}
btnList={[{
text: '默认',
onPress: this.hide,
}, {
text: '相册',
onPress: this.hide,
}]}
/>
);
}
```


89 changes: 0 additions & 89 deletions ActionSheet/README.md

This file was deleted.

107 changes: 92 additions & 15 deletions ActionSheet/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* @component ActionSheet
* @version 0.11.7
* @description 上拉按钮组
*
* @instructions {instruInfo: ./ActionSheet/ActionSheet.md}
*/
import React, { Component, PropTypes } from 'react';
import {
Platform,
Expand Down Expand Up @@ -75,40 +82,110 @@ class ActionSheet extends Component {
}

ActionSheet.propTypes = {
// 显示开关
/**
* @property visible
* @type Boolean
* @default false
* @description 显示开关
*/
visible: Sheet.propTypes.visible,
// 按钮组
/**
* @property btnList
* @type Object
* @default [{
* style: null,
* text: '确定',
* textStyle: null,
* onPress: NOOP,
* }]
* @param {Object} style 按钮样式
* @param {String} text 按钮文字
* @param {Object} textStyle 按钮文字样式
* @param {Function} onPress 按钮点击回调
* @description 按钮组
*/
btnList: PropTypes.arrayOf(PropTypes.shape({
/* eslint-disable */
// 按钮样式

style: View.propTypes.style,
// 按钮文字

text: PropTypes.string,
// 按钮文字样式

textStyle: Text.propTypes.style,
// 按钮点击回调

onPress: PropTypes.func,
/* eslint-enable */
})),
// 统一按钮样式
/**
* @property btnStyle
* @type Object
* @default null
* @description 统一按钮样式
*/
btnStyle: View.propTypes.style,
// 统一按钮文字样式
/**
* @property btnTextStyle
* @type Object
* @default null
* @description 统一按钮文字样式
*/
btnTextStyle: Text.propTypes.style,
// 取消按钮样式
/**
* @property cancelBtnStyle
* @type Object
* @default null
* @description 取消按钮样式
*/
cancelBtnStyle: View.propTypes.style,
// 取消按钮文字
/**
* @property cancelBtnText
* @type String
* @default '取消'
* @description 取消按钮文字
*/
cancelBtnText: PropTypes.string,
// 取消按钮文字样式
/**
* @property cancelBtnTextStyle
* @type Object
* @default null
* @description 取消按钮文字样式
*/
cancelBtnTextStyle: Text.propTypes.style,
// 遮罩层样式
/**
* @property overlayStyle
* @type Object
* @default null
* @description 遮罩层样式
*/
overlayStyle: Sheet.propTypes.overlayStyle,
// 关闭回调(动画结束时)
/**
* @property onClose
* @type Function
* @default NOOP
* @description 关闭回调(动画结束时)
*/
onClose: Sheet.propTypes.onClose,
// 动画时长
/**
* @property duration
* @type Number
* @default 200
* @description 动画时长
*/
duration: Sheet.propTypes.duration,
// 自定义样式
/**
* @property style
* @type Object
* @default null
* @description 自定义样式
*/
style: View.propTypes.style,
// 按钮点击透明度变化
/**
* @property underlayColor
* @type String
* @default '#eee'
* @description 按钮点击透明度变化
*/
underlayColor: PropTypes.string,
};
ActionSheet.defaultProps = {
Expand Down
20 changes: 20 additions & 0 deletions AddAndSubtract/AddAndSubtract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#### Demo

![AddAndSubtract](http://wx3.sinaimg.cn/mw690/4c8b519dly1fcaq7v2pnvg20ho0wgh0z.gif)

#### Example

```JavaScript
import Template from 'rnx-ui/Template';

function Example(props) {
return (
<AddAndSubtract
num={this.state.num}
onPressAdder={this.add}
onPressSubtracter={this.subtract}
/>
);
}
```

93 changes: 0 additions & 93 deletions AddAndSubtract/README.md

This file was deleted.

Loading