Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor site limits and update terminology across components for consistency. Changed "Add New Site" to "Add Website" in SiteSelector, introduced FREE_SITE_LIMIT and STANDARD_SITE_LIMIT constants, and updated relevant features in subscription and pricing sections.

Bill Yangb340ae338c79
diff --git a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
index 8e510745c..bb78f3f3f 100644
--- a/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
+++ b/client/src/app/[site]/components/Sidebar/SiteSelector.tsx
@@ -142,7 +142,7 @@ function SiteSelectorContent({ onSiteSelect }: { onSiteSelect: () => void }) {
trigger={
<Button variant="ghost" className="w-full justify-start gap-2">
<Plus className="h-4 w-4" />
- Add New Site
+ Add Website
</Button>
}
/>
diff --git a/client/src/app/components/AddSite.tsx b/client/src/app/components/AddSite.tsx
index dcbf84b30..4e607ce43 100644
--- a/client/src/app/components/AddSite.tsx
+++ b/client/src/app/components/AddSite.tsx
@@ -24,6 +24,9 @@ import { resetStore, useStore } from "../../lib/store";
import { useRouter } from "next/navigation";
import { isValidDomain, normalizeDomain } from "../../lib/utils";
+export const FREE_SITE_LIMIT = 1;
+export const STANDARD_SITE_LIMIT = 5;
+
export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disabled?: boolean }) {
const { setSite } = useStore();
const router = useRouter();
@@ -37,10 +40,10 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
if (!IS_CLOUD) {
return false;
}
- if (subscription?.status !== "active" && numberOfSites >= 3) {
+ if (subscription?.status !== "active" && numberOfSites >= FREE_SITE_LIMIT) {
return true;
}
- if (!subscription?.isPro && numberOfSites >= 10) {
+ if (!subscription?.isPro && numberOfSites >= STANDARD_SITE_LIMIT) {
return true;
}
@@ -108,7 +111,8 @@ export function AddSite({ trigger, disabled }: { trigger?: React.ReactNode; disa
</span>
</TooltipTrigger>
<TooltipContent>
- You have reached the limit of {subscription?.isPro ? 10 : 3} websites. Upgrade to add more websites
+ You have reached the limit of {subscription?.isPro ? STANDARD_SITE_LIMIT : FREE_SITE_LIMIT} websites. Upgrade
+ to add more websites
</TooltipContent>
</Tooltip>
);
diff --git a/client/src/app/subscribe/components/utils.ts b/client/src/app/subscribe/components/utils.ts
index 3f4b9b961..01143ec9e 100644
--- a/client/src/app/subscribe/components/utils.ts
+++ b/client/src/app/subscribe/components/utils.ts
@@ -1,11 +1,12 @@
// Common utility functions and constants for subscription components
import { getStripePrices, STRIPE_TIERS } from "../../../lib/stripe";
+import { FREE_SITE_LIMIT, STANDARD_SITE_LIMIT } from "../../components/AddSite";
export const EVENT_TIERS = [...STRIPE_TIERS.map(tier => tier.events), "Custom"];
export const STANDARD_FEATURES = [
- "Up to 10 websites",
+ `Up to ${STANDARD_SITE_LIMIT} websites`,
"Up to 3 team members",
"Web vitals",
"Funnels",
@@ -29,7 +30,7 @@ export const PRO_FEATURES = [
export const FREE_FEATURES = [
"1 user",
- "Up to 3 websites",
+ `${FREE_SITE_LIMIT} website`,
"Cookieless tracking",
"Web analytics dashboard",
"Custom events",
diff --git a/docs/src/components/PricingSection.tsx b/docs/src/components/PricingSection.tsx
index 815c37023..c597e0eb0 100644
--- a/docs/src/components/PricingSection.tsx
+++ b/docs/src/components/PricingSection.tsx
@@ -6,14 +6,14 @@ import Link from "next/link";
import { useState } from "react";
import { cn } from "@/lib/utils";
import { trackAdEvent } from "@/lib/trackAdEvent";
-import { DEFAULT_EVENT_LIMIT } from "../lib/const";
+import { DEFAULT_EVENT_LIMIT, FREE_SITE_LIMIT, STANDARD_SITE_LIMIT } from "../lib/const";
// Available event tiers for the slider
const EVENT_TIERS = [100_000, 250_000, 500_000, 1_000_000, 2_000_000, 5_000_000, 10_000_000, 20_000_000, "Custom"];
// Define standard plan features
const STANDARD_FEATURES = [
- "Up to 10 websites",
+ `Up to ${STANDARD_SITE_LIMIT} websites`,
"Up to 3 team members",
"Web vitals",
"Funnels",
@@ -39,7 +39,7 @@ const PRO_FEATURES = [
// Define free plan features
const FREE_FEATURES = [
{ feature: "1 user", included: true },
- { feature: "Up to 3 websites", included: true },
+ { feature: `${FREE_SITE_LIMIT} website`, included: true },
{ feature: "Cookieless tracking", included: true },
{ feature: "Web analytics dashboard", included: true },
{ feature: "Custom events", included: true },
diff --git a/docs/src/lib/const.ts b/docs/src/lib/const.ts
index dcddbcb5d..fc72cee5e 100644
--- a/docs/src/lib/const.ts
+++ b/docs/src/lib/const.ts
@@ -1 +1,4 @@
export const DEFAULT_EVENT_LIMIT = 3_000;
+
+export const FREE_SITE_LIMIT = 1;
+export const STANDARD_SITE_LIMIT = 5;