Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. import React, { Fragment } from 'react';
  2. import PushController from './PushController';
  3. import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, FlatList} from 'react-native';
  4.  
  5. import {Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions } from 'react-native/Libraries/NewAppScreen';
  6. // Dummy data for list, we'll replace this with data received from push
  7. let pushData = [
  8. {
  9. title: "First push",
  10. message: "First push message"
  11. },
  12. {
  13. title: "Second push",
  14. message: "Second push message"
  15. }
  16. ]
  17.  
  18. _renderItem = ({ item }) => (
  19. <View key={item.title}>
  20. <Text style={styles.title}>{item.title}</Text>
  21. <Text style={styles.message}>{item.message}</Text>
  22. </View>
  23. );
  24.  
  25. const App = () => {
  26. return (
  27. <Fragment>
  28. <StatusBar barStyle="dark-content" />
  29. <SafeAreaView>
  30. <ScrollView
  31. contentInsetAdjustmentBehavior="automatic"
  32. style={styles.scrollView}>
  33. <Header />
  34. <View style={styles.listHeader}>
  35. <Text>Push Notifications</Text>
  36. </View>
  37. <View style={styles.body}>
  38. <FlatList
  39. data={pushData}
  40. renderItem={(item ) => this._renderItem(item)}
  41. keyExtractor={(item ) => item.title}
  42. />
  43. {/* <LearnMoreLinks /> */}
  44. </View>
  45. </ScrollView>
  46. </SafeAreaView>
  47. <PushController/>
  48. </Fragment>
  49. );
  50. };
  51.  
  52. const styles = StyleSheet.create({
  53. scrollView: {backgroundColor: Colors.lighter,},
  54. listHeader:{ backgroundColor: '#eee', color: "#222", height: 44, padding: 12},
  55. title:{fontSize: 18, fontWeight: 'bold', paddingTop: 10},
  56. message:{ fontSize: 14, paddingBottom: 15, borderBottomColor: "#ccc", borderBottomWidth: 1},
  57. engine: { position: 'absolute', right: 0,},
  58. body: { backgroundColor: Colors.white, paddingHorizontal: 20, paddingVertical: 10, },
  59. sectionContainer: { marginTop: 32, paddingHorizontal: 24, },
  60. sectionTitle: { fontSize: 24, fontWeight: '600', color: Colors.black},
  61. sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', color: Colors.dark,},
  62. highlight: { fontWeight: '700'},
  63. footer: { color: Colors.dark, fontSize: 12, fontWeight: '600', padding: 4, paddingRight: 12, textAlign: 'right',},
  64. });
  65.  
  66. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement