Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️refactor: rename subcontent #209

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions app/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
{
name: '過去の実績',
icon: SparklesIcon,
children: history,
content: history,
},
{
name: 'サポーター/パートナー',
icon: HeartIcon,
children: area,
content: area,
},
{
name: 'お問い合わせ',
icon: QuestionMarkCircleIcon,
children: siteInfo,
content: siteInfo,
},
]

Expand Down Expand Up @@ -116,24 +116,24 @@
<Bars3CenterLeftIcon className="h-7 w-7" />
</div>
<ul className="menu menu-sm dropdown-content z-[1] mt-3 w-52 rounded-box bg-base-100 p-2 shadow">
{navItems.map((item) => (
<li key={item.name}>
{item.children ? (
{item.content ? (
<>
<Link href="#">
<item.icon className="h-5 w-5" />
{item.name}
</Link>
<ChildNavItems childNavItems={item.children} />
<SubContent content={item.content} />
</>
) : (
<Link href={item.href}>
<item.icon className="h-5 w-5" />
{item.name}
</Link>
)}
</li>
))}

Check warning on line 136 in app/navbar.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot determine whether this child has the required key prop.
</ul>
</div>
)
Expand All @@ -143,41 +143,41 @@
return (
<div className="navbar-center hidden lg:flex">
<ul className="menu menu-horizontal px-1">
{navItems.map((item) => (
<li key={item.name}>
{item.children ? (
{item.content ? (
<details>
<summary>
<item.icon className="h-5 w-5" />
{item.name}
</summary>
<ChildNavItems childNavItems={item.children} />
<SubContent content={item.content} />
</details>
) : (
<Link href={item.href}>
<item.icon className="h-5 w-5" />
{item.name}
</Link>
)}
</li>
))}

Check warning on line 163 in app/navbar.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot determine whether this child has the required key prop.
</ul>
</div>
)
}

function ChildNavItems({
childNavItems,
function SubContent({
content,
}: {
childNavItems: { name: string; href: string }[]
content: { name: string; href: string }[]
}) {
return (
<ul className="p-2">
{childNavItems.map((item) => (
{content.map((item) => (
<li key={item.name}>
<Link href={item.href}>{item.name}</Link>
</li>
))}

Check warning on line 180 in app/navbar.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot determine whether this child has the required key prop.
</ul>
)
}
Expand All @@ -191,17 +191,17 @@
<ChevronDownIcon className="h-5 w-5" />
</div>
<ul className="dropdown-content z-[1] w-52 rounded-box bg-base-300 p-2 shadow-2xl">
{themeLists.map((item) => (
<li key={item.name}>
<input
type="radio"
name="theme-dropdown"
className="theme-controller btn btn-sm btn-block btn-ghost justify-start"
aria-label={item.name}
value={item.value}
/>
</li>
))}

Check warning on line 204 in app/navbar.tsx

View workflow job for this annotation

GitHub Actions / quality

Cannot determine whether this child has the required key prop.
</ul>
</div>
</div>
Expand Down
Loading