Browse Source

Compila sin errores. La navegación va de register a home, y redux está implementado. El registro aparece en la DB.

ErnestoOrtiz2 3 years ago
parent
commit
ea9bb69c47
2 changed files with 16 additions and 5 deletions
  1. 5
    4
      App.js
  2. 11
    1
      screens/main/Home_page.js

+ 5
- 4
App.js View File

14
 import { createStore, applyMiddleware } from 'redux';
14
 import { createStore, applyMiddleware } from 'redux';
15
 import rootReducer from './redux/reducers'
15
 import rootReducer from './redux/reducers'
16
 import thunk from 'redux-thunk'
16
 import thunk from 'redux-thunk'
17
-import { connect } from 'react-redux'
17
+/*import { connect } from 'react-redux'
18
 import { bindActionCreators } from 'redux' 
18
 import { bindActionCreators } from 'redux' 
19
-import { fetchUser } from './redux/actions/index'
19
+import { fetchUser } from './redux/actions/index'*/
20
 /*const seConfig = {
20
 /*const seConfig = {
21
   apiKey: "AIzaSyDW-ABAQ3r_WR7C7WC_3VprL77NcAoitJI",
21
   apiKey: "AIzaSyDW-ABAQ3r_WR7C7WC_3VprL77NcAoitJI",
22
   authDomain: "freehand-d8ecd.firebaseapp.com",
22
   authDomain: "freehand-d8ecd.firebaseapp.com",
96
   }
96
   }
97
 }
97
 }
98
 
98
 
99
-const mapStateToProps = (store) => ({
99
+export default App
100
+/*const mapStateToProps = (store) => ({
100
   currentUser: store.userState.currentUser
101
   currentUser: store.userState.currentUser
101
 })
102
 })
102
 const mapDispatchProps = (dispatch) => bindActionCreators({fetchUser}, dispatch);
103
 const mapDispatchProps = (dispatch) => bindActionCreators({fetchUser}, dispatch);
103
 
104
 
104
-export default connect(mapStateToProps, mapDispatchProps)(App);
105
+export default connect(mapStateToProps, mapDispatchProps)(App);*/

+ 11
- 1
screens/main/Home_page.js View File

9
 import { styles } from "../../config/styles";
9
 import { styles } from "../../config/styles";
10
 import { TextInput, TouchableWithoutFeedback, Keyboard, ImageBackground} from "react-native";
10
 import { TextInput, TouchableWithoutFeedback, Keyboard, ImageBackground} from "react-native";
11
 
11
 
12
-export default function Home_page({navigation}) {
12
+
13
+import { connect } from 'react-redux'
14
+import { bindActionCreators } from 'redux' 
15
+import { fetchUser } from '../../redux/actions/index'
16
+
17
+export function Home_page({navigation}) {
13
   const [threads, setThreads] = useState([]);  
18
   const [threads, setThreads] = useState([]);  
14
   const [loading, setLoading] = useState(true);
19
   const [loading, setLoading] = useState(true);
15
 
20
 
82
     );
87
     );
83
   }
88
   }
84
 
89
 
90
+const mapStateToProps = (store) => ({
91
+  currentUser: store.userState.currentUser
92
+})
93
+const mapDispatchProps = (dispatch) => bindActionCreators({fetchUser}, dispatch);
85
 
94
 
95
+export default connect(mapStateToProps, mapDispatchProps)(Home_page);
86
 
96
 
87
 
97
 
88
 
98