The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
WIP profile discovery guide
Tim Wilson398bf7c9ab88
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/page-client.tsxindex 7ec4bc12e9..fd8d589079 100644--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/page-client.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/page-client.tsx@@ -8,6 +8,7 @@ import { Button } from "@dub/ui";import { AboutYouForm } from "./about-you-form";import { HowYouWorkForm } from "./how-you-work-form";import { ProfileDetailsForm } from "./profile-details-form";+import { ProfileDiscoveryGuide } from "./profile-discovery-guide";export function ProfileSettingsPageClient() {const { partner } = usePartnerProfile();@@ -23,6 +24,7 @@ export function ProfileSettingsPageClient() {controls={<Controls />}><PageWidthWrapper className="mb-20 flex flex-col gap-6">+ {partner && <ProfileDiscoveryGuide partner={partner} />}<ProfileDetailsForm partner={partner} /><AboutYouForm partner={partner} /><HowYouWorkForm partner={partner} />diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-discovery-guide.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-discovery-guide.tsxnew file mode 100644index 0000000000..f7e00fa5ac--- /dev/null+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/profile-discovery-guide.tsx@@ -0,0 +1,75 @@+import { PartnerProps } from "@/lib/types";+import { Button, ChevronUp, ProgressCircle } from "@dub/ui";+import { cn, isClickOnInteractiveChild } from "@dub/utils";+import { motion } from "motion/react";+import { useState } from "react";++export function ProfileDiscoveryGuide({ partner }: { partner: PartnerProps }) {+ if (partner.discoverableAt) return null;++ const [isExpanded, setIsExpanded] = useState(false);++ return (+ <motion.div+ initial={{ opacity: 0, height: 0 }}+ animate={{ opacity: 1, height: "auto" }}+ transition={{ duration: 0.2, ease: "easeOut" }}+ className="overflow-hidden"+ >+ <div+ className="text-content-inverted rounded-2xl bg-neutral-900 p-2"+ onClick={(e) => {+ if (isClickOnInteractiveChild(e)) return;+ setIsExpanded((e) => !e);+ }}+ >+ <div className="flex select-none flex-col px-3 pb-4 pt-1">+ <div className="flex justify-between">+ <div className="bg-bg-default/10 mb-4 flex w-fit items-center gap-1.5 rounded-md px-2 py-1">+ <ProgressCircle+ progress={1 / 6}+ className="text-green-500 [--track-color:#fff3]"+ />+ <span className="text-xs font-medium">+ 1 of 6 tasks completed+ </span>+ </div>+ <Button+ type="button"+ onClick={() => setIsExpanded((e) => !e)}+ variant="outline"+ className="hover:bg-bg-default/10 size-9 p-0"+ icon={+ <ChevronUp+ className={cn(+ "text-content-inverted size-4 transition-transform duration-100",+ !isExpanded && "-scale-y-100",+ )}+ />+ }+ />+ </div>+ <div>+ <h2 className="text-lg font-semibold">Get discovered</h2>+ <p className="text-content-inverted/60 text-base">+ Finish these steps to show up in Partner Discovery and get invited+ to more programs.+ </p>+ </div>+ </div>++ <motion.div+ initial={false}+ animate={{+ height: isExpanded ? "auto" : 0,+ opacity: isExpanded ? 1 : 0,+ }}+ transition={{ duration: 0.15, ease: "easeOut" }}+ className="overflow-hidden"+ >+ <div className="rounded-lg bg-neutral-800 p-2">WIP</div>+ </motion.div>+ </div>+ </motion.div>+ );+}diff --git a/packages/ui/src/icons/nucleo/chevron-up.tsx b/packages/ui/src/icons/nucleo/chevron-up.tsxnew file mode 100644index 0000000000..207c4245f8--- /dev/null+++ b/packages/ui/src/icons/nucleo/chevron-up.tsx@@ -0,0 +1,24 @@+import { SVGProps } from "react";++export function ChevronUp(props: SVGProps<SVGSVGElement>) {+ return (+ <svg+ height="18"+ width="18"+ viewBox="0 0 18 18"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ >+ <g fill="currentColor">+ <polyline+ fill="none"+ points="2.75 11.5 9 5.25 15.25 11.5"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1.5"+ />+ </g>+ </svg>+ );+}diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.tsindex c67c9e1405..1b9eb054f1 100644--- a/packages/ui/src/icons/nucleo/index.ts+++ b/packages/ui/src/icons/nucleo/index.ts@@ -42,6 +42,7 @@ export * from "./checkbox-checked-fill";export * from "./checkbox-unchecked";export * from "./chevron-left";export * from "./chevron-right";+export * from "./chevron-up";export * from "./circle-check";export * from "./circle-check-fill";export * from "./circle-dollar";diff --git a/packages/ui/src/progress-circle.tsx b/packages/ui/src/progress-circle.tsxindex 0ae56e9eb6..34259146e6 100644--- a/packages/ui/src/progress-circle.tsx+++ b/packages/ui/src/progress-circle.tsx@@ -20,16 +20,19 @@ export function ProgressCircle({width="100"height="100"viewBox="0 0 100 100"- className={cn("size-3 shrink-0 text-green-600", className)}+ className={cn(+ "size-3 shrink-0 text-green-600 [--track-color:#e5e5e5]",+ className,+ )}><circlecx="50"cy="50"r={radius}- stroke="#e5e5e5"strokeWidth={`${strokeWidth}px`}fill="none"strokeLinecap="round"+ className="stroke-[var(--track-color)]"/>{progress > 0 && (<circle