To support adding a conditional link to the user dropdown - these are just my loose notes, any dev picking this up please feel free to do whatever works best for you
- For logged in users dropdown, logged out dropdown will be unaffected
- static list that are each mapped into
GlobalAccountUserLinks byGlobalAccountUser
Gather user demographics from store and pass (as demographics key, so we can later pass other objects by name) into function defined on the user-logged-in.js list entry that determines whether or not the link can show, maybe something like function canDisplay({ demographics }) that just returns a boolean?
- Lets us re-use this approach to conditionally render other links in this dropdown, even if they require other data (BP?), in the future
- migrate
buildURLfunctionality out of GlobalAccountUserLink.jsx and into the links themselves - make GlobalAccountUser.jsx fetch user demographics from UserStore
- add check within
mapfunction in GlobalAccountUser.jsx to callcanDisplaywith demographics data and only return the GlobalAccountUserLink when appropriate