Skip to content

Commit

Permalink
feat: Add Layout wrapper component
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonfrank committed May 27, 2022
1 parent b960a40 commit d55e41f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import "../styles/globals.css";
import type { AppProps } from "next/app";
import Layout from "../ui/layout";

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return (
<Layout>
<Component {...pageProps} />
</Layout>
);
}

export default MyApp
export default MyApp;
19 changes: 19 additions & 0 deletions ui/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Container, Typography } from '@mui/material'
import { Box } from '@mui/system'
import React from 'react'

interface LayoutProps {
children: JSX.Element
}
const Layout = ({ children }: LayoutProps) => {
return (
<Container maxWidth="sm">
<Box textAlign="center" mt={5}>
<Typography variant='h2' fontWeight="bold">Quiz App</Typography>
{children}
</Box>
</Container>
)
}

export default Layout
1 change: 1 addition & 0 deletions ui/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Layout'

0 comments on commit d55e41f

Please sign in to comment.