Skip to content

Commit b834d29

Browse files
authored
Merge pull request #1 from Firstset/v4-upgrade
V4 upgrade
2 parents a2a4ffd + 1dde3fa commit b834d29

20 files changed

Lines changed: 874 additions & 642 deletions

app/[[...mdxPath]]/page.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { generateStaticParamsFor, importPage } from 'nextra/pages'
2+
import { useMDXComponents as getMDXComponents } from '../../mdx-components'
3+
4+
export const generateStaticParams = generateStaticParamsFor('mdxPath')
5+
6+
const Wrapper = getMDXComponents().wrapper
7+
8+
export async function generateMetadata(props: {
9+
params: Promise<{ mdxPath?: string[] }>
10+
}) {
11+
const params = await props.params
12+
const { metadata } = await importPage(params.mdxPath)
13+
return metadata
14+
}
15+
16+
export default async function Page(props: { params: Promise<{ mdxPath?: string[] }> }) {
17+
const params = await props.params
18+
const {
19+
default: MDXContent,
20+
toc,
21+
metadata,
22+
sourceCode,
23+
} = await importPage(params.mdxPath)
24+
25+
return (
26+
<Wrapper toc={toc} metadata={metadata} sourceCode={sourceCode}>
27+
<MDXContent {...props} params={params} />
28+
</Wrapper>
29+
)
30+
}

app/layout.tsx

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import type { Metadata, Viewport } from 'next'
2+
import type { ReactNode } from 'react'
3+
import Link from 'next/link'
4+
import { Inter } from 'next/font/google'
5+
import { Footer, Layout, Navbar } from 'nextra-theme-docs'
6+
import { Head } from 'nextra/components'
7+
import { getPageMap } from 'nextra/page-map'
8+
9+
import 'nextra-theme-docs/style.css'
10+
11+
const inter = Inter({ subsets: ['latin'] })
12+
13+
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://docs.brasa.finance'
14+
15+
export const metadata: Metadata = {
16+
metadataBase: new URL(siteUrl),
17+
title: {
18+
default: 'Brasa Docs',
19+
template: '%s | Brasa Docs',
20+
},
21+
description: 'Brasa LST documentation site',
22+
icons: {
23+
icon: '/favicon.svg',
24+
apple: '/apple-touch-icon.png',
25+
},
26+
}
27+
28+
export const viewport: Viewport = {
29+
themeColor: '#FC502C',
30+
}
31+
32+
const Logo = () => (
33+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
34+
<img src="/Logo-md-orange.svg" alt="Brasa" style={{ height: 28 }} />
35+
</div>
36+
)
37+
38+
const navbar = (
39+
<Navbar logo={<Logo />} projectLink="https://github.com/firstset/brasa-docs" />
40+
)
41+
42+
const footer = (
43+
<Footer>
44+
<div style={{ width: '100%' }}>
45+
<div
46+
style={{
47+
display: 'flex',
48+
justifyContent: 'space-between',
49+
alignItems: 'center',
50+
flexWrap: 'wrap',
51+
gap: '1rem',
52+
}}
53+
>
54+
<div>
55+
<p style={{ margin: 0 }}>© 2025 Brasa Finance. All rights reserved.</p>
56+
</div>
57+
<div style={{ display: 'flex', gap: '1.5rem' }}>
58+
<a href="https://brasa.finance" target="_blank" rel="noopener noreferrer">
59+
Website
60+
</a>
61+
<a
62+
href="https://twitter.com/brasafinance"
63+
target="_blank"
64+
rel="noopener noreferrer"
65+
>
66+
X
67+
</a>
68+
<a
69+
href="https://github.com/brasa-finance"
70+
target="_blank"
71+
rel="noopener noreferrer"
72+
>
73+
GitHub
74+
</a>
75+
<Link href="/legal/terms">Terms</Link>
76+
</div>
77+
</div>
78+
</div>
79+
</Footer>
80+
)
81+
82+
export default async function RootLayout({ children }: { children: ReactNode }) {
83+
return (
84+
<html lang="en" dir="ltr" suppressHydrationWarning className={inter.className}>
85+
<Head
86+
color={{
87+
hue: 14,
88+
saturation: 100,
89+
lightness: 47,
90+
}}
91+
/>
92+
<body>
93+
<Layout
94+
navbar={navbar}
95+
pageMap={await getPageMap()}
96+
docsRepositoryBase="https://github.com/firstset/brasa-docs/tree/main"
97+
footer={footer}
98+
>
99+
{children}
100+
</Layout>
101+
</body>
102+
</html>
103+
)
104+
}

components/mdx/ContractAddress.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
import React, { useState } from 'react'
24

35
interface ContractAddressProps {

components/mdx/Tabs.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
import React, { useState } from 'react'
24

35
interface TabProps {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)