ngoworldcommunity / NGOWorld

A platform to connect and support NGOs, charities and you to build a better tomorrow.

Home Page:https://ngoworld.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: 'SignUp' Button Displayed on Events and Shop Pages for Logged-in Users

ndmaratha opened this issue · comments

Description

Currently, a 'SignUp' button is erroneously appearing on the Events and Shop pages even when users are logged in, causing confusion and unnecessary redundancy in the user interface.

Proposed Solution

Using conditional rendering based on a useState variable isLoggedIn, which is updated according to whether the user is logged in or not (possibly by accessing a localStorage value), is a common and effective approach to resolve this issue. Here's a summary of your proposed solution:

"I plan to implement conditional rendering based on a useState variable called isLoggedIn, which will be a boolean value. This variable will be updated based on the user's login status, possibly by accessing a value stored in localStorage. By utilizing conditional rendering, I aim to dynamically display or hide the 'SignUp' button on the Events and Shop pages, ensuring that it is only shown when the user is not logged in."

Screenshots

already logged in user
showing signup to get notified still

Browser 🥦

Brave

Checklist ✅

  • I checked and didn't find similar issue
  • I have read the Contributing Guidelines
  • I am participating in JWOC
  • I am participating in IWOC
  • I am willing to work on this issue (blank for no).

Hello @ndmaratha, thank you for raising the issue.

Currently, the issue is marked as https://github.com/MilanCommunity/Milan/labels/status%3A%20todo%20%E2%8F%B3 so please wait until the maintainers/owner review it and provide you with feedback/suggestions to proceed further.

Feel free to reach out to Tamal on Twitter, or drop a mail at tamalcodes@gmail.com if you think that this issue is of critical priority.

Give us a ⭐ to show some support
Happy OpenSource 🚀

Hi, that is great, I think we are maintaining a redux store for the same.

  • Can you check if the fields in the store are updated properly ?
  • And then can you directly add the conditions based on the store value?