Skip to content

Instantly share code, notes, and snippets.

Created April 27, 2018 00:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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={}>
<Image source={imgSrc[props.shape]} style={styles.shapeImg} />
<Text style={{fontSize: 24, marginTop: 10}}>{props.status}</Text>
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