3
0

Row.js 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React , { useState } from 'react';
  2. import { StyleSheet, Text, View, TextInput, Button } from 'react-native';
  3. export default class Row extends React.Component{
  4. constructor(props) {
  5. super(props);
  6. }
  7. render() {
  8. let {
  9. children,
  10. selected,
  11. depth,
  12. ...restProps
  13. } = this.props;
  14. console.log(depth);
  15. let styl = [styles.row];
  16. if(depth !== 2) styl.push(styles.rowStretch);
  17. if (selected) styl.push(styles.selected);
  18. return (
  19. <View {...restProps} style={styl}>
  20. {children}
  21. </View>
  22. );
  23. }
  24. }
  25. const styles = StyleSheet.create({
  26. row: {
  27. // flex:1, // this stretches the rows to full Col Height
  28. alignItems: 'flex-start',
  29. flexDirection: 'row',
  30. overflow: 'hidden'
  31. },
  32. rowStretch: {
  33. flex: 1,
  34. alignItems: 'stretch'
  35. },
  36. selected: {
  37. // boxShadow: 'inset 0px 0px 1px 1px rgba(0,0,0,0.31)'
  38. shadowColor: "rgba(0,0,0,0.31)",
  39. shadowOffset: {
  40. width: 0,
  41. height: 4,
  42. },
  43. shadowOpacity: 0.30,
  44. shadowRadius: 4.65,
  45. elevation: 8
  46. }
  47. });