Guest User

Dashboard.js (Screen freezes)

a guest
Aug 17th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import { View, Text, TouchableOpacity, ScrollView, StyleSheet } from 'react-native';
  3. import { color } from '../constants/StyleConstants';
  4. import AppHeader from '../components/AppHeader';
  5. import Permissions from 'react-native-permissions';
  6. import ConnectivityManager from 'react-native-connectivity-status'
  7. import AppUser from '../apiServices/AppUser'
  8. import { StackActions, NavigationActions } from 'react-navigation';
  9. import Store from 'rn-json-store';
  10. import {USER_TOKEN} from '../constants/KeyConstants';
  11. import CalenderThreeDay from "./CalenderThreeDay";
  12. import CalendarDayView from "./CalendarDayView";
  13. import CalendarYearView from "./CalendarYearView";
  14. import ShareWithCalendar from "./ShareWithCalendar";
  15. import ShareWithAccount from "./ShareWithAccount";
  16. import CalendarSetting from "./CalendarSetting";
  17. import userStore from '../mobx/UserStore'
  18. import { strings } from '../localization/Localization';
  19.  
  20. let appUser = AppUser.getInstance()
  21. var classObj
  22. export default class Dashboard extends Component {
  23. constructor(props){
  24.     super(props);
  25.     classObj=this;
  26. }
  27.     componentWillMount() {
  28.         console.log('ji');
  29.         userStore.setListCategory(strings.GENERAL, 0);        
  30.         appUser.locationPermission()
  31.     }
  32.     onAddButtonPress() {
  33.         classObj.props.navigation.navigate('CreateList');
  34.     }
  35.     onHomePress(){
  36.     }
  37.     render() {
  38.         return (
  39.             <View style={{ flex: 1, backgroundColor: color.WHITE_COLOR, alignItems: 'center' }}>
  40.                 <AppHeader onAddButton={this.onAddButtonPress} onHomePress={this.onHomePress}/>
  41.                 {/* <Text>dashboard</Text> */}
  42.                 <ScrollView showsVerticalScrollIndicator={false} style={{flex:1,width:"100%"}}>
  43.                 <View style={{alignItems:'center'}}>
  44.                     <TouchableOpacity style={style.button} onPress={() => {
  45.                         this.props.navigation.navigate({ routeName: CalendarYearView.SCREEN_KEY });
  46.                     }}>
  47.                         <Text>Calender Year View</Text>
  48.                     </TouchableOpacity>
  49.                     </View>
  50.                 </ScrollView>
  51.                
  52.             </View>
  53.         );
  54.     }
  55. }
  56.  
  57. const style = StyleSheet.create({
  58.     button: {
  59.         width: 100, height: 50, backgroundColor: 'grey', justifyContent: 'center', alignItems: 'center', marginTop: 50
  60.     }
  61. });
Add Comment
Please, Sign In to add comment