Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #10 Solution #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Issue #10 Solution #10

wants to merge 3 commits into from

Conversation

zacharynoel
Copy link
Owner

Changes

List Changes Introduced by this PR

  1. The fixes from solution 4 are included. This includes the fix to authReducer to properly update state with the user's email, and the fix in OrderForm to properly update 'order_item' and 'quantity' .
  2. Nav component has been updated to display the user's email address above the navigation buttons if one is found in state, and displays 'Not logged in!' otherwise. The useSelector hook is being used to pull auth data from state.

Purpose

Describe the problem or feature in addition to a link to the issues.

Approach

How does this change address the problem?

This change displays the user's status directly above the navigation buttons. If the user is logged in, it will display 'Current User: ' followed by their email address. If the user is not logged in (as in, no auth data in state due to navigating to a page directly), it will display 'Current User: Unknown!'.

Pre-Testing TODOs

What needs to be done before testing

  • There are no pre-testing steps for this task.

Testing Steps

How do the users test this change?

  1. Go to the login page and enter any email address and password then click to login.
  2. Make sure you see 'Current User: ' followed by your email address directly above the navigation buttons in the nav bar.
  3. Refresh the page to clear state, and make sure it now says 'Current User: Unknown!'.

Learning

Describe the research stage

Prior knowledge from previous tasks on using the useSelector hook to pull auth data from state. Otherwise, there was no research required for this task.

Closes Shift3#10

@zacharynoel zacharynoel changed the title Zrn 10 display user Issue #10 Solution Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: User Display in Nav
1 participant