refactor: extract ColorManipulation component and pass icon/summary to AppPage
- Rename ColorPage → ColorManipulation (no AppPage wrapper inside) - Move AppPage + title/description/icon to color/page.tsx, consistent with other tools - AppPage now accepts icon prop directly; removes internal usePathname lookup and 'use client' - All tool pages pass tool.summary as description and tool.icon as icon Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,8 @@ export default function ASCIIPage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<ASCIIConverter />
|
||||
</AppPage>
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { ColorManipulation } from '@/components/color/ColorManipulation';
|
||||
import { AppPage } from '@/components/layout/AppPage';
|
||||
import { getToolByHref } from '@/lib/tools';
|
||||
import { ColorPage } from '@/components/color/ColorPage';
|
||||
|
||||
const tool = getToolByHref('/color')!;
|
||||
|
||||
export const metadata: Metadata = { title: tool.title };
|
||||
|
||||
export default function Page() {
|
||||
return <ColorPage />;
|
||||
export default function ColorPage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<ColorManipulation />
|
||||
</AppPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ export default function FaviconPage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<FaviconGenerator />
|
||||
</AppPage>
|
||||
|
||||
@@ -11,7 +11,8 @@ export default function MediaPage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<FileConverter />
|
||||
</AppPage>
|
||||
|
||||
@@ -11,7 +11,8 @@ export default function QRCodePage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<QRCodeGenerator />
|
||||
</AppPage>
|
||||
|
||||
@@ -11,7 +11,8 @@ export default function UnitsPage() {
|
||||
return (
|
||||
<AppPage
|
||||
title={tool.title}
|
||||
description={tool.description}
|
||||
description={tool.summary}
|
||||
icon={tool.icon}
|
||||
>
|
||||
<MainConverter />
|
||||
</AppPage>
|
||||
|
||||
Reference in New Issue
Block a user