From c9baae2c09679c625baad937692ddfbb998a9782 Mon Sep 17 00:00:00 2001 From: Advait Jayant Date: Thu, 14 May 2026 19:04:47 +0100 Subject: [PATCH 1/3] Align explorer with OpenGradient brand --- configs/app/features/growthBook.ts | 2 +- configs/app/ui.ts | 2 +- lib/hooks/useNavItems.tsx | 4 - nextjs/csp/policies/app.ts | 1 + nextjs/headers.js | 2 +- pages/_document.tsx | 8 +- toolkit/chakra/input-group.tsx | 4 +- toolkit/chakra/table.tsx | 15 +- .../AdaptiveTabs/AdaptiveTabsList.tsx | 3 +- toolkit/theme/foundations/animations.ts | 4 + toolkit/theme/foundations/colors.ts | 56 +- toolkit/theme/foundations/semanticTokens.ts | 74 +-- toolkit/theme/foundations/typography.ts | 11 +- toolkit/theme/globalCss.ts | 7 +- toolkit/theme/recipes/table.recipe.ts | 15 +- ui/blocks/BlocksContent.tsx | 11 +- ui/blocks/BlocksTabSlot.tsx | 5 +- ui/gasTracker/GasTrackerChart.tsx | 139 ++-- .../GasTrackerNetworkUtilization.tsx | 23 +- ui/gasTracker/GasTrackerPriceSnippet.tsx | 118 +++- ui/gasTracker/GasTrackerPrices.tsx | 13 +- ui/home/HeroBanner.tsx | 488 ++++++--------- ui/home/LatestBlocks.tsx | 59 +- ui/home/LatestBlocksItem.tsx | 301 ++++----- ui/home/LatestTxs.tsx | 134 ++-- ui/home/LatestTxsItem.tsx | 303 ++++----- ui/home/LatestTxsItemMobile.tsx | 55 +- ui/home/Stats.tsx | 45 +- ui/home/Transactions.tsx | 10 +- ui/home/brand.ts | 30 + .../indicators/ChainIndicatorChartContent.tsx | 13 +- ui/home/indicators/ChainIndicators.tsx | 125 ++-- ui/home/indicators/useChartDataQuery.tsx | 20 +- ui/home/utils/isStatsMicroserviceEnabled.ts | 11 + ui/opengradient/brand.ts | 1 + .../teeRegistry/TEENodeDetailDrawer.tsx | 111 ++-- ui/opengradient/teeRegistry/TEENodesTable.tsx | 302 +++++---- ui/opengradient/teeRegistry/TEETypeCard.tsx | 143 +++-- ui/pages/Accounts.tsx | 18 +- ui/pages/Blocks.tsx | 15 +- ui/pages/GasTracker.tsx | 8 +- ui/pages/Home.tsx | 28 +- ui/pages/InternalTxs.tsx | 15 +- ui/pages/Transactions.tsx | 14 +- ui/pages/VerifiedContracts.tsx | 15 +- ui/pages/opengradient/TEERegistry.tsx | 591 ++++++++---------- ui/shared/ActionBar.tsx | 6 +- ui/shared/Page/ExplorerPageSurface.tsx | 26 + ui/shared/Page/ExplorerPageTitle.tsx | 62 ++ ui/shared/Page/PageTitle.tsx | 16 +- ui/shared/chart/ChartArea.tsx | 3 +- ui/shared/chart/ChartWatermarkIcon.tsx | 19 +- ui/shared/chart/ChartWidget.tsx | 8 +- ui/shared/layout/LayoutApp.tsx | 2 + ui/shared/layout/LayoutHome.tsx | 2 + ui/shared/layout/components/Container.tsx | 5 +- ui/shared/stats/StatsWidget.tsx | 20 +- ui/snippets/colorMode/ColorModeToggle.tsx | 101 +++ ui/snippets/header/HeaderDesktop.tsx | 21 +- ui/snippets/header/HeaderMobile.tsx | 2 + .../navigation/useNavLinkStyleProps.tsx | 4 +- ui/snippets/navigation/vertical/NavLink.tsx | 21 +- .../navigation/vertical/NavLinkGroup.tsx | 39 +- .../navigation/vertical/NavigationDesktop.tsx | 23 +- ui/snippets/searchBar/SearchBarInput.tsx | 67 +- ui/txs/TxsContent.tsx | 9 +- 66 files changed, 2027 insertions(+), 1801 deletions(-) create mode 100644 ui/home/brand.ts create mode 100644 ui/home/utils/isStatsMicroserviceEnabled.ts create mode 100644 ui/opengradient/brand.ts create mode 100644 ui/shared/Page/ExplorerPageSurface.tsx create mode 100644 ui/shared/Page/ExplorerPageTitle.tsx create mode 100644 ui/snippets/colorMode/ColorModeToggle.tsx diff --git a/configs/app/features/growthBook.ts b/configs/app/features/growthBook.ts index af672c5ac9..651e628ca6 100644 --- a/configs/app/features/growthBook.ts +++ b/configs/app/features/growthBook.ts @@ -7,7 +7,7 @@ const clientKey = getEnvValue('NEXT_PUBLIC_GROWTH_BOOK_CLIENT_KEY'); const title = 'GrowthBook feature flagging and A/B testing'; const config: Feature<{ clientKey: string }> = (() => { - if (clientKey) { + if (clientKey && clientKey !== 'xxx') { return Object.freeze({ title, isEnabled: true, diff --git a/configs/app/ui.ts b/configs/app/ui.ts index 674580d944..b2eba474e3 100644 --- a/configs/app/ui.ts +++ b/configs/app/ui.ts @@ -49,7 +49,7 @@ const highlightedRoutes = (() => { const defaultColorTheme = (() => { const envValue = getEnvValue('NEXT_PUBLIC_COLOR_THEME_DEFAULT') as ColorThemeId | undefined; - return COLOR_THEMES.find((theme) => theme.id === envValue); + return COLOR_THEMES.find((theme) => theme.id === envValue) ?? COLOR_THEMES.find((theme) => theme.id === 'light'); })(); const UI = Object.freeze({ diff --git a/lib/hooks/useNavItems.tsx b/lib/hooks/useNavItems.tsx index 7f6ac5e01b..0d7238664a 100644 --- a/lib/hooks/useNavItems.tsx +++ b/lib/hooks/useNavItems.tsx @@ -300,10 +300,6 @@ export default function useNavItems(): ReturnType { url: 'https://hub.opengradient.ai', icon: 'apps', }, - { - text: 'Testnet V1 Explorer', - url: 'https://testnetv1.opengradient.ai', - }, ].filter(Boolean); const accountNavItems: ReturnType['accountNavItems'] = [ diff --git a/nextjs/csp/policies/app.ts b/nextjs/csp/policies/app.ts index e445281572..ae0c3ecbd0 100644 --- a/nextjs/csp/policies/app.ts +++ b/nextjs/csp/policies/app.ts @@ -115,6 +115,7 @@ export function app(): CspDev.DirectiveDescriptor { ], 'font-src': [ + KEY_WORDS.SELF, KEY_WORDS.DATA, ...MAIN_DOMAINS, ...(externalFontsDomains || []), diff --git a/nextjs/headers.js b/nextjs/headers.js index c38f294879..1d35384404 100644 --- a/nextjs/headers.js +++ b/nextjs/headers.js @@ -22,7 +22,7 @@ async function headers() { }, { key: 'Cross-Origin-Opener-Policy', - value: 'same-origin', + value: 'same-origin-allow-popups', }, { key: 'Referrer-Policy', diff --git a/pages/_document.tsx b/pages/_document.tsx index 61ee1a3284..c3ca6875e2 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -34,17 +34,19 @@ class MyDocument extends Document { { /* FONTS */ } + + { /* eslint-disable-next-line @next/next/no-sync-scripts */ }