-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor(all): add events collection. Home page based on user.role
#14
Conversation
This PR is too large and may need to be broken into smaller pieces. |
- Remove extra `SavedContext` and corresponde `useSaved` hook. - Create `useSavedOrgs` hook to directly use `UserContext` to handle global state. - Add auto-fetch `organizationProfiles` into `UserContext` every time session refresh and listen to firebase updates. - Directly saved to `Session storage` which will save quotas and ensure speed.
…n `user.role` BREAKING CHANGE: Schema modified. Now all user have joinedEvents array which only have eventID correspond to the event they have joined. Also, `events` collection added to firebase which have all the events. Home page is now based on `user.role`. If user is donor, they will see the `DonorDashboard` and if user is organization, they will see `OrganizationDashboard`.
15b94d4
to
1ff8ce2
Compare
This PR is too large and may need to be broken into smaller pieces. |
🚀 Preview for this PR is available at: https://openhands-48a60--pr-14-2qh7mtgh.web.app 🧪 Test Results✅ Tests Passed: All tests passed successfully! 🎨 Prettier Format Check✅ Prettier: No formatting issues found! 🎨 Lint Check✅ Lint: No linting issues found! |
This PR is too large and may need to be broken into smaller pieces. |
🚀 Preview for this PR is available at: https://openhands-48a60--pr-14-2qh7mtgh.web.app 🧪 Test Results✅ Tests Passed: All tests passed successfully! 🎨 Prettier Format Check✅ Prettier: No formatting issues found! 🎨 Lint Check✅ Lint: No linting issues found! |
Refactored
Home
:DonorDashboard
orOrganizationDashboard
based onuser.role
.Firebase Updates:
events
collection to centralize event management.joinedEvents
as an array of event IDs for bothDonorProfile
andOrganizationProfile
.Component Updates:
DonationModal
to align with the newDonationEvent
schema (1:1 relationship between donor and event).Schedule
to fetch and display events dynamically, adding visual indicators for event dates on the calendar.Hook Improvements:
useEvents
to handle creating, updating, and deleting events in theevents
collection.useUser
for role-based event logic.Type Updates:
DonationEvent
type for better clarity and alignment with the new schema.Breaking Changes:
events
collection; users now reference events viajoinedEvents
.