use vite-plugin-ssr
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { Link } from "react-router-dom"
|
||||
import { ExternalLink } from "./external-link"
|
||||
|
||||
export type AppLinkProps = {
|
||||
type: "router" | "internal" | "external"
|
||||
type: "internal" | "external"
|
||||
label: React.ReactNode
|
||||
to: string
|
||||
className?: string
|
||||
@@ -10,13 +9,6 @@ export type AppLinkProps = {
|
||||
|
||||
export function AppLink(props: AppLinkProps) {
|
||||
switch (props.type) {
|
||||
case "router":
|
||||
return (
|
||||
<Link className={props.className} to={props.to}>
|
||||
{props.label}
|
||||
</Link>
|
||||
)
|
||||
|
||||
case "internal":
|
||||
return (
|
||||
<a className={props.className} href={props.to}>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import clsx from "clsx"
|
||||
import { Outlet } from "react-router"
|
||||
import { guideLinks } from "../data/guide-links"
|
||||
import { useScrolled } from "../hooks/dom/use-scrolled"
|
||||
import {
|
||||
@@ -30,7 +29,7 @@ export function GuidePageLayout() {
|
||||
</ul>
|
||||
</nav>
|
||||
<section className={clsx(docsProseClass, "pb-8 flex-1 min-w-0")}>
|
||||
<Outlet />
|
||||
{/* todo */}
|
||||
</section>
|
||||
</main>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Link } from "react-router-dom"
|
||||
import { AppLink } from "../components/app-link"
|
||||
import { guideLinks } from "../data/guide-links"
|
||||
import { mainLinks } from "../data/main-links"
|
||||
@@ -8,9 +7,9 @@ import { PopoverMenu } from "./popover-menu"
|
||||
export function MainNavigation() {
|
||||
return (
|
||||
<nav className="flex justify-between items-center h-16">
|
||||
<Link to="/">
|
||||
<a href="/">
|
||||
<h1 className="text-3xl font-light">reacord</h1>
|
||||
</Link>
|
||||
</a>
|
||||
<div className="hidden md:flex gap-4">
|
||||
{mainLinks.map((link) => (
|
||||
<AppLink {...link} key={link.to} className={linkClass} />
|
||||
|
||||
Reference in New Issue
Block a user