Skip to content

Commit 412a8a9

Browse files
committed
Update example
1 parent 9d3f7a5 commit 412a8a9

File tree

4 files changed

+153
-24
lines changed

4 files changed

+153
-24
lines changed

examples/nextjs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"nextjs-themes": "^4.0.3",
1818
"react": "^18.3.1",
1919
"react-dom": "^18.3.1",
20+
"react-markdown": "^9.0.1",
2021
"react-markdown-autolink": "workspace:*",
2122
"react-mouse-trails": "^0.0.4",
2223
"react18-loaders": "^1.1.3",

examples/nextjs/src/app/page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
import MyButton from "./button";
21
import { LandingPage } from "@repo/shared/dist/server";
32
import { Demo } from "@repo/shared";
3+
import Markdown from "react-markdown";
4+
import { autoLinkMd } from "react-markdown-autolink";
45

56
export const metadata = {
67
title: "React Markdown Autolink",
78
};
89

10+
const md = `## Automatically Detect and Add Hyperlinks to Your Markdown Content
11+
https://github.com/react18-tools/react-markdown-autolink
12+
`;
913
/** next.js landing page */
1014
export default function Page(): JSX.Element {
1115
return (
1216
<LandingPage title="Next.js Example">
13-
<Demo />
14-
<MyButton />
17+
<Markdown>{autoLinkMd(md)}</Markdown>
1518
</LandingPage>
1619
);
1720
}

packages/shared/src/server/landing-page/landing-page.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,9 @@ export function LandingPage({ title, children }: LandingPageProps) {
4141
<main className={styles.main}>
4242
<h1 className={styles.title}>{title}</h1>
4343
<div className={[styles.center, styles.hero].join(" ")}>
44-
<h2>Craft your next amazing library using</h2>
44+
<h2>Craft your next amazing project using</h2>
4545
<Logo href={`https://github.com/${owner}/${repo}`} />
46-
<strong>Harness the full potential of React 18 Server Components!</strong>
47-
</div>
48-
{children}
49-
<div className={styles.featured}>
50-
<h2>Featured packages built with this template.</h2>
51-
<hr />
52-
<Cards cards={featured} />
46+
<strong>{children}</strong>
5347
</div>
5448
<Cards cards={cards} />
5549
</main>

0 commit comments

Comments
 (0)