-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
161 additions
and
28 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Sample React Native App | ||
* https://github.com/facebook/react-native | ||
* @flow | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
import { | ||
StyleSheet, | ||
Text, | ||
TouchableOpacity, | ||
Image, | ||
View | ||
} from 'react-native'; | ||
|
||
import colors from '../utils/colors'; | ||
|
||
const placeholder = require('../assets/default.png'); | ||
|
||
const ListItem = ({ text, imageUrl }) => { | ||
const image = ( | ||
imageUrl ? {uri: imageUrl} : placeholder | ||
); | ||
|
||
return ( | ||
<TouchableOpacity | ||
underlayColor={ colors.grey }> | ||
|
||
<View style={ styles.mediaObject}> | ||
<Image source={ image } style={ styles.image }/> | ||
<Text style={ styles.text }> { text }</Text> | ||
</View> | ||
|
||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
export default ListItem; | ||
|
||
const styles = StyleSheet.create({ | ||
mediaObject: { | ||
flex: 1, | ||
alignItems: 'center', | ||
flexDirection: 'row', | ||
marginBottom: 10, | ||
}, | ||
text: {flex: 1}, | ||
image: { | ||
backgroundColor: colors.grey, | ||
width: 40, | ||
height: 40, | ||
marginRight: 16, | ||
marginLeft: 16, | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* Sample React Native App | ||
* https://github.com/facebook/react-native | ||
* @flow | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
import { | ||
AppRegistry, | ||
StyleSheet, | ||
Text, | ||
View | ||
} from 'react-native'; | ||
|
||
export default class Main extends Component { | ||
render() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.welcome}> | ||
Welcome to React Native modified from Main ! | ||
</Text> | ||
<Text style={styles.instructions}> | ||
To get started, edit index.ios.js | ||
</Text> | ||
<Text style={styles.instructions}> | ||
Press Cmd+R to reload,{'\n'} | ||
Cmd+D or shake for dev menu | ||
</Text> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1,/*import colors from './utils/colors';*/ | ||
|
||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: '#F5FCFF', | ||
}, | ||
welcome: { | ||
fontSize: 20, | ||
textAlign: 'center', | ||
margin: 10, | ||
}, | ||
instructions: { | ||
textAlign: 'center', | ||
color: '#333333', | ||
marginBottom: 5, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export default { | ||
black: '#444', | ||
white: '#fff', | ||
blue: '#3456DA' | ||
blue: '#3456DA', | ||
grey: '#C0C0C0' | ||
} |