feat(settings): connect NotificationSettings to persistent reminder p… - #554
Open
benedictworks-home wants to merge 2 commits into
Conversation
…references Wires the notification preferences toggles in NotificationSettings to settingsStore. Implements useFundingReminder and useRepaymentReminder hooks to complement useMaturityReminder. Ensures all reminder hooks respect user preferences globally, with immediate dismissal of active toasts when toggled off. Fully localizes labels across English, Spanish, Portuguese, and Arabic, and adds unit tests. Co-authored-by: benedictworks-home <277016530+benedictworks-home@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves Issue #518 — Wire NotificationSettings to maturity and funding reminder prefs by connecting the notification preferences toggles in the UI to a persistent client-side store and ensuring that all corresponding reminders respect these user preferences globally.
Key Changes
State Persistence (
store/settingsStore.ts)notificationsstate object containing preferences formaturity,fundingFilled, andrepaymentDuereminders.trueby default (opt-out safety approach).Reminder Gating & Dismissal (
hooks/)useMaturityReminderto honor thematuritysetting.useFundingReminderanduseRepaymentReminderhooks to handle their respective settings."maturityReminder","fundingAlert","repaymentAlert") when any setting is toggled off.useContractEvents.tsx) and the central notification filter (useToast.tsx) to guarantee that both mock and live Web3 chain event alerts strictly honor user preferences.Complete Localization (i18n)
NotificationSettings.tsx.messages/en.json(English)messages/es.json(Spanish)messages/pt-BR.json(Portuguese - Brazil)messages/ar.json(Arabic)Testing Suite (
hooks/__tests__/useReminderPrefs.test.tsx)Verification Run Results
All validation checks have been run locally and passed successfully:
npm run lint— ✔ No ESLint warnings or errors.npm run type-check— Success (0 errors).npm run test -- hooks/__tests__/useReminderPrefs.test.tsx— 11/11 tests green.npm run build— Production build completed successfully with no errors.Acceptance Criteria Checklist
Closes #518