Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,43 @@
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
import { AppRegistry, SectionList, StyleSheet,Text, View } from 'react-native';

export default class App extends Component {
render() {
return (
<View>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
<View style={styles.container}>
<SectionList
sections={[
{title: 'A', data: ['Adanson']},
{title: 'J', data:['John', 'Joseph', 'Jojo', 'Jimmy', 'Joel']},
]}
renderItem={({item}) => <Text style={styles.item}>{item}</Text>}
renderSectionHeader={({section}) => <Text style={styles.sectionHeader}>{section.title}</Text>}
keyExtractor={(item, index) => index}
/>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 22
},
sectionHeader: {
paddingTop: 2,
paddingLeft: 10,
paddingRight: 10,
paddingBottom: 2,
fontSize: 14,
fontWeight: 'bold',
backgroundColor: 'rgba(247,247,247,1.0)',
},
item: {
padding: 10,
fontSize: 18,
height: 44,
},
})

AppRegistry.registerComponent('react-native-tutorial', () => App);