feat: disable governance view and show external frontends modal#53
Open
aminsammara wants to merge 2 commits intomainfrom
Open
feat: disable governance view and show external frontends modal#53aminsammara wants to merge 2 commits intomainfrom
aminsammara wants to merge 2 commits intomainfrom
Conversation
Replace direct governance access with a modal that directs users to external community-hosted governance frontends. The governance code is preserved but inaccessible. - Add ExternalGovernanceModal component - Add configurable external frontends list - Modify Navbar to show modal instead of navigating - Redirect /governance URLs to home
There was a problem hiding this comment.
Pull request overview
This PR disables the in-app Governance section while preserving the existing governance implementation, replacing the Governance nav behavior with a modal that directs users to community-hosted external governance frontends, and redirecting direct /governance URL access back to home.
Changes:
- Redirect
/governance/*routes to/to prevent direct governance page access. - Add a configurable list of external governance frontends and a new modal UI to display them.
- Update the Navbar “Governance” entry to open the modal instead of navigating.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
staking-dashboard/src/routes/AppRoutes.tsx |
Removes governance route usage and redirects /governance/* to home. |
staking-dashboard/src/config/externalGovernance.ts |
Adds config/type definitions for external governance frontends. |
staking-dashboard/src/components/Navbar/Navbar.tsx |
Replaces Governance navigation with modal open behavior (desktop + mobile). |
staking-dashboard/src/components/ExternalGovernanceModal/index.ts |
Barrel export for the new modal component. |
staking-dashboard/src/components/ExternalGovernanceModal/ExternalGovernanceModal.tsx |
Implements the modal and renders the configured external frontends list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| name: "Aztec Governance", | ||
| hostedBy: "Nethermind", | ||
| url: undefined, // Coming soon - replace with URL when live: "http://aztecgov.nethermind.io/" |
Comment on lines
+41
to
+46
| <button | ||
| onClick={() => setIsGovernanceModalOpen(true)} | ||
| className="font-oracle-standard text-sm uppercase tracking-wider text-parchment/80 hover:text-chartreuse transition-colors font-medium" | ||
| > | ||
| GOVERNANCE | ||
| </button> |
Comment on lines
+82
to
+90
| <button | ||
| onClick={() => { | ||
| closeMenu() | ||
| setIsGovernanceModalOpen(true) | ||
| }} | ||
| className="block font-oracle-standard text-base uppercase tracking-wider text-parchment hover:text-chartreuse transition-colors font-medium py-2 text-left w-full" | ||
| > | ||
| GOVERNANCE | ||
| </button> |
| if (!isOpen) return null; | ||
|
|
||
| return createPortal( | ||
| <div className="fixed inset-0 backdrop-blur-xs z-50 flex items-center justify-center p-4"> |
| {/* Frontends List */} | ||
| <div className="space-y-4"> | ||
| {EXTERNAL_GOVERNANCE_FRONTENDS.map((frontend, index) => ( | ||
| <FrontendItem key={index} frontend={frontend} /> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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
/governanceredirects to homeChanges
src/config/externalGovernance.ts- Configurable list of external frontendssrc/components/ExternalGovernanceModal/- Modal componentsrc/components/Navbar/Navbar.tsx- Governance link opens modal instead of navigatingsrc/routes/AppRoutes.tsx- Redirects/governanceto homeConfiguration
External frontends are configured in
src/config/externalGovernance.ts:Adding a live frontend
Showing "Coming Soon"