Skip to content

Conversation

@DarianM
Copy link
Member

@DarianM DarianM commented Dec 22, 2025

Closes #479

Requested Changes

Reduce boilerplate, enforces consistent modal pattern and improves maintainability by centralizing modal control

  • modal management into a single DialogProvider using react context
  • DialogProvider mounts once at the app root and renders the active dialog based on context state
  • cleanup widget, banner and banner-two of modals
  • memoized context values to prevent unnecessary re-renders

Custom hooks for modal logic:

  • useSaveResultModal - encapsulates save result
  • useGrantResponseHandler - appropriate success/error modals after grant response flow after wallet ownership verification

Note to reviewer: the internal logic and state of individual modal types remain unchanged; only the orchestration and rendering approach has been unified.

@github-actions
Copy link

github-actions bot commented Dec 22, 2025

Deployment results

Worker Alias URL Outcome
API - staging success
CDN - staging success
App - 8756fb3d success

Logs #20744114670

@DarianM DarianM requested a review from sidvishnoi December 22, 2025 21:22
@DarianM DarianM linked an issue Dec 22, 2025 that may be closed by this pull request
5 tasks
@DarianM DarianM requested a review from sidvishnoi December 24, 2025 14:29
@DarianM DarianM requested a review from sidvishnoi December 31, 2025 00:18
)
}

export const useSaveResultModal = () => {
Copy link
Member

Choose a reason for hiding this comment

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

This feels like it shouldn't belong to this file.

Copy link
Member

@sidvishnoi sidvishnoi left a comment

Choose a reason for hiding this comment

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

I presently can't save config from banner-two route, but the modals work well.

Image

@DarianM
Copy link
Member Author

DarianM commented Jan 5, 2026

I presently can't save config from banner-two route, but the modals work well.

will take care of this further next by creating a new save one-profile-at-a-time route API that uses the new profile type.

@DarianM DarianM requested a review from sidvishnoi January 6, 2026 10:42
@DarianM DarianM merged commit 00721b9 into main Jan 6, 2026
5 checks passed
@DarianM DarianM deleted the modal-components branch January 6, 2026 12:13
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.

[refactor] Simplify modal components structure and usage

3 participants