From 481daac70c36e3b8a64b6fb067aa640d17b8adae Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 5 Aug 2020 22:04:23 -0700 Subject: [PATCH] Added a testing sign in method for Redux. --- App.js | 2 + components/signin.component.jsx | 36 +++ firebase/firebase.utils.js | 135 +++++----- package.json | 1 + redux/root.saga.js | 4 +- redux/user/user.reducer.js | 78 +++--- redux/user/user.sagas.js | 86 +------ yarn.lock | 425 +++++++++++++++++++++++++++++++- 8 files changed, 579 insertions(+), 188 deletions(-) create mode 100644 components/signin.component.jsx diff --git a/App.js b/App.js index 9a17e88..ceb523c 100644 --- a/App.js +++ b/App.js @@ -10,6 +10,7 @@ import { import { store, persistor } from "./redux/store"; import { Provider } from "react-redux"; import { PersistGate } from "redux-persist/integration/react"; +import SignIn from "./components/signin.component"; export default function App() { return ( @@ -19,6 +20,7 @@ export default function App() { Open up App.js to start working on your app! ttt + diff --git a/components/signin.component.jsx b/components/signin.component.jsx new file mode 100644 index 0000000..d082b20 --- /dev/null +++ b/components/signin.component.jsx @@ -0,0 +1,36 @@ +import React from "react"; +import { View, Text, Button } from "react-native"; +import { createStructuredSelector } from "reselect"; + +import { + selectBodyshop, + selectCurrentUser, +} from "../redux/user/user.selectors"; +import { emailSignInStart } from "../redux/user/user.actions"; +import { connect } from "react-redux"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, + currentUser: selectCurrentUser, +}); + +const mapDispatchToProps = (dispatch) => ({ + emailSignInStart: (email, password) => + dispatch(emailSignInStart({ email, password })), +}); + +export function SignIn({ bodyshop, currentUser, emailSignInStart }) { + return ( + + The secondary view + {JSON.stringify(currentUser)} +