-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new layout and add link to changelog
- Loading branch information
1 parent
c5abdd2
commit e023513
Showing
12 changed files
with
116 additions
and
50 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 |
---|---|---|
@@ -1,11 +1,6 @@ | ||
import { Sidebar } from 'components/Sidebar' | ||
import styles from './layout.module.css' | ||
import { SiteLayout } from 'components/SiteLayout' | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className={styles.container}> | ||
<Sidebar /> | ||
<main>{children}</main> | ||
</div> | ||
) | ||
return <SiteLayout sidebar={<Sidebar />}>{children}</SiteLayout> | ||
} |
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,5 @@ | ||
import { SiteLayout } from 'components/SiteLayout' | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return <SiteLayout>{children}</SiteLayout> | ||
} |
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
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
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
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
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
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,30 @@ | ||
'use client' | ||
import { usePathname } from 'next/navigation' | ||
import Link from 'next/link' | ||
|
||
export function NavigationLink({ | ||
href, | ||
children, | ||
}: { | ||
href: string | ||
children: React.ReactNode | ||
}) { | ||
const currentPathname = usePathname() | ||
const isCurrent = currentPathname.startsWith(href) | ||
|
||
return ( | ||
<Link | ||
href={href} | ||
style={{ | ||
fontSize: 'var(--font-size-body-2)', | ||
fontWeight: isCurrent ? 600 : undefined, | ||
padding: '0.25rem 0.5rem', | ||
color: isCurrent | ||
? 'var(--color-foreground)' | ||
: 'var(--color-foreground-interactive)', | ||
}} | ||
> | ||
{children} | ||
</Link> | ||
) | ||
} |
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,29 @@ | ||
.container { | ||
display: grid; | ||
width: 100%; | ||
margin: 0 auto; | ||
flex: 1; | ||
} | ||
|
||
@media screen and (min-width: 60rem) { | ||
.container { | ||
grid-template-columns: auto minmax(0, 1fr); | ||
grid-template-rows: min-content 1fr; | ||
max-width: 72rem; | ||
} | ||
|
||
.container header { | ||
grid-column: 1 / -1; | ||
grid-row: 1 / 2; | ||
} | ||
|
||
.container aside { | ||
grid-column: 1 / 2; | ||
grid-row: 2 / 3; | ||
} | ||
|
||
.container main { | ||
grid-column: 2 / 3; | ||
grid-row: 2 / 3; | ||
} | ||
} |
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,42 @@ | ||
import { MdxtsLogo } from 'mdxts/assets' | ||
|
||
import { NavigationLink } from './NavigationLink' | ||
import styles from './SiteLayout.module.css' | ||
|
||
export function SiteLayout({ | ||
sidebar, | ||
children, | ||
}: { | ||
sidebar?: React.ReactNode | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<div className={styles.container}> | ||
<header | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'end', | ||
padding: '4rem 2rem 2rem', | ||
gap: '0.25rem', | ||
}} | ||
> | ||
<a | ||
href="/" | ||
style={{ | ||
display: 'flex', | ||
marginRight: 'auto', | ||
}} | ||
> | ||
<MdxtsLogo | ||
style={{ width: undefined, height: 'var(--font-size-body-1)' }} | ||
/> | ||
</a> | ||
<NavigationLink href="/docs/getting-started">Docs</NavigationLink> | ||
<NavigationLink href="/changelog">Changelog</NavigationLink> | ||
</header> | ||
{sidebar} | ||
<main>{children}</main> | ||
</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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SiteLayout' |