mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
BOOM Initial React Native import and setup
This commit is contained in:
parent
ad5ef4f804
commit
88614aac06
19 changed files with 1099 additions and 4 deletions
86
src/js/native/index.ios.js
Executable file
86
src/js/native/index.ios.js
Executable file
|
@ -0,0 +1,86 @@
|
|||
/**
|
||||
* Sample React Native App
|
||||
* https://github.com/facebook/react-native
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var levels = require('../../levels/index.js');
|
||||
var LevelStore = require('../stores/LevelStore.js');
|
||||
var levelSequences = require('../../levels').levelSequences;
|
||||
|
||||
var React = require('react-native');
|
||||
var {
|
||||
AppRegistry,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
} = React;
|
||||
|
||||
var AwesomeProject = React.createClass({
|
||||
render: function() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>
|
||||
Yo Whatup Peter
|
||||
</Text>
|
||||
{Object.keys(levelSequences).map(function(sequence) {
|
||||
return (
|
||||
<View key={sequence} style={styles.levelCard}>
|
||||
<Text style={styles.levleCardText}>
|
||||
{sequence}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
<Text style={styles.instructions}>
|
||||
To get started, edit index.ios.js
|
||||
</Text>
|
||||
<Text style={styles.instructions}>
|
||||
Press Cmd+R to reload,{'\n'}
|
||||
Cmd+Control+Z for dev menu
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: '#F5FCFF',
|
||||
},
|
||||
levelCardText: {
|
||||
justifyContent: 'center',
|
||||
flex: 1,
|
||||
},
|
||||
levelCard: {
|
||||
backgroundColor: '#EEE',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
margin: 10,
|
||||
padding: 10,
|
||||
shadowColor: '#333',
|
||||
shadowOpacity: 0.5,
|
||||
shadowRadius: 5,
|
||||
width: 200,
|
||||
shadowOffset: {
|
||||
x: 80,
|
||||
y: 80
|
||||
},
|
||||
borderRadius: 10
|
||||
},
|
||||
welcome: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
margin: 10,
|
||||
},
|
||||
instructions: {
|
||||
textAlign: 'center',
|
||||
color: '#333333',
|
||||
marginBottom: 5,
|
||||
},
|
||||
});
|
||||
|
||||
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
|
Loading…
Add table
Add a link
Reference in a new issue