AC
WHEN I am already logged in to the dashboard, I would see a navbar to the right - top of the page.
THEN I logout to the webpage I should be able to click a button what is label logout
AND the application should logout the user and the button label should say LogIn
AND after logout is clicked in the landing page of the dashboard with cards and table should be visible.
Dev Notes
In authData.js, add a logoutNavbar.removeClass('hide'); to the if statement
In authData.js, add a logoutNavbar.addClass('hide'); to the if statement
to hide the delete, edit, and add buttons follow the same process.
In authData.js add a addBtn.addClass('hide') - to hide the delete, edit, and add buttons
const logoutNavbar = $('#navbar-button-logout');
Create a navBar component
import firebase from 'firebase/app';
import 'firebase/auth';
User Story
AC WHEN I am already logged in to the dashboard, I would see a navbar to the right - top of the page. THEN I logout to the webpage I should be able to click a button what is label logout AND the application should logout the user and the button label should say LogIn AND after logout is clicked in the landing page of the dashboard with cards and table should be visible.
Dev Notes
const logoutNavbar = $('#navbar-button-logout');
const authDiv = $('#auth'); const logoutButton = $('#navbar-button-logout');
const logoutEvent = () => { logoutButton.click((e) => { e.preventDefault(); firebase.auth().signOut() .then(() => { authDiv.classList.add('hide'); logoutButton.classList.add('hide'); }).catch((err) => console.error('you still logged in', err)); }); };
export default { logoutEvent };```