safak / youtube

5.04k stars 5.47k forks source link

Add logout button in Navbar.jsx #137

Closed mdbailin closed 1 year ago

mdbailin commented 1 year ago

I have added a "logout" button that conditionally renders whenever a user is logged in to the app. The logout button makes use of the LogOut reducer and mutates the user state in addition to returning to the home page. Since only the user state is mutated, the cart state is left unchanged and the shopping cart items should persist.