The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Merge branch 'main' into program-application-form
Steven Tey8948040d57a7
diff --cc apps/web/ui/partners/program-application-sheet.tsxindex 3e75e580b4,cd9d0cc971..c17b98797c--- a/apps/web/ui/partners/program-application-sheet.tsx+++ b/apps/web/ui/partners/program-application-sheet.tsx@@@ -146,120 -114,142 +146,118 @@@ function ProgramApplicationSheetContent</div></div></div>- </div>- </Sheet.Title>- <Sheet.Close asChild>- <Button- variant="outline"- icon={<X className="size-5" />}- className="h-auto w-fit p-1"- />- </Sheet.Close>- </div>-- <div className="flex flex-col gap-6 p-5 sm:p-8">- <label>- <span className="text-sm font-medium text-neutral-800">- How do you plan to promote {program.name}?- </span>- <ReactTextareaAutosize- className={cn(- "mt-2 block max-h-48 min-h-12 w-full rounded-md focus:outline-none sm:text-sm",- errors.proposal- ? "border-red-400 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-[var(--brand)] focus:ring-[var(--brand)]",- )}- placeholder=""- minRows={3}- {...register("proposal", { required: true })}- />- </label>+ </Sheet.Title>+ <Sheet.Close asChild>+ <Button+ variant="outline"+ icon={<X className="size-5" />}+ className="h-auto w-fit p-1"+ />+ </Sheet.Close>+ </div>- <label>- <span className="text-sm font-medium text-neutral-800">- Any additional questions or comments?- <span className="font-normal text-neutral-500"> (optional)</span>- </span>- <ReactTextareaAutosize- className={cn(- "mt-2 block max-h-48 min-h-12 w-full rounded-md focus:outline-none sm:text-sm",- errors.comments- ? "border-red-400 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-[var(--brand)] focus:ring-[var(--brand)]",- )}- placeholder=""- minRows={3}- {...register("comments")}- />- </label>+ <div className="flex flex-col gap-6 p-5 sm:p-8">+ {fields.map((field, index) => {+ return (+ <ProgramApplicationFormField+ key={field.id}+ field={field}+ keyPath={`formData.fields.${index}`}+ />+ );+ })}- {program.termsUrl && (- <div className="flex items-center gap-2">- <input- type="checkbox"- id="termsAgreement"- className={cn(- "h-4 w-4 rounded border-neutral-300 text-[var(--brand)] focus:ring-[var(--brand)]",- errors.termsAgreement && "border-red-400 focus:ring-red-500",- )}- {...register("termsAgreement", {- required: true,- validate: (v) => v === true,- })}- />- <label- htmlFor="termsAgreement"- className="text-sm text-neutral-800"- >- I agree to the{" "}- <a- href={program.termsUrl}- target="_blank"- rel="noopener noreferrer"- className="text-[var(--brand)] underline hover:opacity-80"+ {program.termsUrl && (+ <div className="flex items-center gap-2">+ <input+ type="checkbox"+ id="termsAgreement"+ className={cn(+ "h-4 w-4 rounded border-neutral-300 text-[var(--brand)] focus:ring-[var(--brand)]",+ errors.termsAgreement &&+ "border-red-400 focus:ring-red-500",+ )}+ {...register("termsAgreement", {+ required: true,+ validate: (v) => v === true,+ })}+ />+ <label+ htmlFor="termsAgreement"+ className="text-sm text-neutral-800">- {program.name} Affiliate Program Terms ↗- </a>- </label>- </div>- )}- </div>+ I agree to the{" "}+ <a+ href={program.termsUrl}+ target="_blank"+ rel="noopener noreferrer"+ className="text-[var(--brand)] underline hover:opacity-80"+ >+ {program.name} Affiliate Program Terms ↗+ </a>+ </label>+ </div>+ )}+ </div>- <div className="flex grow flex-col justify-end p-5">- <Button- type="submit"- variant="primary"- text="Submit application"- loading={isSubmitting}- />- </div>- </form>- <div- className={cn(- "absolute inset-0 flex items-center justify-center transition-[transform,opacity]",- isSubmitSuccessful- ? "translate-y-0 opacity-100"- : "pointer-events-none translate-y-4 opacity-0",- )}- inert={!isSubmitSuccessful}- >- <Grid- cellSize={60}- className="[mask-image:linear-gradient(black,transparent)]"- />- <div className="relative flex flex-col items-center">- <div className="relative z-0 flex items-center">- <img- src={program.logo || `${OG_AVATAR_URL}${program.name}`}- alt={program.name}- className="z-10 size-20 rotate-[-15deg] rounded-full drop-shadow-md"- />- <img- src={partner?.image || `${OG_AVATAR_URL}${partner?.name}`}- alt={partner?.name}- className="-ml-4 size-20 rotate-[15deg] rounded-full drop-shadow-md"+ <div className="flex grow flex-col justify-end p-5">+ <Button+ type="submit"+ variant="primary"+ text="Submit application"+ loading={isSubmitting}/>- <div className="absolute -bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-white p-0.5">- <CircleCheckFill className="size-8 text-green-500" />+ </div>+ </form>+ <div+ className={cn(+ "absolute inset-0 flex items-center justify-center transition-[transform,opacity]",+ isSubmitSuccessful+ ? "translate-y-0 opacity-100"+ : "pointer-events-none translate-y-4 opacity-0",+ )}- {...{- inert: !isSubmitSuccessful,- }}++ inert={!isSubmitSuccessful}+ >+ <Grid+ cellSize={60}+ className="[mask-image:linear-gradient(black,transparent)]"+ />+ <div className="relative flex flex-col items-center">+ <div className="relative z-0 flex items-center">+ <img+ src={program.logo || `${OG_AVATAR_URL}${program.name}`}+ alt={program.name}+ className="z-10 size-20 rotate-[-15deg] rounded-full drop-shadow-md"+ />+ <img+ src={partner?.image || `${OG_AVATAR_URL}${partner?.name}`}+ alt={partner?.name || "Your avatar"}+ className="-ml-4 size-20 rotate-[15deg] rounded-full drop-shadow-md"+ />+ <div className="absolute -bottom-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-white p-0.5">+ <CircleCheckFill className="size-8 text-green-500" />+ </div></div>+ <span className="mt-6 block text-base font-semibold text-neutral-900">+ Application submitted+ </span>+ <p className="mt-2 max-w-[300px] text-pretty text-center text-sm text-neutral-500">+ You're all set! Your application is pending review and we'll email+ you once approved.+ </p>+ <Link+ href="/programs"+ className={cn(+ buttonVariants({ variant: "primary" }),+ "mt-8 flex h-10 w-fit cursor-pointer items-center rounded-md border px-4 text-sm",+ )}+ >+ Back to programs+ </Link></div>- <span className="mt-6 block text-base font-semibold text-neutral-900">- Application submitted- </span>- <p className="mt-2 max-w-[300px] text-pretty text-center text-sm text-neutral-500">- You're all set! Your application is pending review and we'll email- you once approved.- </p>- <Link- href="/programs"- className={cn(- buttonVariants({ variant: "primary" }),- "mt-8 flex h-10 w-fit cursor-pointer items-center rounded-md border px-4 text-sm",- )}- >- Back to programs- </Link></div></div>- </div>+ </FormProvider>);}