import React, { Component } from 'react'; import { View, StyleSheet, ViewStyle, StyleProp, TextStyle } from 'react-native'; import { Cell } from './cell'; import { sum } from '../utils'; type ColProps = { data: any[]; width?: number; style?: StyleProp; textStyle?: StyleProp; flex?: number; flexArr?: number[]; heightArr?: number[]; testID?: string; }; export class Col extends Component { render() { const { data, style, width, heightArr, flex, textStyle, testID, ...props } = this.props; return data ? ( {data.map((item, i) => { const height = heightArr && heightArr[i]; return ; })} ) : null; } } type ColsProps = { data: any[]; widthArr?: number[]; style?: StyleProp; textStyle?: StyleProp; flexArr?: number[]; heightArr?: number[]; testID?: string; }; export class Cols extends Component { render() { const { data, style, widthArr, heightArr, flexArr, textStyle, testID, ...props } = this.props; let width = widthArr ? sum(widthArr) : 0; return data ? ( {data.map((item, i) => { const flex = flexArr && flexArr[i]; const wth = widthArr && widthArr[i]; return ( ); })} ) : null; } } const styles = StyleSheet.create({ cols: { flexDirection: 'row' } });