nss-evening-cohort-11 / nutshell-ewoks-droids

Star Destroyer
0 stars 2 forks source link

Create Google Login Button #12

Open Nikababy01 opened 4 years ago

Nikababy01 commented 4 years ago

USER STORY

As a user, when I should be able to login using a Google login button

AC

WHEN the page loads I should see all boards THEN click the Google Login button AND and this will log me in

WIREFRAMES

DEV NOTES


1. Add the div id to index.html <div id="auth"></div>
2. Create a component auth.js
    import firebase from 'firebase/app';
    import 'firebase/auth';
3. create a event function: 
    const signMeIn = () =>{
    const provider = new firebase.auth.GoogleAuthProvider();
    firebase.auth().signInWithPopup(provider);
};

this is a local function and does not require export

4. In the auth.js component ensure have import utils from '../../helpers/utils';
5. In auth.js create a function to login :
       const loginButton = () => {
       const domString = '<button id = "google-auth" class = "btn btn-danger">GOOGLE 
       LOGIN</button>';
       utils.printToDom('auth', domString);
       $('#google-auth').click(signMeIn);
};
export default { loginButton};

RELATED TICKETS

EX. #1