The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
WIP online presence form
Tim Wilson1e164bb5bd9e
diff --git a/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/online-presence-form.tsx b/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/online-presence-form.tsxindex 2fe4926176..5a6d5dd56b 100644--- a/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/online-presence-form.tsx+++ b/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/online-presence-form.tsx@@ -1,17 +1,30 @@"use client";import { Button } from "@dub/ui";+import { cn } from "@dub/utils/src/functions";import { useRouter } from "next/navigation";import { useRef } from "react";import { useForm } from "react-hook-form";+import { z } from "zod";++const onlinePresenceSchema = z.object({+ website: z.string().url().optional(),+ instagram: z.string().optional(),+ tiktok: z.string().optional(),+ youtube: z.string().optional(),+ twitter: z.string().optional(),+});++type OnlinePresenceFormData = z.infer<typeof onlinePresenceSchema>;export function OnlinePresenceForm({ country }: { country: string | null }) {const router = useRouter();const {+ register,handleSubmit,- formState: { isSubmitting, isSubmitSuccessful },- } = useForm();+ formState: { errors, isSubmitting, isSubmitSuccessful },+ } = useForm<OnlinePresenceFormData>();const formRef = useRef<HTMLFormElement>(null);@@ -23,7 +36,86 @@ export function OnlinePresenceForm({ country }: { country: string | null }) {)}className="flex w-full flex-col gap-4 text-left">- WIP+ <label>+ <span className="text-sm font-medium text-neutral-800">Website</span>+ <input+ type="url"+ className={cn(+ "mt-2 block w-full rounded-md focus:outline-none sm:text-sm",+ errors.website+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",+ )}+ placeholder="https://"+ {...register("website")}+ />+ <p className="mt-1.5 text-xs text-neutral-500">+ Verification may take up to 48 hours.+ </p>+ </label>++ <label>+ <span className="text-sm font-medium text-neutral-800">Instagram</span>+ <input+ type="text"+ className={cn(+ "mt-2 block w-full rounded-md focus:outline-none sm:text-sm",+ errors.instagram+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",+ )}+ placeholder="instagram.com/handle"+ {...register("instagram")}+ />+ </label>++ <label>+ <span className="text-sm font-medium text-neutral-800">TikTok</span>+ <input+ type="text"+ className={cn(+ "mt-2 block w-full rounded-md focus:outline-none sm:text-sm",+ errors.tiktok+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",+ )}+ placeholder="tiktok.com/@handle"+ {...register("tiktok")}+ />+ </label>++ <label>+ <span className="text-sm font-medium text-neutral-800">YouTube</span>+ <input+ type="text"+ className={cn(+ "mt-2 block w-full rounded-md focus:outline-none sm:text-sm",+ errors.youtube+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",+ )}+ placeholder="youtube.com/handle"+ {...register("youtube")}+ />+ </label>++ <label>+ <span className="text-sm font-medium text-neutral-800">+ X (Twitter)+ </span>+ <input+ type="text"+ className={cn(+ "mt-2 block w-full rounded-md focus:outline-none sm:text-sm",+ errors.twitter+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",+ )}+ placeholder="x.com/handle"+ {...register("twitter")}+ />+ </label>+<Buttontype="submit"text="Continue"diff --git a/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/page.tsx b/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/page.tsxindex 84c18971bc..0ec091f1be 100644--- a/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/page.tsx+++ b/apps/web/app/partners.dub.co/(onboarding)/onboarding/online-presence/page.tsx@@ -27,7 +27,14 @@ export default async function OnboardingOnlinePresence() {Your online presence</h1>- <OnlinePresenceForm country={partner.country} />+ <p className="mt-2 text-sm text-neutral-600">+ These improve your reputation score and rank you higher. Verification+ is optional and can be done later.+ </p>++ <div className="mt-8">+ <OnlinePresenceForm country={partner.country} />+ </div></div></div>);