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 FAQs with default templated questions

Steven Tey11f08d4291c0
diff --git a/apps/web/app/app.dub.co/embed/faq.tsx b/apps/web/app/app.dub.co/embed/faq.tsx
new file mode 100644
index 0000000000..54af46c069
--- /dev/null
+++ b/apps/web/app/app.dub.co/embed/faq.tsx
@@ -0,0 +1,54 @@
+import { BlockMarkdown } from "@/ui/partners/lander-blocks/BlockMarkdown";
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@dub/ui";
+import { TAB_ITEM_ANIMATION_SETTINGS } from "@dub/utils";
+import { Program } from "@prisma/client";
+import { motion } from "framer-motion";
+
+export function EmbedFAQ({ program }: { program: Program }) {
+ const items = [
+ {
+ title: `What is the ${program.name} Affiliate Program`,
+ content: `The ${program.name} Affiliate Program is a way for you to earn money by referring new customers to ${program.name}. For each new customer you refer, you'll earn a ${program.commissionAmount}% commission on their subscription for up to ${program.recurringDuration} ${program.recurringInterval}s. There are no limits to how much you can earn.`,
+ },
+ {
+ title: "What counts as a successful conversion?",
+ content: `New customers that sign up for a paid plan within ${program.cookieLength} days of using your referral link will be counted as a successful conversion. Attributions are done on a last-click basis, so your link must be the last link clicked before the customer signs up for an account on ${program.name}.`,
+ },
+ {
+ title: "How should I promote the program?",
+ content:
+ "You should promote the program by sharing your unique referral link with your audience. When you post or distribute content about Dub, your message must make it obvious that you have a financially compensated relationship with Dub. We need all promotions to be FTC compliant. A helpful guide can be found [here](https://www.ftc.gov/business-guidance/resources/disclosures-101-social-media-influencers).",
+ },
+ {
+ title: "Can I refer myself?",
+ content:
+ "Self-referrals are not allowed. The goal of the program is to reward you for referring other people. This is not a way for you to get a discount on your own account.",
+ },
+ ];
+ return (
+ <motion.div
+ className="rounded-lg border border-neutral-100 bg-white px-8 py-4"
+ {...TAB_ITEM_ANIMATION_SETTINGS}
+ >
+ <Accordion type="multiple">
+ {items.map((item, idx) => (
+ <AccordionItem key={idx} value={idx.toString()}>
+ <AccordionTrigger className="py-2 text-neutral-700" variant="plus">
+ <h3 className="text-base">{item.title}</h3>
+ </AccordionTrigger>
+ <AccordionContent>
+ <BlockMarkdown className="py-2 text-neutral-500">
+ {item.content}
+ </BlockMarkdown>
+ </AccordionContent>
+ </AccordionItem>
+ ))}
+ </Accordion>
+ </motion.div>
+ );
+}
diff --git a/apps/web/app/app.dub.co/embed/inline/page-client.tsx b/apps/web/app/app.dub.co/embed/inline/page-client.tsx
index 255cae7f28..a790c9b510 100644
--- a/apps/web/app/app.dub.co/embed/inline/page-client.tsx
+++ b/apps/web/app/app.dub.co/embed/inline/page-client.tsx
@@ -15,6 +15,7 @@ import { cn, getPrettyUrl } from "@dub/utils";
import { AnimatePresence } from "framer-motion";
import { CSSProperties, useState } from "react";
import { EmbedActivity } from "../activity";
+import { EmbedFAQ } from "../faq";
import { EmbedLeaderboard } from "../leaderboard";
import { EmbedPayouts } from "../payouts";
import { EmbedQuickstart } from "../quickstart";
@@ -122,11 +123,13 @@ export function EmbedInlinePageClient({
<AnimatePresence mode="wait">
{selectedTab === "Quickstart" ? (
<EmbedQuickstart program={program} link={link.shortLink} />
+ ) : selectedTab === "Sales" ? (
+ <EmbedSales salesCount={link.sales} />
) : selectedTab === "Leaderboard" ? (
<EmbedLeaderboard />
- ) : (
- <EmbedSales salesCount={link.sales} />
- )}
+ ) : selectedTab === "FAQ" ? (
+ <EmbedFAQ program={program} />
+ ) : null}
</AnimatePresence>
</div>
</div>
diff --git a/apps/web/app/app.dub.co/embed/quickstart.tsx b/apps/web/app/app.dub.co/embed/quickstart.tsx
index 0d01403488..8da4c80940 100644
--- a/apps/web/app/app.dub.co/embed/quickstart.tsx
+++ b/apps/web/app/app.dub.co/embed/quickstart.tsx
@@ -63,7 +63,7 @@ export function EmbedQuickstart({
description:
"Make sure you get setup for success with the official brand files and supportive content and documents.",
illustration: <SuccessKit logo={program.logo ?? DUB_LOGO} />,
- cta: <Button className={BUTTON_CLASSNAME} text="Download success kit" />,
+ cta: <Button className="h-9 rounded-lg" text="Coming soon" disabled />,
},
{
title: "Receive earnings",