The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
final changes
Steven Teyf2092185842f
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/page.tsxindex 7d0bb30c33..4aff8f5e3c 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/page.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/page.tsx@@ -6,7 +6,7 @@ import { ProgramHelpAndSupport } from "./program-help-and-support";export default function ProgramResourcesPage() {return (<PageContent title="Resources">- <PageWidthWrapper className="mb-8">+ <PageWidthWrapper className="mb-8 grid gap-8"><ProgramHelpAndSupport /><ProgramBrandAssets /></PageWidthWrapper>diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsxindex 1a96832b20..9c84ca1146 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx@@ -5,11 +5,11 @@ import useProgramResources from "@/lib/swr/use-program-resources";import useWorkspace from "@/lib/swr/use-workspace";import { ProgramResourceType } from "@/lib/zod/schemas/program-resources";import { ResourceCard } from "@/ui/partners/resources/resource-card";-import { ResourceSection } from "@/ui/partners/resources/resource-section";-import { FileContent } from "@dub/ui";+import { AnimatedSizeContainer, FileContent, LoadingSpinner } from "@dub/ui";import { capitalize, formatFileSize } from "@dub/utils";import { useAction } from "next-safe-action/hooks";import { toast } from "sonner";+import { SettingsRow } from "../../program-settings-row";import { useAddColorModal } from "./add-color-modal";import { useAddFileModal } from "./add-file-modal";import { useAddLogoModal } from "./add-logo-modal";@@ -52,84 +52,156 @@ export function ProgramBrandAssets() {<AddLogoModal /><AddColorModal /><AddFileModal />- <div className="mt-6 flex flex-col gap-10">- <ResourceSection- resource="logo"- title="Brand logos"- description="SVG, JPG, or PNG, max size of 10 MB"- isLoading={isLoading}- isValidating={isValidating}- onAdd={() => setShowAddLogoModal(true)}- >- {resources?.logos?.map((logo) => (- <ResourceCard- key={logo.id}- resourceType="logo"- icon={- <div className="relative size-8 overflow-hidden">- <img- src={logo.url}- alt="thumbnail"- className="size-full object-contain"- />+ <div className="rounded-lg border border-neutral-200 bg-white">+ <div className="p-6">+ <h2 className="inline-flex items-center gap-2 text-lg font-semibold text-neutral-900">+ Brand Assets+ </h2>+ <p className="mt-1 text-sm text-neutral-600">+ Logos, colors, and additional documents for your partners to+ download and use+ </p>+ </div>++ <div className="divide-y divide-neutral-200 border-t border-neutral-200 px-6">+ <SettingsRow+ heading="Brand Logos"+ description="SVG, JPG, or PNG, max size of 10 MB"+ >+ <div className="flex flex-col gap-3">+ <div className="flex items-center justify-end">+ <div className="flex items-center gap-2">+ {isLoading && <LoadingSpinner className="h-4 w-4" />}+ <button+ type="button"+ onClick={() => setShowAddLogoModal(true)}+ className="rounded-md bg-neutral-900 px-3 py-2 text-sm font-medium text-white hover:bg-neutral-700 focus:outline-none focus:ring-2 focus:ring-neutral-500 focus:ring-offset-2"+ >+ Add Logo+ </button></div>- }- title={logo.name || "Logo"}- description={formatFileSize(logo.size, 0)}- downloadUrl={logo.url}- onDelete={() => handleDelete("logo", logo.id)}- />- ))}- </ResourceSection>- <ResourceSection- resource="color"- title="Colors"- description="Provide affiliates with official colors"- isLoading={isLoading}- isValidating={isValidating}- onAdd={() => setShowAddColorModal(true)}- >- {resources?.colors?.map((color) => (- <ResourceCard- key={color.id}- resourceType="color"- icon={- <div- className="size-full"- style={{ backgroundColor: color.color }}- />- }- title={color.name || "Color"}- description={color.color.toUpperCase()}- copyText={color.color.toUpperCase()}- onDelete={() => handleDelete("color", color.id)}- />- ))}- </ResourceSection>- <ResourceSection- resource="file"- title="Additional files"- description="Any document or zip file, max size 10 MB"- isLoading={isLoading}- isValidating={isValidating}- onAdd={() => setShowAddFileModal(true)}- >- {resources?.files?.map((file) => (- <ResourceCard- key={file.id}- resourceType="file"- icon={- <div className="flex size-full items-center justify-center bg-neutral-50">- <FileContent className="size-4 text-neutral-800" />+ </div>++ <AnimatedSizeContainer+ height+ transition={{ duration: 0.2, ease: "easeInOut" }}+ >+ {resources?.logos && resources.logos.length > 0 && (+ <div className="grid gap-2">+ {resources?.logos?.map((logo) => (+ <ResourceCard+ key={logo.id}+ resourceType="logo"+ icon={+ <div className="relative size-8 overflow-hidden">+ <img+ src={logo.url}+ alt="thumbnail"+ className="size-full object-contain"+ />+ </div>+ }+ title={logo.name || "Logo"}+ description={formatFileSize(logo.size, 0)}+ downloadUrl={logo.url}+ onDelete={() => handleDelete("logo", logo.id)}+ />+ ))}+ </div>+ )}+ </AnimatedSizeContainer>+ </div>+ </SettingsRow>++ <SettingsRow+ heading="Colors"+ description="Provide affiliates with official colors"+ >+ <div className="flex flex-col gap-3">+ <div className="flex items-center justify-end">+ <div className="flex items-center gap-2">+ {isLoading && <LoadingSpinner className="h-4 w-4" />}+ <button+ type="button"+ onClick={() => setShowAddColorModal(true)}+ className="rounded-md bg-neutral-900 px-3 py-2 text-sm font-medium text-white hover:bg-neutral-700 focus:outline-none focus:ring-2 focus:ring-neutral-500 focus:ring-offset-2"+ >+ Add Color+ </button>+ </div>+ </div>+ <AnimatedSizeContainer+ height+ transition={{ duration: 0.2, ease: "easeInOut" }}+ >+ {resources?.colors && resources.colors.length > 0 && (+ <div className="grid gap-2">+ {resources?.colors?.map((color) => (+ <ResourceCard+ key={color.id}+ resourceType="color"+ icon={+ <div+ className="size-full"+ style={{ backgroundColor: color.color }}+ />+ }+ title={color.name || "Color"}+ description={color.color.toUpperCase()}+ copyText={color.color.toUpperCase()}+ onDelete={() => handleDelete("color", color.id)}+ />+ ))}+ </div>+ )}+ </AnimatedSizeContainer>+ </div>+ </SettingsRow>++ <SettingsRow+ heading="Additional Files"+ description="Any document or zip file, max size 10 MB"+ >+ <div className="flex flex-col gap-3">+ <div className="flex items-center justify-end">+ <div className="flex items-center gap-2">+ {isLoading && <LoadingSpinner className="h-4 w-4" />}+ <button+ type="button"+ onClick={() => setShowAddFileModal(true)}+ className="rounded-md bg-neutral-900 px-3 py-2 text-sm font-medium text-white hover:bg-neutral-700 focus:outline-none focus:ring-2 focus:ring-neutral-500 focus:ring-offset-2"+ >+ Add File+ </button></div>- }- title={file.name || "File"}- description={formatFileSize(file.size, 0)}- downloadUrl={file.url}- onDelete={() => handleDelete("file", file.id)}- />- ))}- </ResourceSection>+ </div>+ <AnimatedSizeContainer+ height+ transition={{ duration: 0.2, ease: "easeInOut" }}+ >+ {resources?.files && resources.files.length > 0 && (+ <div className="grid gap-2">+ {resources?.files?.map((file) => (+ <ResourceCard+ key={file.id}+ resourceType="file"+ icon={+ <div className="flex size-full items-center justify-center bg-neutral-50">+ <FileContent className="size-4 text-neutral-800" />+ </div>+ }+ title={file.name || "File"}+ description={formatFileSize(file.size, 0)}+ downloadUrl={file.url}+ onDelete={() => handleDelete("file", file.id)}+ />+ ))}+ </div>+ )}+ </AnimatedSizeContainer>+ </div>+ </SettingsRow>+ </div></div></>);diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsxindex 17778cc33f..c81e8ef152 100644--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx@@ -261,16 +261,16 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {icon: Brush,href: `/${slug}/program/branding`,},- {- name: "Link Settings",- icon: Sliders,- href: `/${slug}/program/link-settings`,- },{name: "Resources",icon: LifeRing,href: `/${slug}/program/resources`,},+ {+ name: "Link Settings",+ icon: Sliders,+ href: `/${slug}/program/link-settings`,+ },],},],