rsnext/examples/auth0/components/layout.tsx
Max Proske 55560e0c58
Convert auth0 example to TypeScript (#38087)
Converted auth0 example over to TypeScript to match the Contribution guidelines, and got rid of the `tslib` dependency.

Note: You must copy `.env.local.example` to `.env.local`, or you will encounter "TypeError: "secret" is required" at build time.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm lint`
- [X] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
2022-06-29 11:00:13 +00:00

41 lines
869 B
TypeScript

import Head from 'next/head'
import Header from './header'
type LayoutProps = {
user?: any
loading?: boolean
children: React.ReactNode
}
const Layout = ({ user, loading = false, children }: LayoutProps) => {
return (
<>
<Head>
<title>Next.js with Auth0</title>
</Head>
<Header user={user} loading={loading} />
<main>
<div className="container">{children}</div>
</main>
<style jsx>{`
.container {
max-width: 42rem;
margin: 1.5rem auto;
}
`}</style>
<style jsx global>{`
body {
margin: 0;
color: #333;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
`}</style>
</>
)
}
export default Layout