index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import { StyleSheet, Text, View, TextInput, Button } from 'react-native';
  3. import Types from '../../lib/Types';
  4. export default function BaseContainer(props) {
  5. let {
  6. selected,
  7. width,
  8. height,
  9. overflow,
  10. marginBottom,
  11. shadowColor,
  12. shadowWidth,
  13. shadowHeight,
  14. backgroundColor,
  15. ...restProps
  16. } = props;
  17. if(!width) width = BaseContainer.Inputs.width.default;
  18. if(!height) height = BaseContainer.Inputs.height.default;
  19. if(!backgroundColor) backgroundColor = '';
  20. if(!marginBottom) marginBottom = 0;
  21. if(!shadowColor) shadowColor = '';
  22. if(!shadowWidth) shadowWidth = 0;
  23. if(!shadowHeight) shadowHeight = 0;
  24. return (
  25. <View {...restProps} style={{width, height, overflow , backgroundColor , marginBottom , shadowColor,shadowOffset:{width:shadowWidth,height:shadowHeight}}}>
  26. </View>
  27. );
  28. }
  29. BaseContainer.Inputs = {
  30. width: new Types.Integer().require().default(50),
  31. height: new Types.Integer().require().default(50),
  32. overflow: new Types.Integer().require().default('hidden'),
  33. backgroundColor: new Types.Text().require().color(),
  34. marginBottom:new Types.Integer().require().default(0),
  35. shadowColor: new Types.Text().require().color().default(""),
  36. shadowWidth: new Types.Integer().require(),
  37. shadowHeight: new Types.Integer().require()
  38. }