|
1 |
| -/** |
2 |
| - * Sample React Native App |
3 |
| - * https://github.com/facebook/react-native |
4 |
| - * @flow |
5 |
| - */ |
| 1 | +// Import a Library to help create a Component |
| 2 | +import React, {Component} from 'react'; |
| 3 | +import { Text, AppRegistry, ScrollView } from 'react-native'; |
| 4 | +import Header from './src/components/header'; |
| 5 | +import AlbumList from './src/components/AlbumList'; |
6 | 6 |
|
7 |
| -import React, { Component } from 'react'; |
8 |
| -import { |
9 |
| - Platform, |
10 |
| - StyleSheet, |
11 |
| - Text, |
12 |
| - View |
13 |
| -} from 'react-native'; |
14 | 7 |
|
15 |
| -const instructions = Platform.select({ |
16 |
| - ios: 'Press Cmd+R to reload,\n' + |
17 |
| - 'Cmd+D or shake for dev menu', |
18 |
| - android: 'Double tap R on your keyboard to reload,\n' + |
19 |
| - 'Shake or press menu button for dev menu', |
20 |
| -}); |
21 |
| - |
22 |
| -export default class App extends Component<{}> { |
23 |
| - render() { |
24 |
| - return ( |
25 |
| - <View style={styles.container}> |
26 |
| - <Text style={styles.welcome}> |
27 |
| - Welcome to React Native! |
28 |
| - </Text> |
29 |
| - <Text style={styles.instructions}> |
30 |
| - To get started, edit App.js |
31 |
| - </Text> |
32 |
| - <Text style={styles.instructions}> |
33 |
| - {instructions} |
34 |
| - </Text> |
35 |
| - </View> |
36 |
| - ); |
| 8 | +export default class albums extends Component{ |
| 9 | + render(){ |
| 10 | + return( |
| 11 | + <ScrollView> |
| 12 | + <Header headerText={'Albums'}/> |
| 13 | + <AlbumList /> |
| 14 | + </ScrollView> |
| 15 | + ) |
37 | 16 | }
|
38 |
| -} |
| 17 | +}; |
39 | 18 |
|
40 |
| -const styles = StyleSheet.create({ |
41 |
| - container: { |
42 |
| - flex: 1, |
43 |
| - justifyContent: 'center', |
44 |
| - alignItems: 'center', |
45 |
| - backgroundColor: '#F5FCFF', |
46 |
| - }, |
47 |
| - welcome: { |
48 |
| - fontSize: 20, |
49 |
| - textAlign: 'center', |
50 |
| - margin: 10, |
51 |
| - }, |
52 |
| - instructions: { |
53 |
| - textAlign: 'center', |
54 |
| - color: '#333333', |
55 |
| - marginBottom: 5, |
56 |
| - }, |
57 |
| -}); |
| 19 | +//Render it to the device |
| 20 | +AppRegistry.registerComponent('albums', () => App); |
0 commit comments