Browse Source

0.0.2 Image component.

Frederic G. MARAND 6 years ago
parent
commit
12c0d95fa4
2 changed files with 31 additions and 2 deletions
  1. 6 0
      .idea/vcs.xml
  2. 25 2
      App.js

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 25 - 2
App.js

@@ -1,5 +1,5 @@
 import React, { Component } from 'react';
-import { StyleSheet, Text, View } from 'react-native';
+import { AppRegistry, Image, StyleSheet, Text, View } from 'react-native';
 
 const styles = StyleSheet.create({
   container: {
@@ -10,7 +10,7 @@ const styles = StyleSheet.create({
   },
 });
 
-export default class App extends Component {
+class App extends Component {
   render() {
     return (
       <View style={styles.container}>
@@ -22,3 +22,26 @@ export default class App extends Component {
   }
 }
 
+
+export default class Bananas extends Component {
+  render() {
+    const pic = {
+      uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg',
+    };
+    const img = (
+      <Image source={pic} style={{
+        backgroundColor: 'orange',
+        height: 110,
+        opacity: 0.9,
+        width: '100%',
+      }} />
+    );
+
+    return (
+      img
+    );
+  }
+}
+
+// skip this line if using Create React Native App
+// AppRegistry.registerComponent('AwesomeProject', () => Bananas);