Skip to content

If not logged in, login Alert is not pinned on homepage#49

Open
DhairyaBahl wants to merge 1 commit into
brigadecore:mainfrom
DhairyaBahl:loginToSeeContentBannerFix
Open

If not logged in, login Alert is not pinned on homepage#49
DhairyaBahl wants to merge 1 commit into
brigadecore:mainfrom
DhairyaBahl:loginToSeeContentBannerFix

Conversation

@DhairyaBahl

Copy link
Copy Markdown
Contributor

Fixes #16

If not logged in, you shouldn't get pinned to the homepage.

Signed-off-by: dhairyabahl <dhairyabahl5@gmail.com>
@DhairyaBahl DhairyaBahl force-pushed the loginToSeeContentBannerFix branch from d78af3e to 3bac164 Compare March 15, 2022 11:16
@DhairyaBahl

DhairyaBahl commented Mar 15, 2022

Copy link
Copy Markdown
Contributor Author

@krancour Facing a small problem right now. In the logged out state, when I simply open the / route and then navigate to some other route, then the alert is still not shown. I am unable to detect the route change for the react component. There are many workarounds to do so but I am not sure which one is perfect. One simple way is to make the component re-render on route change but that would be quite heavy. Still trying to find the perfect way to do so.

Kindly tell me what is the perfect way and I will work on that asap. Thanks :)

Edit

According to me, best way is to simply convert the component to a functional component and we can then simply use the useLocation Hook or if we want to achieve the same result with the existing class component, then we can simply use the concept of higherOrderComponent with the useLocation hook like its shown over here

@krancour

Copy link
Copy Markdown
Contributor

Let's put closure on #48 before we go too deep down this rabbit hole. I imagine that where we land on #48 may affect what our options are here.

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.

If not logged in, you shouldn't get pinned to the homepage

2 participants