This commit is contained in:
2026-04-13 21:04:21 +09:00
parent 584415edff
commit ea93556952
2 changed files with 29 additions and 24 deletions
@@ -1,9 +1,11 @@
import React from 'react'
import { cn } from '@/lib/utils'
type Props = { children: React.ReactNode }
import type { ComponentPropsWithoutRef, FC } from 'react'
type Props = ComponentPropsWithoutRef<'h2'>
export default ({ children }: Props) => (
<h2 className="text-xl my-4">
export default (({ children, className, ...rest }: Props) => (
<h2 {...rest} className={cn ('text-xl my-4', className)}>
{children}
</h2>)
</h2>)) satisfies FC<Props>
+9 -6
View File
@@ -16,19 +16,21 @@ export default (() => {
{ tag: null, wikiId: null, user: { } as User, pathName: location.pathname })
return (
<MainArea>
<MainArea className="md:flex">
<Helmet>
<title>{`メニュー | ${ SITE_TITLE }`}</title>
</Helmet>
{menu.map ((item, i) => (
<section key={i}>
<SectionTitle>{item.name}</SectionTitle>
{[...Array (Math.ceil (menu.length / 4)).keys ()].map (i => (
<div key={i} className="flex-1 mx-16">
{menu.slice (4 * i, 4 * (i + 1)).map ((item, j) => (
<section key={j}>
<SectionTitle className="font-bold">{item.name}</SectionTitle>
<ul>
{item.subMenu
.filter (subItem => (subItem.visible ?? true))
.map ((subItem, j) => ('name' in subItem && (
<li key={j}>
.map ((subItem, k) => ('name' in subItem && (
<li key={k}>
<PrefetchLink
to={subItem.to}
target={subItem.to.slice (0, 2) === '//'
@@ -39,5 +41,6 @@ export default (() => {
</li>)))}
</ul>
</section>))}
</div>))}
</MainArea>)
}) satisfies FC