From fc907e2f81698d89502fb2ee0375e6d98a492c13 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 9 Sep 2021 23:33:34 -0700 Subject: current --- examples/hello-next/pages/index.tsx | 151 +++++++++++++++++++++--------------- 1 file changed, 88 insertions(+), 63 deletions(-) (limited to 'examples/hello-next/pages/index.tsx') diff --git a/examples/hello-next/pages/index.tsx b/examples/hello-next/pages/index.tsx index 7a2eb9f64..52b8f1f1f 100644 --- a/examples/hello-next/pages/index.tsx +++ b/examples/hello-next/pages/index.tsx @@ -1,80 +1,105 @@ import Head from "next/head"; -import Image from "next/image"; -import styles from "../styles/Home.module.css"; import Link from "next/link"; import { useRouter } from "next/router"; -import Title, { TitleEnum } from "../components/Title"; import React from "react"; +import { + Tweet, + TwitterContextProvider, +} from "@jarred/react-static-tweets/src/index"; +import "@jarred/react-static-tweets/styles.css"; +import { fetchTweetAst } from "@jarred/static-tweets/src/fetchTweetAst"; +import { SWRConfig } from "swr"; +import styles from "../styles/Home.module.css"; -export default function Home({}) { - const router = useRouter(); +export async function getStaticProps(ctx) { + return { + props: { + tweetAst: await fetchTweetAst("1390084458724741121"), + }, + }; +} +export default function Home({ tweetAst }) { return ( -
- - Fo - - - + + +
+ + Fo + + + -
-

- Welcome to Next.js! -

+
+ + {/*

+ Welcome to Next.js! +

-

- Get started by editing{" "} - pages/index.js -

+

+ Get started by editing{" "} + pages/index.js +

-
+ + {/* */}
- - -
); } -- cgit v1.2.3