ngoworldcommunity / NGOWorld

A platform to connect and support NGOs, charities and you to build a better tomorrow.
https://ngoworld.org
MIT License
353 stars 412 forks source link

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

Closed ndmaratha closed 3 months ago

ndmaratha commented 4 months ago

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 ✅

github-actions[bot] commented 4 months ago

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 🚀

tamalCodes commented 4 months ago

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