Skip to content

Commit

Permalink
feat(tcr): testing modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Manjiz committed May 28, 2018
1 parent 6e57d1e commit 7e50324
Show file tree
Hide file tree
Showing 9 changed files with 1,840 additions and 2,234 deletions.
3 changes: 3 additions & 0 deletions packages/taro-components-rn/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ build
# jest
coverage
__snapshots__

# tcr-testing
tcr-testing.sh
12 changes: 11 additions & 1 deletion packages/taro-components-rn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Alo, alo! Bilibilibilibibili~

> IOS: Remember to link the libART.a into your project if you want to use Icon.
## Example

Please use official AwesomeProject.

```bash
cp -rf src AwesomeProjectDir/src/tcr
# import components
# import { Icon } from './tcr'
```

## Todo list

> FS = Fully Support
Expand Down Expand Up @@ -31,7 +41,7 @@ Alo, alo! Bilibilibilibibili~
- [] picker |
- [] radio |
- [] slider | 0.4~0.6 99%
- [] switch | 0.3~0.5
- [] switch | FS
- [] textarea

### 导航
Expand Down
4,009 changes: 1,793 additions & 2,216 deletions packages/taro-components-rn/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/taro-components-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@tarojs/components-rn",
"version": "0.0.32",
"description": "多端解决方案基础组件(RN)",
"main": "index.js",
"main": "./src/index.js",
"scripts": {
"flow": "flow",
"flow-stop": "flow stop",
Expand Down
22 changes: 11 additions & 11 deletions packages/taro-components-rn/src/components/checkbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

import React, { Component } from 'react'
import {
View,
TouchableWithoutFeedback,
StyleSheet,
StyleSheet
} from 'react-native'
import Icon from '../icon'
import styles from './styles'
Expand Down Expand Up @@ -54,16 +55,15 @@ class _Checkbox extends Component<Props> {
} = this.props

return (
<TouchableWithoutFeedback
onPress={this.onPress}
style={[styles.wrapper, style, wrapperChecked]}
>
<Icon
type="success_no_circle"
size="10"
color="white"
style="[wrapperIcon, checked && wrapperCheckedIcon]"
/>
<TouchableWithoutFeedback onPress={this.onPress}>
<View style={[styles.wrapper, style, checked && styles.wrapperChecked]}>
<Icon
type="success_no_circle"
size={18}
color="white"
style={[styles.wrapperIcon, checked && styles.wrapperCheckedIcon]}
/>
</View>
</TouchableWithoutFeedback>
)
}
Expand Down
6 changes: 3 additions & 3 deletions packages/taro-components-rn/src/components/checkbox/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ export default StyleSheet.create({
wrapper: {
alignItems: 'center',
justifyContent: 'center',
width: 12,
height: 12,
width: 24,
height: 24,
borderColor: '#f3f3f3',
borderWidth: 1,
borderWidth: 2,
borderRadius: 2
},
wrapperChecked: {
Expand Down
11 changes: 9 additions & 2 deletions packages/taro-components-rn/src/components/switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
* ✔ bindchange :isChecked
* ✔ color
*
* @warn When type="switch", use native Switch
* @see https://wechat.design/brand/color
* @example
* <Switch
* checked={this.state.isSwitchChecked}
* bindchange={this.onSwitchChange}
* color="red"
* />
*
* @flow
*/
Expand Down Expand Up @@ -49,7 +56,7 @@ class _Switch extends Component<Props> {
if (type === 'checkbox') {
return (
<Checkbox
bindchange={onCheckboxToggle}
bindchange={this.onCheckboxToggle}
checked={checked}
/>
)
Expand All @@ -60,7 +67,7 @@ class _Switch extends Component<Props> {
value={checked}
onValueChange={bindchange}
onTintColor={color}
style={[style, { width: size, height: size }]}
style={style}
/>
)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/taro-components-rn/src/components/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* ✘ animationend
* ✘ touchforcechange
*
* @warn unstable
*
* @flow
*/

Expand Down
7 changes: 7 additions & 0 deletions packages/taro-components-rn/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Icon from './components/icon'
import Switch from './components/switch'

export {
Icon,
Switch
}

0 comments on commit 7e50324

Please sign in to comment.