Skip to content

Instantly share code, notes, and snippets.

@skiph
Created April 27, 2018 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skiph/f5db102d0c6415e8da16c2557d0a16b5 to your computer and use it in GitHub Desktop.
Save skiph/f5db102d0c6415e8da16c2557d0a16b5 to your computer and use it in GitHub Desktop.
RNDemo - shapes component
import React from "react";
import { View, Image, Text, StyleSheet } from "react-native";
const shapeView = (props) => {
const imgSrc = {
'logo': require('./assets/approov_largelogo.png'),
'hello': require('./assets/hello.png'),
'confused': require('./assets/confused.png'),
'Rectangle': require('./assets/rectangle.png'),
'Square': require('./assets/square.png'),
'Triangle': require('./assets/triangle.png'),
'Circle': require('./assets/circle.png')
};
return (
<View style={props.style}>
<Image source={imgSrc[props.shape]} style={styles.shapeImg} />
<Text style={{fontSize: 24, marginTop: 10}}>{props.status}</Text>
</View>
);
}
const styles = StyleSheet.create({
shapeImg: {
resizeMode: 'contain',
height: 256,
width: 256
}
});
export default shapeView;
// end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment