Skip to content

armgit / pdfcn

Public Imported from GitHub
0

Beautiful pdf components, built on Takumi and Forme. 100% Free, Zero config, one command setup.

refactor: update UTM parameters structure and adjust component links to use new SOURCE and SPONSOR configurations

Aniket-508220b29da3535
diff --git a/components/github-stars.tsx b/components/github-stars.tsx
index 3acc604..10b53ad 100644
--- a/components/github-stars.tsx
+++ b/components/github-stars.tsx
@@ -25,7 +25,7 @@ export const GitHubStars = ({
<TooltipTrigger asChild>
<a
className={cn(buttonVariants({ size: "sm", variant: "ghost" }))}
- href={addQueryParams(LINK.GITHUB, UTM_PARAMS)}
+ href={addQueryParams(LINK.GITHUB, UTM_PARAMS.SOURCE)}
onClick={play}
rel="noopener"
target="_blank"
diff --git a/components/registry-add-button.tsx b/components/registry-add-button.tsx
index 18d7da9..4c2fd37 100644
--- a/components/registry-add-button.tsx
+++ b/components/registry-add-button.tsx
@@ -40,7 +40,7 @@ const Description = ({ registryName }: { registryName: string }) => (
className="text-foreground underline underline-offset-4"
href={addQueryParams("https://ui.shadcn.com/docs/directory", {
q: registryName,
- ...UTM_PARAMS,
+ ...UTM_PARAMS.SOURCE,
})}
target="_blank"
rel="noopener"
diff --git a/components/site-footer.tsx b/components/site-footer.tsx
index 78504e3..7ea6f67 100644
--- a/components/site-footer.tsx
+++ b/components/site-footer.tsx
@@ -18,7 +18,7 @@ export const SiteFooter = () => {
<div className="text-muted-foreground w-full px-1 text-center text-xs leading-loose sm:text-sm">
Built by{" "}
<a
- href={addQueryParams(LINK.PORTFOLIO, UTM_PARAMS)}
+ href={addQueryParams(LINK.PORTFOLIO, UTM_PARAMS.SOURCE)}
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4"
@@ -28,7 +28,7 @@ export const SiteFooter = () => {
</a>
. The source code is available on{" "}
<a
- href={addQueryParams(LINK.GITHUB, UTM_PARAMS)}
+ href={addQueryParams(LINK.GITHUB, UTM_PARAMS.SOURCE)}
target="_blank"
rel="noreferrer"
className="font-medium underline underline-offset-4"
diff --git a/constants/site.ts b/constants/site.ts
index 6fc8e59..2e91b36 100644
--- a/constants/site.ts
+++ b/constants/site.ts
@@ -44,7 +44,11 @@ export const META_THEME_COLORS = {
};
export const UTM_PARAMS = {
- utm_campaign: "sponsors_page",
- utm_medium: "sponsor",
- utm_source: new URL(baseUrl).hostname,
+ SOURCE: {
+ utm_source: new URL(baseUrl).hostname,
+ },
+ SPONSOR: {
+ utm_campaign: "sponsors_page",
+ utm_medium: "sponsor",
+ },
};
diff --git a/lib/sponsors.ts b/lib/sponsors.ts
index 9367e87..1950b61 100644
--- a/lib/sponsors.ts
+++ b/lib/sponsors.ts
@@ -10,7 +10,10 @@ export interface Sponsor {
}
const REACT_BITS_PRO: Sponsor = {
- href: addQueryParams("https://pro.reactbits.dev", UTM_PARAMS),
+ href: addQueryParams("https://pro.reactbits.dev", {
+ ...UTM_PARAMS.SOURCE,
+ ...UTM_PARAMS.SPONSOR,
+ }),
logo: "/sponsors/reactbitpro.svg",
name: "React Bits Pro",
};