Skip to content

Conversation

@camila-carrillo
Copy link
Contributor

164 dev ℹ️ make my grants match to the current users email

Closes

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Briefly list the changes made to the code:

  1. Added support for this.
  2. And removed redundant use of that.
  3. Also this was included for reasons.

Added support for viewing a personalized “My Grants” page that filters and displays only the grants where the logged-in user is the BCAN POC. The functionality filters the existing grants page and avoids redundant use of code duplication and maintains consistent styling. This is important so that users are able to more easily see their grants, which improves usability.

Code changes:

  • Added a new route (/my-grants) in MainPage.tsx that uses the existing GrantPage component
    -Updated GrantPage.tsx to accept a new prop showOnlyMyGrants, which controls whether the page filters the grants based on the user’s email
    -Modified GrantList.tsx to conditionally filter grants by comparing each grant’s bcan_poc.POC_email to the logged-in user’s email when showOnlyMyGrants is true
    -Integrated useAuthContext() in GrantPage.tsx to retrieve the current user’s information for filtering

For Ben: The user object is accessed in GrantPage.tsx via useAuthContext(), and the user’s email is passed down to GrantList as currentUserEmail.

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Provide screenshots of any new components, styling changes, or pages.

Since the user object isn't being passed in yet from the backend, I ensured there were no errors in VSCode, confirmed that the new my-grants route correctly renders the same UI as the my-grants-route by running locally, and reviewed the filtering logic. I did not add a mock user since it would just need to be removed later, and we don't test frontend features normally.

Test Changes

If your new feature required some test to be changed or added to fit the new functionality or changes please document these changes here.

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@camila-carrillo camila-carrillo linked an issue Oct 17, 2025 that may be closed by this pull request
@janekamata janekamata self-requested a review October 18, 2025 04:56
Copy link
Contributor

@janekamata janekamata left a comment

Choose a reason for hiding this comment

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

Looks good! Congratulations on your first PR!

Copy link
Contributor

Choose a reason for hiding this comment

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

Can this file be deleted? It appears to be empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops yes i forgot i put that there when i was going to make a separate page. yes it can be deleted! my bad

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.

DEV - Make my grants match to the current users email

3 participants