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 layout

Kiran K2451a7a32c18
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
index 3904ba9524..82bd732361 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide-list.tsx
@@ -186,7 +186,7 @@ export function GuideList() {
<div className="flex items-center justify-between gap-4">
<Button
text="Share with a developer"
- className="h-8 w-fit"
+ className="h-8 w-fit rounded-lg"
variant="outline"
icon={
copied ? <Check className="size-4" /> : <Copy className="size-4" />
diff --git a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
index ccaca1b181..0a507d44f7 100644
--- a/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
+++ b/apps/web/app/(ee)/app.dub.co/(new-program)/[slug]/program/new/connect/guide.tsx
@@ -1,13 +1,9 @@
"use client";
-import { onboardProgramAction } from "@/lib/actions/partners/onboard-program";
import useWorkspace from "@/lib/swr/use-workspace";
import { Button } from "@dub/ui";
-import { useAction } from "next-safe-action/hooks";
import { useRouter } from "next/navigation";
-import { useState } from "react";
-import { toast } from "sonner";
-import { IntegrationGuide } from "./integration-guides";
+import { IntegrationGuide, IntegrationType } from "./integration-guides";
import { Markdown } from "./markdown";
interface GuideProps {
@@ -15,85 +11,56 @@ interface GuideProps {
markdown: string | null;
}
-type ButtonType = "completed" | "later";
+const integrationTypeToTitle: Record<IntegrationType, string> = {
+ "client-sdk": "client-side script",
+ "server-sdk": "server-side script",
+ "track-leads": "tracking lead events",
+ "track-sales": "tracking sale events",
+};
export function Guide({ selectedGuide, markdown }: GuideProps) {
const router = useRouter();
- const { id: workspaceId, slug: workspaceSlug, mutate } = useWorkspace();
- const [pressedButton, setPressedButton] = useState<ButtonType | null>(null);
-
- const { executeAsync, isPending } = useAction(onboardProgramAction, {
- onSuccess: () => {
- router.push(`/${workspaceSlug}/program/new/overview`);
- mutate();
- },
- onError: ({ error }) => {
- toast.error(error.serverError);
- setPressedButton(null);
- },
- });
-
- const onContinue = async (buttonType: "completed" | "later") => {
- if (!workspaceId) {
- return;
- }
-
- setPressedButton(buttonType);
-
- await executeAsync({
- workspaceId,
- step: "connect",
- });
- };
-
- const Icon = selectedGuide.icon;
+ const { slug: workspaceSlug } = useWorkspace();
if (!markdown) {
return null;
}
+ const Icon = selectedGuide.icon;
+
return (
<>
<hr className="mb-6 border-neutral-200" />
- <div className="mx-auto max-w-2xl">
+ <div className="mx-auto max-w-2xl space-y-6">
<div className="flex items-center justify-between">
<Icon className="size-8" />
<Button
text="Select another method"
variant="secondary"
- className="h-8 w-fit rounded-lg px-2"
+ className="h-8 w-fit rounded-lg px-3"
type="button"
onClick={() => router.push(`/${workspaceSlug}/program/new/connect`)}
/>
</div>
- <h2 className="mt-6 text-xl font-semibold leading-7 text-neutral-900">
- {selectedGuide.description}
- </h2>
+ <div className="flex flex-col">
+ <span className="text-sm font-medium leading-5 text-neutral-500">
+ Set up {integrationTypeToTitle[selectedGuide.type]}
+ </span>
+ <span className="text-xl font-semibold leading-7 text-neutral-900">
+ Instructions for {selectedGuide.title}
+ </span>
+ </div>
- <div className="rounded-2xl bg-white p-0 py-6 shadow-none">
+ <div className="space-y-6 rounded-2xl bg-white p-0 shadow-none">
<Markdown>{markdown}</Markdown>
- <div className="mt-10 flex flex-col gap-2">
- <Button
- text="I've completed this"
- className="w-full"
- type="button"
- onClick={() => onContinue("completed")}
- loading={isPending && pressedButton === "completed"}
- disabled={isPending && pressedButton === "later"}
- />
-
- <Button
- text="I'll do this later"
- variant="secondary"
- className="w-full"
- type="button"
- onClick={() => onContinue("later")}
- loading={isPending && pressedButton === "later"}
- disabled={isPending && pressedButton === "completed"}
- />
- </div>
+ <Button
+ text="I've completed this"
+ className="w-full"
+ type="button"
+ onClick={() => router.back()}
+ />
</div>
</div>
</>