uaem-na / donations-tracker

General-purpose distribution platform developed for the McGill chapter of the Universities Allied for Essential Medicine.
https://donations-tracker-dev.uaem.org
8 stars 1 forks source link

restricted individual user actions to 'offer' only #95

Closed jateen67 closed 10 months ago

jateen67 commented 10 months ago

restricted individual actions to only being able to create 'offer' posts and not 'requests' posts. also removed the 'requests' filter from the individual user's 'my posts' page.

jateen67 commented 10 months ago

Hi Ryan!

The header prop is needed to know what tab the user is on in their dashboard. I believe the requests filter should be removed from the user's My posts tab only, and the Favorites tab's filters should not be altered. I need to pass in the header so that I know what tab I'm on, and if I'm on My posts, then I don't render the requests filter.

As for React Context, as you said, for this issue it wouldn't be needed, but it could be helpful in the future. The header prop (among others) is being passed down many different components, so if it's something you're considering, we could maybe implement it to make things a bit cleaner.

Thanks for the feedback!

@shjryan