Skip to content

Commit

Permalink
feat: added analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Oct 18, 2023
1 parent 0a5ba4c commit 60805db
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
7 changes: 3 additions & 4 deletions apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ import { ThemeProvider } from "@/components/core/theme-provider";
import { cn } from "ui/lib/utils";
import { Toaster } from "@ui/components/toaster";
import SiteHeader from "@/components/core/site-header";
import { generateColorPalette } from "@/lib/colorCalculator";
import { BaseColorTypes, ColorMode } from "@/types/app";
import { generateBaseColors } from "@/lib/generateBaseColors";
import { useColorStore } from "@/store/store";
import ColorStoreInitializer from "./color-store-initializer";
import PerformanceChecker from "@/components/core/performance-checker";
import Toolbar from "@/components/core/toobar";
import StyleSheetInitializer from "./stylesheet-initializer";
import { cookies } from "next/headers";
import { getServerColors } from "@/lib/getServerColors";

import { Analytics } from "@vercel/analytics/react";

const inter = Inter({ subsets: ["latin"], variable: "--font-inter" });
const comfortaa = Comfortaa({
subsets: ["latin"],
Expand Down Expand Up @@ -72,6 +70,7 @@ export default async function RootLayout({
{children}
<Toaster />
</ThemeProvider>
<Analytics />
</body>
</html>
);
Expand Down
17 changes: 12 additions & 5 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,24 @@ export async function generateMetadata(

// optionally access and extend (rather than replace) parent metadata
const previousImages = (await parent).openGraph?.images || [];
const seoDescription = colors
? `Generated with Fluid Colors: ${paletteColors}`
: "Unleash the Power of Dynamic, Variable-Based Color Palettes";
const ogImages = [opengraphImage, ...previousImages];
return {
title: colors ? "Check out this palette" : "Color Palette Generator",
description: colors
? `Generated with Fluid Colors: ${paletteColors}`
: "Unleash the Power of Dynamic, Variable-Based Color Palettes",
description: seoDescription,
openGraph: {
images: [opengraphImage, ...previousImages],
images: ogImages,
},
twitter: {
card: "summary_large_image",
title: colors ? "Check out this palette" : "Color Palette Generator",
description: seoDescription,
images: ogImages,
},
};
}

export default async function Page({ searchParams }: Props) {
return (
<div className="site-padding mx-auto flex w-full max-w-[120rem] flex-1 flex-col pb-20 sm:pb-24">
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@vercel/analytics": "^1.1.1",
"culori": "^3.2.0",
"extract-colors": "^4.0.2",
"framer-motion": "^10.16.4",
Expand Down
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 60805db

Please sign in to comment.