react-native-table-component
Advanced tools
| import React, { Component } from 'react'; | ||
| import { View, Text, StyleSheet } from 'react-native'; | ||
| import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
| class Cell extends Component { | ||
| static propTypes = { | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| textStyle: Text.propTypes.style, | ||
| borderStyle: View.propTypes.style, | ||
| borderStyle: ViewPropTypes.style, | ||
| } | ||
@@ -10,0 +10,0 @@ |
| import React, { Component } from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { View, Text, StyleSheet } from 'react-native'; | ||
| import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
| import Cell from './cell'; | ||
@@ -12,3 +12,3 @@ | ||
| data: PropTypes.array, | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| textStyle: Text.propTypes.style, | ||
@@ -23,4 +23,4 @@ } | ||
| <View style={[ | ||
| width ? {width: width} : {flex: 1}, | ||
| flex && {flex: flex}, | ||
| width ? {width: width} : {flex: 1}, | ||
| flex && {flex: flex}, | ||
| style | ||
@@ -46,3 +46,3 @@ ]}> | ||
| data: PropTypes.array, | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| textStyle: Text.propTypes.style, | ||
@@ -49,0 +49,0 @@ } |
| import React, { Component } from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { View, Text, StyleSheet } from 'react-native'; | ||
| import { View, ViewPropTypes, Text, StyleSheet } from 'react-native'; | ||
| import Cell from './cell'; | ||
@@ -11,3 +11,3 @@ | ||
| data: PropTypes.array, | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| textStyle: Text.propTypes.style, | ||
@@ -24,10 +24,10 @@ } | ||
| } | ||
| return ( | ||
| data ? | ||
| <View style={[ | ||
| height && {height: height}, | ||
| height && {height: height}, | ||
| widthNum && {width: widthNum}, | ||
| styles.row, | ||
| styles.row, | ||
| style | ||
@@ -53,3 +53,3 @@ ]}> | ||
| data: PropTypes.array, | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| textStyle: Text.propTypes.style, | ||
@@ -56,0 +56,0 @@ } |
| import React, { Component } from 'react'; | ||
| import { View, Text } from 'react-native'; | ||
| import { View, ViewPropTypes, Text } from 'react-native'; | ||
| class Table extends Component { | ||
| static propTypes = { | ||
| style: View.propTypes.style, | ||
| borderStyle: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| borderStyle: ViewPropTypes.style, | ||
| } | ||
@@ -33,3 +33,3 @@ | ||
| borderColor = '#000'; | ||
| } | ||
| } | ||
@@ -53,3 +53,3 @@ return ( | ||
| static propTypes = { | ||
| style: View.propTypes.style, | ||
| style: ViewPropTypes.style, | ||
| } | ||
@@ -56,0 +56,0 @@ |
+1
-1
| { | ||
| "name": "react-native-table-component", | ||
| "version": "1.1.1", | ||
| "version": "1.1.2", | ||
| "description": "Build table for react native.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-3
@@ -287,3 +287,3 @@ # React Native Table Component | ||
| return ( | ||
| <View style={styles.con}> | ||
| <View> | ||
| <Table> | ||
@@ -298,5 +298,4 @@ <Rows data={tableData} style={styles.row} textStyle={styles.text}/> | ||
| const styles = StyleSheet.create({ | ||
| con: { paddingTop: 50, paddingLeft: 10, paddingRight: 10 }, | ||
| text: { marginLeft: 5 }, | ||
| row: { height: 30, flexDirection: 'row' }, | ||
| row: { height: 30 }, | ||
| btn: { width: 58, height: 18, backgroundColor: '#ccc', marginLeft: 15 }, | ||
@@ -303,0 +302,0 @@ btnText: { textAlign: 'center', color: '#fff' } |
18304
-0.34%318
-0.31%