Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "./globals.css";
import type { Metadata } from "next";
import type { ReactNode } from "react";

import { Analytics } from "@/components/providers/analytics";
import { DesignSystemProvider } from "@/components/providers/client";
import { fonts } from "@/lib/fonts";
import { url } from "@/lib/url";
Expand Down Expand Up @@ -42,7 +43,10 @@ interface RootLayoutProps {
const RootLayout = ({ children }: RootLayoutProps) => (
<html lang="en" data-scroll-behavior="smooth" suppressHydrationWarning>
<body className={fonts}>
<DesignSystemProvider>{children}</DesignSystemProvider>
<DesignSystemProvider>
{children}
<Analytics />
</DesignSystemProvider>
</body>
</html>
);
Expand Down
1 change: 1 addition & 0 deletions apps/web/components/mdx/elements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const Pre = ({
<CopyButton
aria-label="Copy code"
className="absolute top-2 right-2 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100"
data-track="docs_code_copied"
value={code}
/>
</div>
Expand Down
18 changes: 18 additions & 0 deletions apps/web/components/providers/analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { DatabuddyDevtools } from "@databuddy/devtools/react";
import { Databuddy } from "@databuddy/sdk/react";

export const Analytics = () => (
<>
<DatabuddyDevtools enabled={process.env.NODE_ENV !== "production"} />
<Databuddy
clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID}
trackHashChanges
trackAttributes
trackOutgoingLinks
trackInteractions
trackWebVitals
trackErrors
disabled={process.env.NODE_ENV === "development"}
/>
</>
);
1 change: 1 addition & 0 deletions apps/web/components/sections/installer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const Installer = () => (
<CopyButton
value="npx @docker-doctor/cli@latest"
aria-label="Copy installation command"
data-track="install_command_copied"
/>
</div>
<a
Expand Down
24 changes: 20 additions & 4 deletions apps/web/components/sections/share/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const Pill = ({ children }: PillProps) => (

interface ShareButtonProps {
children: ReactNode;
channel: string;
href?: string;
onClick?: () => void;
}
Expand All @@ -43,10 +44,17 @@ const useOrigin = () =>
() => ""
);

const ShareButton = ({ href, onClick, children }: ShareButtonProps) => {
const ShareButton = ({
channel,
href,
onClick,
children,
}: ShareButtonProps) => {
if (href) {
return (
<a
data-channel={channel}
data-track="share_clicked"
href={href}
target="_blank"
rel="noopener noreferrer"
Expand All @@ -61,6 +69,8 @@ const ShareButton = ({ href, onClick, children }: ShareButtonProps) => {
}
return (
<button
data-channel={channel}
data-track="share_clicked"
type="button"
onClick={onClick}
className={cn(
Expand Down Expand Up @@ -136,9 +146,15 @@ export const Card = ({ score, warnings, errors }: CardProps) => {
</div>

<div className="flex w-full items-center gap-2 px-4 pb-3.75 pt-3 [border-top-width:0.5px] border-border">
<ShareButton href={twitterUrl}>Share on X</ShareButton>
<ShareButton href={linkedinUrl}>Share on LinkedIn</ShareButton>
<ShareButton onClick={handleCopyBadge}>Copy GitHub badge</ShareButton>
<ShareButton channel="x" href={twitterUrl}>
Share on X
</ShareButton>
<ShareButton channel="linkedin" href={linkedinUrl}>
Share on LinkedIn
</ShareButton>
<ShareButton channel="badge" onClick={handleCopyBadge}>
Copy GitHub badge
</ShareButton>
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"dependencies": {
"@base-ui/react": "^1.6.0",
"@databuddy/sdk": "^2.6.0",
"cnfast": "^0.0.8",
"date-fns": "^4.4.0",
"fumadocs-core": "^16.12.1",
Expand All @@ -28,6 +29,7 @@
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@databuddy/devtools": "^0.0.1-beta.0",
"@tailwindcss/postcss": "^4.3.2",
"@types/mdx": "^2.0.14",
"@types/node": "^26",
Expand Down
8 changes: 8 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.