From 769a9538796729b54b07ad68cac7ff0ee442a9b2 Mon Sep 17 00:00:00 2001 From: Alexandria Roberts Date: Wed, 16 Mar 2022 12:12:21 +0800 Subject: [PATCH 1/6] imported Layout component --- components/Container.tsx | 23 ------------------ layout/Layout.tsx | 50 ---------------------------------------- layout/index.ts | 1 - pages/_app.tsx | 43 ++++++++++++++++++++++++++++++---- 4 files changed, 39 insertions(+), 78 deletions(-) delete mode 100644 components/Container.tsx delete mode 100644 layout/Layout.tsx diff --git a/components/Container.tsx b/components/Container.tsx deleted file mode 100644 index 4b222fc2f2af..000000000000 --- a/components/Container.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { HTMLAttributes } from 'react' - -// TODO: Move to `@edgeandnode/components` - -// TODO: Add `maxWidth` and `padding` props -export type ContainerProps = HTMLAttributes - -export const Container = ({ children, ...props }: ContainerProps) => { - return ( -
- {children} -
- ) -} diff --git a/layout/Layout.tsx b/layout/Layout.tsx deleted file mode 100644 index 90dc9c6f3aba..000000000000 --- a/layout/Layout.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { PropsWithChildren, useMemo } from 'react' -import NextLink from 'next/link' -import { NavigationMarketing, Footer, LocaleSwitcher, Flex } from '@edgeandnode/components' - -import { Container } from '@/components' - -export const Layout = ({ children }: PropsWithChildren<{}>) => { - const localeSwitcher = useMemo(() => , []) - - return ( -
-
- -
- - - -
-
- {children} -
-
- -
-
-
-
-
-
-
- ) -} diff --git a/layout/index.ts b/layout/index.ts index 1d8d8016780c..5c3df2deb58d 100644 --- a/layout/index.ts +++ b/layout/index.ts @@ -1,4 +1,3 @@ -export * from './Layout' export * from './MDXLayout' export * from './MDXLayoutNav' export * from './MDXLayoutPagination' diff --git a/pages/_app.tsx b/pages/_app.tsx index 6186e62334dc..a35b81c28d65 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,11 +1,21 @@ import { useMemo, useCallback, useEffect } from 'react' import { AppProps } from 'next/app' +import NextLink from 'next/link' import { DefaultSeo, DefaultSeoProps } from 'next-seo' import { useRouter } from 'next/router' -import { Locale, defaultLocale, extractLocaleFromPath, I18nProvider, ThemeProvider } from '@edgeandnode/components' +import { + Layout, + NavigationMarketing, + Footer, + Locale, + defaultLocale, + extractLocaleFromPath, + I18nProvider, + ThemeProvider, + LocaleSwitcher, +} from '@edgeandnode/components' import '@edgeandnode/components/build/components.css' -import { Layout } from '@/layout' import { supportedLocales, translations } from '@/i18n' const seo: DefaultSeoProps = { @@ -54,6 +64,8 @@ const MyApp = ({ Component, pageProps }: AppProps) => { seo.openGraph!.locale = locale + const localeSwitcher = useMemo(() => , []) + return ( { > - - +
+ + } + footerContent={