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.

Add about section

Tim Wilson5f538a07404d
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page-client.tsx
new file mode 100644
index 0000000000..05b240ffe3
--- /dev/null
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page-client.tsx
@@ -0,0 +1,51 @@
+"use client";
+
+import usePartner from "@/lib/swr/use-partner";
+import { OnlinePresenceSummary } from "@/ui/partners/online-presence-summary";
+import { useParams } from "next/navigation";
+
+export function ProgramPartnerAboutPageClient() {
+ const { partnerId } = useParams() as { partnerId: string };
+ const { partner, error } = usePartner({ partnerId });
+
+ return partner ? (
+ <>
+ <div className="flex flex-col gap-2">
+ <h3 className="text-content-emphasis text-xs font-semibold">
+ Description
+ </h3>
+ <p className="text-content-default text-xs">
+ {partner.description || (
+ <span className="italic text-neutral-400">
+ No description provided
+ </span>
+ )}
+ </p>
+ </div>
+
+ <div className="flex flex-col gap-2">
+ <h3 className="text-content-emphasis text-xs font-semibold">
+ Website and socials
+ </h3>
+ <OnlinePresenceSummary
+ partner={partner}
+ showLabels={false}
+ className="gap-y-2"
+ />
+ </div>
+ </>
+ ) : error ? (
+ <div className="flex justify-center py-16">
+ <span className="text-content-subtle text-sm">
+ Failed to load partner links
+ </span>
+ </div>
+ ) : (
+ [...Array(2)].map((_, index) => (
+ <div key={index} className="flex flex-col gap-2">
+ <div className="h-4 w-20 animate-pulse rounded-md bg-neutral-200" />
+ <div className="h-4 w-40 animate-pulse rounded-md bg-neutral-200" />
+ </div>
+ ))
+ );
+}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page.tsx
index f84abdc237..a65aed4657 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/[partnerId]/about/page.tsx
@@ -1,3 +1,12 @@
+import { ProgramPartnerAboutPageClient } from "./page-client";
+
export default function ProgramPartnerAboutPage() {
- return <h2 className="text-content-emphasis text-lg font-semibold">About</h2>;
+ return (
+ <>
+ <h2 className="text-content-emphasis text-lg font-semibold">About</h2>
+ <div className="mt-5 flex flex-col gap-5">
+ <ProgramPartnerAboutPageClient />
+ </div>
+ </>
+ );
}
diff --git a/apps/web/ui/partners/online-presence-summary.tsx b/apps/web/ui/partners/online-presence-summary.tsx
index 9794e853a7..497c64807d 100644
--- a/apps/web/ui/partners/online-presence-summary.tsx
+++ b/apps/web/ui/partners/online-presence-summary.tsx
@@ -88,9 +88,11 @@ const fields: {
export function OnlinePresenceSummary({
partner,
+ showLabels = true,
className,
}: {
partner: EnrolledPartnerProps;
+ showLabels?: boolean;
className?: string;
}) {
const fieldData = fields
@@ -104,14 +106,17 @@ export function OnlinePresenceSummary({
return fieldData.length ? (
<div
className={cn(
- "grid grid-cols-[max-content_minmax(0,1fr)] items-center gap-x-4 gap-y-5 text-sm md:gap-x-16",
+ "grid items-center gap-x-4 gap-y-5 text-sm md:gap-x-16",
+ showLabels ? "grid-cols-[max-content_minmax(0,1fr)]" : "grid-cols-1",
className,
)}
>
{fieldData.map(({ label, icon: Icon, value, verified, href, info }) => {
return (
<Fragment key={label}>
- <span className="text-content-default font-medium">{label}</span>
+ {showLabels && (
+ <span className="text-content-default font-medium">{label}</span>
+ )}
<div>
<OnlinePresenceCard
icon={Icon}