Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2068 from system-ui/lachlanjc-next-tsx
feat(examples/next): Add new deps, fully use TSX, rebuild
- Loading branch information
Showing
16 changed files
with
769 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import React from 'react' | ||
import { Button, useColorMode } from 'theme-ui' | ||
|
||
const Header = () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Switch } from 'theme-ui' | ||
|
||
# Hello! | ||
|
||
This example site uses [Theme UI][] with [Next.js][]. This content is written in | ||
[MDX][]. | ||
|
||
[next.js]: https://github.com/vercel/next.js | ||
[theme ui]: https://theme-ui.com | ||
[mdx]: https://mdxjs.com | ||
|
||
<Switch label="@theme-ui/components work seamlessly" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.mdx' { | ||
let MDXComponent: (props: any) => JSX.Element | ||
export default MDXComponent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** @jsxImportSource theme-ui */ | ||
import { ThemeProvider } from 'theme-ui' | ||
|
||
import Header from '../components/header' | ||
import { theme } from '../lib/theme' | ||
import type { AppProps } from 'next/app' | ||
|
||
/** | ||
* @see https://nextjs.org/docs/advanced-features/custom-app | ||
* @see https://nextjs.org/docs/basic-features/typescript#custom-app | ||
*/ | ||
export default function MyApp({ Component, pageProps }: AppProps) { | ||
return ( | ||
<ThemeProvider theme={theme}> | ||
<main | ||
sx={{ | ||
border: '1px solid', | ||
borderColor: 'text', | ||
padding: 3, | ||
borderRadius: 1, | ||
maxWidth: 768, | ||
mx: 'auto', | ||
}} | ||
> | ||
<Header /> | ||
<Component {...pageProps} /> | ||
</main> | ||
</ThemeProvider> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Html, Head, Main, NextScript } from 'next/document' | ||
import { InitializeColorMode } from 'theme-ui' | ||
|
||
export default function Document() { | ||
return ( | ||
<Html> | ||
<Head /> | ||
<body> | ||
<InitializeColorMode /> | ||
<Main /> | ||
<NextScript /> | ||
</body> | ||
</Html> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Head from 'next/head' | ||
import About from '../components/about.mdx' | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<Head> | ||
<title>Next.js Theme UI</title> | ||
</Head> | ||
<About /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.