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.

Disable some steps for Shopify

Tim Wilsone99c1c557167
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
index 57dc77ad0b..475868a25e 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/page.tsx
@@ -3,7 +3,8 @@
import Link from "next/link";
import { useWorkspaceStore } from "@/lib/swr/use-workspace-store";
-import { useLocalStorage } from "@dub/ui";
+import { useLocalStorage, useRouterStuff } from "@dub/ui";
+import { cn } from "@dub/utils";
import BaseScriptSection from "./base-script-section";
import { CompleteStepButton } from "./complete-step-button";
import ConnectionInstructions from "./connection-instructions";
@@ -15,6 +16,9 @@ import TrackSalesGuidesSection from "./track-sales-guides-section";
import VerifyInstall from "./verify-install";
const ConnectStep = ({ expanded, toggleExpanded }: BaseStepProps) => {
+ const { searchParams } = useRouterStuff();
+ const guide = searchParams.get("guide");
+
return (
<Step
id="connect"
@@ -25,14 +29,21 @@ const ConnectStep = ({ expanded, toggleExpanded }: BaseStepProps) => {
toggleExpanded={toggleExpanded}
contentClassName="flex flex-col gap-8"
>
- <div className="flex flex-col gap-3">
- <BaseScriptSection />
+ <div
+ className={cn(
+ "transition-opacity",
+ guide === "shopify" && "cursor-not-allowed opacity-50",
+ )}
+ >
+ <div className="flex flex-col gap-3" inert={guide === "shopify"}>
+ <BaseScriptSection />
- <ConversionTrackingSection />
+ <ConversionTrackingSection />
- {/* TODO: Site visit tracking */}
+ {/* TODO: Site visit tracking */}
- <OutboundDomainTrackingSection />
+ <OutboundDomainTrackingSection />
+ </div>
</div>
<div className="flex flex-col gap-3">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
index adbfc3eaf2..005ce8c692 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/use-selected-guide.ts
@@ -22,6 +22,6 @@ export function useSelectedGuide({ guides }: { guides: IntegrationGuide[] }) {
return {
selectedGuide,
setSelectedGuide: (guide: IntegrationGuide) =>
- queryParams({ set: { guide: guide.title.toLowerCase() } }),
+ queryParams({ set: { guide: guide.title.toLowerCase() }, scroll: false }),
};
}