This commit is contained in:
@@ -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) => (
|
export default (({ children, className, ...rest }: Props) => (
|
||||||
<h2 className="text-xl my-4">
|
<h2 {...rest} className={cn ('text-xl my-4', className)}>
|
||||||
{children}
|
{children}
|
||||||
</h2>)
|
</h2>)) satisfies FC<Props>
|
||||||
|
|||||||
@@ -16,19 +16,21 @@ export default (() => {
|
|||||||
{ tag: null, wikiId: null, user: { } as User, pathName: location.pathname })
|
{ tag: null, wikiId: null, user: { } as User, pathName: location.pathname })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MainArea>
|
<MainArea className="md:flex">
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>{`メニュー | ${ SITE_TITLE }`}</title>
|
<title>{`メニュー | ${ SITE_TITLE }`}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
|
|
||||||
{menu.map ((item, i) => (
|
{[...Array (Math.ceil (menu.length / 4)).keys ()].map (i => (
|
||||||
<section key={i}>
|
<div key={i} className="flex-1 mx-16">
|
||||||
<SectionTitle>{item.name}</SectionTitle>
|
{menu.slice (4 * i, 4 * (i + 1)).map ((item, j) => (
|
||||||
|
<section key={j}>
|
||||||
|
<SectionTitle className="font-bold">{item.name}</SectionTitle>
|
||||||
<ul>
|
<ul>
|
||||||
{item.subMenu
|
{item.subMenu
|
||||||
.filter (subItem => (subItem.visible ?? true))
|
.filter (subItem => (subItem.visible ?? true))
|
||||||
.map ((subItem, j) => ('name' in subItem && (
|
.map ((subItem, k) => ('name' in subItem && (
|
||||||
<li key={j}>
|
<li key={k}>
|
||||||
<PrefetchLink
|
<PrefetchLink
|
||||||
to={subItem.to}
|
to={subItem.to}
|
||||||
target={subItem.to.slice (0, 2) === '//'
|
target={subItem.to.slice (0, 2) === '//'
|
||||||
@@ -39,5 +41,6 @@ export default (() => {
|
|||||||
</li>)))}
|
</li>)))}
|
||||||
</ul>
|
</ul>
|
||||||
</section>))}
|
</section>))}
|
||||||
|
</div>))}
|
||||||
</MainArea>)
|
</MainArea>)
|
||||||
}) satisfies FC
|
}) satisfies FC
|
||||||
|
|||||||
Reference in New Issue
Block a user