-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MDX components and layouts for legal pages
- Loading branch information
Showing
11 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
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,9 @@ | ||
export default function MdxLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="max-w-3xl mx-auto px-4 py-16"> | ||
<div className="prose-sm prose-neutral prose-a:text-accent-foreground/50"> | ||
{children} | ||
</div> | ||
</div> | ||
) | ||
} |
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,9 +1,5 @@ | ||
import MdContents from '@/components/md-contents' | ||
import { readFile } from '../action' | ||
import Privacy from '@/markdown/privacy.mdx' | ||
|
||
export default async function PrivacyPage() { | ||
const res = await readFile('./public/legal', 'privacy.md') | ||
const { fileContents } = await res.json() | ||
|
||
return <MdContents content={fileContents} /> | ||
export default function Page() { | ||
return <Privacy /> | ||
} |
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,9 @@ | ||
export default function MdxLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="max-w-3xl mx-auto px-4 py-16"> | ||
<div className="prose-sm prose-neutral prose-a:text-accent-foreground/50"> | ||
{children} | ||
</div> | ||
</div> | ||
) | ||
} |
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,9 +1,5 @@ | ||
import MdContents from '@/components/md-contents' | ||
import { readFile } from '../action' | ||
import Terms from '@/markdown/terms.mdx' | ||
|
||
export default async function TermsOfUsePage() { | ||
const res = await readFile('./public/legal', 'terms.md') | ||
const { fileContents } = await res.json() | ||
|
||
return <MdContents content={fileContents} /> | ||
export default function Page() { | ||
return <Terms /> | ||
} |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
import type { MDXComponents } from 'mdx/types' | ||
|
||
export function useMDXComponents(components: MDXComponents): MDXComponents { | ||
return { | ||
...components | ||
} | ||
} |
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,9 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
import createMDX from '@next/mdx' | ||
|
||
export default nextConfig; | ||
const nextConfig = { | ||
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'] | ||
} | ||
|
||
const withMDX = createMDX() | ||
|
||
export default withMDX(nextConfig) |
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