Navigation in the admin: header and footer links, page titles, hidden pages, Shop
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>
This commit is contained in:
parent
b49497cc59
commit
0cc2a3f721
30 changed files with 716 additions and 216 deletions
30
src/components/SiteLink.tsx
Normal file
30
src/components/SiteLink.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue