April 2020
Intermediate to advanced
716 pages
18h 55m
English
In the frontend of the marketplace application, we can render different options based on whether the user currently browsing the application has an active seller account. In this section, we will add the code to conditionally display a link to MY SHOPS on the navigation bar, which will only be visible to the signed-in users who have active seller accounts.
We will update the Menu component within the previous code so that it only renders when a user is signed in, as follows:
mern-marketplace/client/core/Menu.js:
{auth.isAuthenticated().user.seller && (<Link to="/seller/shops"> <Button color = {isPartActive(history, "/seller/")}> My Shops </Button> </Link>)}
This MY SHOPS link on the navigation bar will take users with active ...
Read now
Unlock full access