12345678910111213141516171819202122232425262728293031323334353637 |
- import React from 'react';
- import Types from '../../lib/Types';
- import Module from '../../lib/Module';
- import { View, Image } from 'react-native';
- let image = require('./assets/default.jpg')
- export default class ImageComp extends Module {
- constructor(props) {
- super(props);
- }
- display() {
- let {
- width,
- height,
- resizeMode,
- source
- } = this.props;
- if(!width) width = 100;
- if(!height) height = 100;
- if(!resizeMode) resizeMode = 'cover';
- return <Image
- style={{width, height}}
- resizeMode={resizeMode}
- source={source || image}
- />
- }
- }
- ImageComp.Inputs = {
- source: new Types.Text(),
- width: new Types.Integer().require().default(70),
- height: new Types.Integer().require().default(70),
- resizeMode: new Types.Text().require().default('cover')
- }
|