Skip to content

Commit 9b944cf

Browse files
wontoryclaude
andcommitted
feat(web): integrate badge feature into app
Wire up badge page with provider layout, update section cards with badge previews, and add @tech-stack/badge dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fd88fa9 commit 9b944cf

6 files changed

Lines changed: 44 additions & 14 deletions

File tree

apps/web/app/badge/layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from 'next'
22

33
import { InsetLayout } from '#layouts/inset-layout'
4+
import { BadgeProvider } from '#stores/badge-context'
45

56
export const metadata: Metadata = {
67
title: 'badge',
@@ -11,5 +12,9 @@ export default function PageLayout({
1112
}: Readonly<{
1213
children: React.ReactNode
1314
}>) {
14-
return <InsetLayout title="Badge">{children}</InsetLayout>
15+
return (
16+
<InsetLayout title="Badge">
17+
<BadgeProvider>{children}</BadgeProvider>
18+
</InsetLayout>
19+
)
1520
}

apps/web/app/badge/page.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import Link from 'next/link'
2-
3-
import { Button } from '@tech-stack/ui/components/button'
1+
import { BadgeCustomize } from '#components/badge-customize'
2+
import { BadgePreview } from '#components/badge-preview'
43

54
export default function Page() {
65
return (
7-
<div className="flex flex-1 flex-col items-center justify-center gap-4">
8-
<h1 className="font-bold text-2xl">Work in progress</h1>
9-
<Button size="sm" asChild>
10-
<Link href="/">Home</Link>
11-
</Button>
6+
<div className="grid @5xl/main:grid-cols-2 grid-cols-1 gap-4 px-4 lg:px-6">
7+
<BadgePreview />
8+
<BadgeCustomize />
129
</div>
1310
)
1411
}

apps/web/next.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
transpilePackages: ['@tech-stack/ui', '@tech-stack/orbit'],
3+
transpilePackages: [
4+
'@tech-stack/ui',
5+
'@tech-stack/orbit',
6+
'@tech-stack/badge',
7+
],
48
}
59

610
export default nextConfig

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@tanstack/react-virtual": "^3.13.8",
14+
"@tech-stack/badge": "workspace:*",
1415
"@tech-stack/orbit": "workspace:*",
1516
"@tech-stack/ui": "workspace:*",
1617
"lucide-react": "catalog:icons",

apps/web/src/components/section-cards.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,17 @@ function BadgeCard() {
7878
title="Badge"
7979
description="tech-stack"
8080
content={
81-
<div className="flex flex-1 items-center justify-center">
82-
<span className="font-medium text-muted-foreground">
83-
Work in progress.
84-
</span>
81+
<div className="flex flex-1 flex-col items-center justify-center gap-3">
82+
<img
83+
src="/api/badge?slug=nextdotjs&text=Next.js&highlight=true"
84+
alt="Badge highlight"
85+
draggable={false}
86+
/>
87+
<img
88+
src="/api/badge?slug=typescript&text=TypeScript"
89+
alt="Badge"
90+
draggable={false}
91+
/>
8592
</div>
8693
}
8794
footer={

pnpm-lock.yaml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)