Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved the issue #316 Added My canteen button in navbar #333

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

Praveenkumar5048
Copy link
Contributor

@Praveenkumar5048 Praveenkumar5048 commented Jun 18, 2024

I haved added a separate button called "My Canteen" in the navbar which is visible to only those who logged in as canteen user. Through this button they can access the details of the canteen that is it redirects them to section/:canteenId route.

I implemented this using conditional rendering. The code was already storing the canteenId in the local storage when user signUp to the application. In my code i am checking whether the canteenId exists in local Storage to conditionally render "My canteen" button.

Fixes #316

Type of change

Please mark with an X the type that applies:

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Refactor code
  • Documentation update
  • Other (mentioned in the issue number)

I have tested my code, it works perfectly without any errors.

Screenshots and Videos

Screenshot 2024-06-18 122938

Checklist

Please mark with an X the items that apply:

  • [ X] My code follows the style guidelines of this project
  • [X ] I have performed a self-review of my code
  • [X ] I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [X ] My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Jun 18, 2024

@Praveenkumar5048 is attempting to deploy a commit to the vansh69's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Praveenkumar5048
Copy link
Contributor Author

Praveenkumar5048 commented Jun 18, 2024

@hustlerZzZ hlo project admin, while doing the above task i have gone through entire code of this repository. During this i have encountered many bug in the code specially related to autentication, and token.

  1. The code has auth useContext setup to store the authentication state of user. But this variable "isAuthenticated" is not updated
    properly. when the user logIn this variable should be set to true, but this is not done in the code.
  2. The JWT token stored in the local storage is not cleared when the user logout.

I would like to work on this to solve this bug.
I have created a separate issue for this, please assign me that work. I will try to solve these bugs.
Thank you

@hustlerZzZ
Copy link
Collaborator

@hustlerZzZ hlo project admin, while doing the above task i have gone through entire code of this repository. During this i have encountered many bug in the code specially related to autentication, and token.

  1. The code has auth useContext setup to store the authentication state of user. But this variable "isAuthenticated" is not updated
    properly. when the user logIn this variable should be set to true, but this is not done in the code.
  2. The JWT token stored in the local storage is not cleared when the user logout.

I would like to work on this to solve this bug. I have created a separate issue for this, please assign me that work. I will try to solve these bugs. Thank you

Ok sure

@hustlerZzZ hustlerZzZ added gssoc This label is attached to the issues related to Gssoc'24 level2 labels Jun 18, 2024
Copy link
Collaborator

@hustlerZzZ hustlerZzZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

@hustlerZzZ hustlerZzZ merged commit 1d1aad7 into VanshKing30:main Jun 18, 2024
0 of 2 checks passed
Copy link

Congratulations, Your pull request has been successfully merged 🥳🎉 Thank you for your contribution to the project 🚀 Keep Contributing!! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc This label is attached to the issues related to Gssoc'24 level2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: No separate button for canteen owners to access their canteen details
2 participants