From 2346b2f1a04d206181c425bc49ee0b9fcbd691fe Mon Sep 17 00:00:00 2001 From: Sam Keen Date: Tue, 18 Apr 2023 13:06:30 +0100 Subject: [PATCH] feat(governance): full width Governance and Explorer header (#3453) Co-authored-by: Matthew Russell --- apps/explorer/src/app/routes/layout.tsx | 10 ++++---- .../components/page-templates/app-layout.tsx | 23 ++++++++++++++++--- .../page-templates/template-sidebar.tsx | 12 ---------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/apps/explorer/src/app/routes/layout.tsx b/apps/explorer/src/app/routes/layout.tsx index 3e6a47b3e..c11cca676 100644 --- a/apps/explorer/src/app/routes/layout.tsx +++ b/apps/explorer/src/app/routes/layout.tsx @@ -38,14 +38,16 @@ const DialogsContainer = () => { export const Layout = () => { const isHome = Boolean(useMatch(Routes.HOME)); const { ANNOUNCEMENTS_CONFIG_URL } = useEnvironment(); + const fixedWidthClasses = 'w-full max-w-[1500px] mx-auto'; + return ( <>
{ )}
-
+
{!isHome && }
-
+
diff --git a/apps/governance/src/components/page-templates/app-layout.tsx b/apps/governance/src/components/page-templates/app-layout.tsx index 9d2a58970..a30baa017 100644 --- a/apps/governance/src/components/page-templates/app-layout.tsx +++ b/apps/governance/src/components/page-templates/app-layout.tsx @@ -1,15 +1,19 @@ import classNames from 'classnames'; import { useVegaWallet } from '@vegaprotocol/wallet'; import type { ReactNode } from 'react'; +import { AnnouncementBanner } from '@vegaprotocol/announcements'; +import { Nav } from '../nav'; +import { Networks, useEnvironment } from '@vegaprotocol/environment'; +import React from 'react'; interface AppLayoutProps { children: ReactNode; } export const AppLayout = ({ children }: AppLayoutProps) => { + const { VEGA_ENV, ANNOUNCEMENTS_CONFIG_URL } = useEnvironment(); const { isReadOnly } = useVegaWallet(); const AppLayoutClasses = classNames( - 'app w-full max-w-[1500px] mx-auto grid min-h-full', - 'border-neutral-700 lg:border-l lg:border-r', + 'app w-full max-w-[1500px] mx-auto grid', 'lg:text-body-large', { 'grid-rows-[repeat(2,min-content)_1fr_min-content]': !isReadOnly, @@ -17,5 +21,18 @@ export const AppLayout = ({ children }: AppLayoutProps) => { } ); - return
{children}
; + return ( +
+
+ {ANNOUNCEMENTS_CONFIG_URL && ( + + )} +
+
{children}
+
+ ); }; diff --git a/apps/governance/src/components/page-templates/template-sidebar.tsx b/apps/governance/src/components/page-templates/template-sidebar.tsx index 08e6be575..cf968beec 100644 --- a/apps/governance/src/components/page-templates/template-sidebar.tsx +++ b/apps/governance/src/components/page-templates/template-sidebar.tsx @@ -1,28 +1,16 @@ -import { Networks, useEnvironment } from '@vegaprotocol/environment'; import { ViewingAsBanner } from '@vegaprotocol/ui-toolkit'; -import { AnnouncementBanner } from '@vegaprotocol/announcements'; import { useVegaWallet } from '@vegaprotocol/wallet'; import React from 'react'; -import { Nav } from '../nav'; - export interface TemplateSidebarProps { children: React.ReactNode; sidebar: React.ReactNode[]; } export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) { - const { VEGA_ENV, ANNOUNCEMENTS_CONFIG_URL } = useEnvironment(); const { isReadOnly, pubKey, disconnect } = useVegaWallet(); return ( <> - {ANNOUNCEMENTS_CONFIG_URL && ( - - )} -