import React, { Component } from 'react';
import firebase from 'firebase'
import thunk from 'redux-thunk';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import AvailabilityScreen from './screens/AvailabilityScreen';
import MailScreen from './screens/MailScreen';
//import RegisterScreen from './screens/RegisterScreen';
import RegisterScreen from './screens/auth/RegisterScreen';
//import LoginScreen from './screens/LoginScreen';
import LoginScreen from './screens/auth/LoginScreen';
import HomeScreen from './screens/HomeScreen';
//import Loading from './components/Loading';
import Loading from './screens/main/Loading';
import { firebaseConfig } from './config/firebaseConfig';
<<<<<<< HEAD
=======
import { Text, View } from 'react-native';
import { styles } from './config/styles';
import HomeScreen from './screens/main/Home_page';
import RoomScreen from './screens/main/RoomScreen'
import { Provider} from 'react-redux'
import { createStore, applyMiddleware } from 'redux';
>>>>>>> devErnesto
import rootReducer from './redux/reducers'
if (firebase.apps.length === 0) {
firebase.initializeApp(firebaseConfig)
}
const Stack = createStackNavigator();
const Drawer = createDrawerNavigator();
const store = createStore(rootReducer, applyMiddleware(thunk));
export default class App extends Component {
constructor(props){
super(props);
this.state = {
loaded: false,
}
}
componentDidMount(){
firebase.auth().onAuthStateChanged((user) => {
if (!user){
this.setState({
loggedIn: false,
loaded: true,
})
}
else{
this.setState({
loggedIn: true,
loaded: true,
})
}
});
}
createHomeStack = () =>
render() {
const { loggedIn, loaded } = this.state
if(!loaded){
return(
);
}
if(!loggedIn){
return (
);
}
return(
<<<<<<< HEAD
=======
({ title: route.params.thread.name })} />
>>>>>>> devErnesto
);
}
}