mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 21:02:45 -07:00
feat: add breadcrumbs to documentation
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { Breadcrumbs, Button } from '@mantine/core'
|
||||
import { Link } from 'tuono'
|
||||
|
||||
import { IconChevronRight, IconBolt } from '@tabler/icons-react'
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
export default function TuonoBreadcrumbs({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode
|
||||
}): JSX.Element {
|
||||
return (
|
||||
<Breadcrumbs
|
||||
separator={<IconChevronRight size="1.1rem" stroke={1.5} />}
|
||||
mb="md"
|
||||
mt="md"
|
||||
>
|
||||
<Button href="/" component={Link} variant="subtle" radius="xl" p={5}>
|
||||
<IconBolt />
|
||||
</Button>
|
||||
{children}
|
||||
</Breadcrumbs>
|
||||
)
|
||||
}
|
||||
|
||||
interface BreadcrumbElementProps {
|
||||
href?: string
|
||||
label: string
|
||||
}
|
||||
|
||||
export function BreadcrumbElement({
|
||||
href,
|
||||
label,
|
||||
}: BreadcrumbElementProps): JSX.Element {
|
||||
return (
|
||||
<Button
|
||||
component={href ? Link : 'span'}
|
||||
href={href}
|
||||
variant={href ? 'subtle' : 'light'}
|
||||
radius="xl"
|
||||
px={href ? 10 : undefined}
|
||||
>
|
||||
{label}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import Breadcrumbs, { BreadcrumbElement } from './breadcrumbs'
|
||||
|
||||
export default Breadcrumbs
|
||||
|
||||
export { BreadcrumbElement as Element }
|
||||
@@ -4,6 +4,12 @@ import { Head } from 'tuono'
|
||||
<title>Tuono - Contributing</title>
|
||||
</Head>
|
||||
|
||||
import Breadcrumbs, { Element } from '../../components/breadcrumbs'
|
||||
|
||||
<Breadcrumbs>
|
||||
<Element label="Contributing"/>
|
||||
</Breadcrumbs>
|
||||
|
||||
# How to contribute
|
||||
|
||||
## TL;DR
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import { Head } from 'tuono'
|
||||
import Breadcrumbs, { Element } from '../../components/breadcrumbs'
|
||||
|
||||
<Head>
|
||||
<title>Tuono - Installation</title>
|
||||
</Head>
|
||||
|
||||
<Breadcrumbs>
|
||||
<Element label="Installation"/>
|
||||
</Breadcrumbs>
|
||||
|
||||
# Installation
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -4,4 +4,12 @@ import { Head } from 'tuono'
|
||||
<title>Tuono - Routing</title>
|
||||
</Head>
|
||||
|
||||
import Breadcrumbs, { Element } from '../../../components/breadcrumbs'
|
||||
|
||||
<Breadcrumbs>
|
||||
<Element label="Routing"/>
|
||||
</Breadcrumbs>
|
||||
|
||||
# Routing index
|
||||
|
||||
TODO
|
||||
|
||||
@@ -4,6 +4,13 @@ import { Head } from 'tuono'
|
||||
<title>Tuono - Routing</title>
|
||||
</Head>
|
||||
|
||||
import Breadcrumbs, { Element } from '../../../components/breadcrumbs'
|
||||
|
||||
<Breadcrumbs>
|
||||
<Element label="Routing" href="/documentation/routing"/>
|
||||
<Element label="Project structure"/>
|
||||
</Breadcrumbs>
|
||||
|
||||
# Project structure
|
||||
|
||||
Todo
|
||||
|
||||
@@ -4,6 +4,12 @@ import { Head } from 'tuono'
|
||||
<title>Tuono - Tutorial intro</title>
|
||||
</Head>
|
||||
|
||||
import Breadcrumbs, { Element } from '../../../components/breadcrumbs'
|
||||
|
||||
<Breadcrumbs>
|
||||
<Element label="Tutorial"/>
|
||||
</Breadcrumbs>
|
||||
|
||||
# Tutorial intro
|
||||
|
||||
TODO
|
||||
|
||||
Reference in New Issue
Block a user