Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix paywall

Steven Teyf5020ae1dc40
diff --git a/apps/web/ui/analytics/index.tsx b/apps/web/ui/analytics/index.tsx
index 936e5afc79..583fafa972 100644
--- a/apps/web/ui/analytics/index.tsx
+++ b/apps/web/ui/analytics/index.tsx
@@ -6,6 +6,7 @@ import { cn } from "@dub/utils";
2. Public stats page, e.g. dub.sh/stats/github, stey.me/stats/weathergpt
*/
+import useWorkspace from "@/lib/swr/use-workspace";
import { useContext } from "react";
import AnalyticsProvider, {
AnalyticsContext,
@@ -47,13 +48,15 @@ export default function Analytics({
}
function StatsGrid() {
- const { dashboardProps, partnerPage, conversionsEnabled, selectedTab, view } =
+ const { dashboardProps, partnerPage, selectedTab, view } =
useContext(AnalyticsContext);
+ const { plan } = useWorkspace();
- const show =
- conversionsEnabled || (selectedTab === "clicks" && view !== "funnel");
+ const hide =
+ (selectedTab === "leads" || selectedTab === "sales" || view === "funnel") &&
+ (plan === "free" || plan === "pro");
- return show ? (
+ return hide ? null : (
<div className="grid grid-cols-1 gap-5 md:grid-cols-2">
{!dashboardProps && !partnerPage && <TopLinks />}
<Locations />
@@ -61,5 +64,5 @@ function StatsGrid() {
<Referer />
{/* <Feedback /> */}
</div>
- ) : null;
+ );
}
diff --git a/apps/web/ui/analytics/main.tsx b/apps/web/ui/analytics/main.tsx
index 49323bb0b8..5806e0571b 100644
--- a/apps/web/ui/analytics/main.tsx
+++ b/apps/web/ui/analytics/main.tsx
@@ -152,7 +152,7 @@ export default function Main() {
}
className={cn(
"text-2xl font-medium sm:text-3xl",
- conversions && !conversionsEnabled && "opacity-30",
+ showPaywall && "opacity-30",
)}
format={
id === "sales" && saleUnit === "saleAmount"