Skip to content

Commit fca8cb4

Browse files
committed
feat: refactor目录结构+添加埋点数据
1 parent 6e1f568 commit fca8cb4

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

app/components/Hero.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Contribute } from "@/app/components/Contribute";
44
import Image from "next/image";
55
import { ActivityTicker } from "@/app/components/ActivityTicker";
66
import { cn } from "@/lib/utils";
7-
import { AnimatedBar } from "@/app/components/AnimatedBar";
7+
import { AnimatedBar } from "@/app/components/rank/AnimatedBar";
88
import leaderboardData from "@/generated/site-leaderboard.json";
99
import { MAINTAINERS } from "@/lib/admins";
1010

@@ -160,6 +160,7 @@ export function Hero() {
160160
className="font-mono text-xs uppercase tracking-widest font-bold text-[var(--foreground)] hover:text-[var(--color-accent)] transition-colors flex items-center gap-2 group"
161161
data-umami-event="navigation_click"
162162
data-umami-event-region="hero_leaderboard"
163+
data-umami-event-label="FULL RANK"
163164
>
164165
FULL RANK
165166
<span className="transform group-hover:translate-x-1 transition-transform">
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export function ContributorRow({
2626
return (
2727
<Dialog.Root>
2828
<Dialog.Trigger asChild>
29-
<button className="w-full text-left group flex flex-col md:flex-row md:items-center gap-4 border border-[var(--foreground)] p-4 bg-[var(--background)] hard-shadow-hover transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 cursor-pointer">
29+
<button
30+
className="w-full text-left group flex flex-col md:flex-row md:items-center gap-4 border border-[var(--foreground)] p-4 bg-[var(--background)] hard-shadow-hover transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-950 focus-visible:ring-offset-2 cursor-pointer"
31+
data-umami-event="open_contributor_dialog"
32+
data-umami-event-user={user.name}
33+
>
3034
<div className="font-mono text-2xl font-bold w-12 text-center text-[var(--foreground)] shrink-0">
3135
#{idx + 1}
3236
</div>
@@ -91,6 +95,9 @@ export function ContributorRow({
9195
key={doc.id}
9296
href={doc.url}
9397
className="flex w-full items-center justify-between group/link border-b border-[#111111]/20 dark:border-neutral-200/20 py-3 hover:bg-[#111111]/5 dark:hover:bg-white/5 transition-colors px-2"
98+
data-umami-event="click_contributor_doc"
99+
data-umami-event-doc={doc.title}
100+
data-umami-event-user={user.name}
94101
>
95102
<span className="font-mono text-sm text-[#111111] dark:text-neutral-200 group-hover/link:underline decoration-2 decoration-[#CC0000] underline-offset-4 truncate pr-4">
96103
{doc.title}

app/rank/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Header } from "@/app/components/Header";
22
import { Footer } from "@/app/components/Footer";
3-
import { AnimatedBar } from "@/app/components/AnimatedBar";
3+
import { AnimatedBar } from "@/app/components/rank/AnimatedBar";
44
import { cn } from "@/lib/utils";
5-
import { ContributorRow } from "@/app/components/ContributorRow";
5+
import { ContributorRow } from "@/app/components/rank/ContributorRow";
66

77
import leaderboardData from "@/generated/site-leaderboard.json";
88

0 commit comments

Comments
 (0)