Pages -> Navigation (migration 075) edits the header's pages and buttons and the footer's links; navConfig.ts is now only the defaults. Page titles and intros move there from Site settings. A hidden page answers Not found below viewer (server and app) and is out of the menus and sitemap; signed in, it shows with a bar. Adds a /shop page of sections, hidden, with its header button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
716 B
TypeScript
30 lines
716 B
TypeScript
import { Link } from 'react-router-dom'
|
|
|
|
import type { NavLink } from '../navConfig.ts'
|
|
|
|
/* A nav link (Pages → Navigation): a route on the site, or a plain
|
|
link for an address off it or one set to open in a new tab. */
|
|
export default function SiteLink({
|
|
link,
|
|
children,
|
|
...rest
|
|
}: {
|
|
link: NavLink
|
|
children: React.ReactNode
|
|
className?: string
|
|
style?: React.CSSProperties
|
|
onClick?: () => void
|
|
}) {
|
|
if (!link.path.startsWith('/') || link.newTab) {
|
|
return (
|
|
<a href={link.path} {...(link.newTab ? { target: '_blank', rel: 'noopener noreferrer' } : {})} {...rest}>
|
|
{children}
|
|
</a>
|
|
)
|
|
}
|
|
return (
|
|
<Link to={link.path} {...rest}>
|
|
{children}
|
|
</Link>
|
|
)
|
|
}
|