diff options
| author | 2023-04-28 01:47:57 +0800 | |
|---|---|---|
| committer | 2023-04-28 01:47:57 +0800 | |
| commit | 8b2c4a38a461ff5ecc95972291bc711e2c5dec9a (patch) | |
| tree | 29f552e3df949073e21bf5c76d7abc3044830ec6 /examples/with-tailwind/apps/web/src | |
| parent | fc8c5fdce62fb229202659408798a7b6c98f6e8b (diff) | |
| download | HydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.tar.gz HydroRoll-8b2c4a38a461ff5ecc95972291bc711e2c5dec9a.zip | |
Diffstat (limited to 'examples/with-tailwind/apps/web/src')
4 files changed, 92 insertions, 0 deletions
diff --git a/examples/with-tailwind/apps/web/src/pages/_app.tsx b/examples/with-tailwind/apps/web/src/pages/_app.tsx new file mode 100644 index 0000000..cab70f5 --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/_app.tsx @@ -0,0 +1,9 @@ +import "../styles/globals.css"; +// include styles from the ui package +import "ui/styles.css"; + +import type { AppProps } from "next/app"; + +export default function MyApp({ Component, pageProps }: AppProps) { + return <Component {...pageProps} />; +} diff --git a/examples/with-tailwind/apps/web/src/pages/_document.tsx b/examples/with-tailwind/apps/web/src/pages/_document.tsx new file mode 100644 index 0000000..a091efe --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/_document.tsx @@ -0,0 +1,32 @@ +import Document, { + DocumentContext, + DocumentInitialProps, + Html, + Head, + Main, + NextScript, +} from "next/document"; + +class MyDocument extends Document { + static async getInitialProps( + ctx: DocumentContext + ): Promise<DocumentInitialProps> { + const initialProps = await Document.getInitialProps(ctx); + + return initialProps; + } + + render() { + return ( + <Html className="bg-zinc-900"> + <Head /> + <body> + <Main /> + <NextScript /> + </body> + </Html> + ); + } +} + +export default MyDocument; diff --git a/examples/with-tailwind/apps/web/src/pages/index.tsx b/examples/with-tailwind/apps/web/src/pages/index.tsx new file mode 100644 index 0000000..27f57cb --- /dev/null +++ b/examples/with-tailwind/apps/web/src/pages/index.tsx @@ -0,0 +1,48 @@ +import Head from "next/head"; +import { Button, Card } from "ui"; + +const CARD_CONTENT = [ + { + title: "Caching Tasks", + href: "https://turbo.build/repo/docs/core-concepts/caching", + cta: "Read More", + }, + { + title: "Running Tasks", + href: "https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks", + cta: "Read More", + }, + { + title: "Configuration Options", + href: "https://turbo.build/repo/docs/reference/configuration", + cta: "Read More", + }, +]; + +export default function Home() { + return ( + <div className="flex min-h-screen flex-col items-center justify-center py-2"> + <Head> + <title>Web - Turborepo Example</title> + </Head> + + <main className="mx-auto w-auto px-4 pt-16 pb-8 sm:pt-24 lg:px-8"> + <h1 className="mx-auto text-center text-6xl font-extrabold tracking-tight text-white sm:text-7xl lg:text-8xl xl:text-8xl"> + Web + <span className="block bg-gradient-to-r from-brandred to-brandblue bg-clip-text text-transparent px-2"> + Turborepo Example + </span> + </h1> + <div className="mx-auto mt-5 max-w-xl sm:flex sm:justify-center md:mt-8"> + <Button /> + </div> + + <div className="mt-12 grid grid-cols-1 sm:grid-cols-3 gap-4 place-content-evenly"> + {CARD_CONTENT.map((card) => ( + <Card key={card.title} {...card} /> + ))} + </div> + </main> + </div> + ); +} diff --git a/examples/with-tailwind/apps/web/src/styles/globals.css b/examples/with-tailwind/apps/web/src/styles/globals.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/examples/with-tailwind/apps/web/src/styles/globals.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; |
