From 2939566a4259e6824a6135e859fd5a82727163ad Mon Sep 17 00:00:00 2001
From: czhen <56986964+shczhen@users.noreply.github.com>
Date: Thu, 12 Dec 2024 16:37:57 +0800
Subject: [PATCH] fix(demo): header components (#473)
* refine header
* feat: support gh stars
---
demo/package.json | 1 +
demo/pnpm-lock.yaml | 14 ++
demo/src/app/layout.tsx | 11 +-
demo/src/common/constant.ts | 5 +-
demo/src/components/Icon/index.tsx | 16 +++
demo/src/components/Layout/Header.tsx | 9 +-
.../components/Layout/HeaderComponents.tsx | 112 +++++++++++-----
demo/src/hooks/index.ts | 32 +++++
demo/src/lib/utils.ts | 14 ++
demo/tailwind.config.js | 123 +++++++++---------
10 files changed, 239 insertions(+), 98 deletions(-)
create mode 100644 demo/src/hooks/index.ts
diff --git a/demo/package.json b/demo/package.json
index 32c6ff3e..f188385a 100644
--- a/demo/package.json
+++ b/demo/package.json
@@ -40,6 +40,7 @@
"react-redux": "^9.1.0",
"redux": "^5.0.1",
"sonner": "^1.5.0",
+ "swr": "^2.2.5",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
diff --git a/demo/pnpm-lock.yaml b/demo/pnpm-lock.yaml
index 682d7d70..0e39c477 100644
--- a/demo/pnpm-lock.yaml
+++ b/demo/pnpm-lock.yaml
@@ -89,6 +89,9 @@ importers:
sonner:
specifier: ^1.5.0
version: 1.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
+ swr:
+ specifier: ^2.2.5
+ version: 2.2.5(react@18.3.1)
tailwind-merge:
specifier: ^2.5.4
version: 2.5.4
@@ -3420,6 +3423,11 @@ packages:
engines: {node: '>=14.0.0'}
hasBin: true
+ swr@2.2.5:
+ resolution: {integrity: sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==}
+ peerDependencies:
+ react: ^16.11.0 || ^17.0.0 || ^18.0.0
+
tailwind-merge@2.5.4:
resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==}
@@ -7280,6 +7288,12 @@ snapshots:
csso: 5.0.5
picocolors: 1.1.1
+ swr@2.2.5(react@18.3.1):
+ dependencies:
+ client-only: 0.0.1
+ react: 18.3.1
+ use-sync-external-store: 1.2.2(react@18.3.1)
+
tailwind-merge@2.5.4: {}
tailwindcss-animate@1.0.7(tailwindcss@3.4.14):
diff --git a/demo/src/app/layout.tsx b/demo/src/app/layout.tsx
index cd55cb51..ef93328f 100644
--- a/demo/src/app/layout.tsx
+++ b/demo/src/app/layout.tsx
@@ -2,6 +2,15 @@ import { StoreProvider } from "@/store"
import type { Metadata, Viewport } from "next"
import "./global.css"
import { Toaster } from "@/components/ui/sonner"
+import { Roboto } from "next/font/google"
+import { cn } from "@/lib/utils"
+
+const roboto = Roboto({
+ subsets: ["latin"],
+ weight: ["400", "700"],
+ variable: "--font-roboto",
+ display: "swap",
+})
export const metadata: Metadata = {
title: "TEN Agent",
@@ -29,7 +38,7 @@ export default function RootLayout({
}>) {
return (
-
+
{/* ) {
+ return (
+
+ )
+}
+
export const GitHubIcon = (props: React.SVGProps) => {
return (