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.

Remove separate sites page + nav area

Tim Wilson56a6d8002478
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page-client.tsx
deleted file mode 100644
index a8c98aa665..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page-client.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-"use client";
-
-import usePartnerProfile from "@/lib/swr/use-partner-profile";
-import { PageContent } from "@/ui/layout/page-content";
-import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";
-import {
- OnlinePresenceForm,
- useOnlinePresenceForm,
-} from "@/ui/partners/online-presence-form";
-import { Button, DotsPattern, LoadingSpinner } from "@dub/ui";
-import { useRef } from "react";
-import { toast } from "sonner";
-
-export function ProfileSocialPageClient() {
- const { partner, error } = usePartnerProfile();
-
- const form = useOnlinePresenceForm({ partner });
- const formRef = useRef<HTMLFormElement>(null);
- const {
- formState: { isSubmitting },
- } = form;
-
- return (
- <PageContent
- title="Website and socials"
- titleInfo={{
- title:
- "Build a stronger partner profile and increase trust by adding and verifying your website and social accounts.",
- href: "https://dub.co/help/article/partner-profile-sites",
- }}
- controls={
- <Button
- text="Save changes"
- className="h-8 w-fit px-2.5"
- loading={isSubmitting}
- onClick={() => formRef.current?.requestSubmit()}
- />
- }
- >
- <PageWidthWrapper className="flex flex-col gap-8">
- <div className="relative m-1 mb-8">
- <div
- className="pointer-events-none absolute inset-0 rounded-2xl bg-neutral-100/50 [mask-image:linear-gradient(black,transparent_60%)]"
- aria-hidden
- >
- <div className="absolute inset-4 overflow-hidden">
- <div className="absolute inset-y-0 left-1/2 w-[1200px] -translate-x-1/2">
- <DotsPattern className="text-neutral-200/80" />
- </div>
- </div>
- </div>
- <div className="relative mx-auto my-12 w-full max-w-[400px]">
- {partner ? (
- <OnlinePresenceForm
- ref={formRef}
- form={form}
- partner={partner}
- variant="settings"
- onSubmitSuccessful={() => {
- toast.success("Online presence updated successfully.");
- }}
- />
- ) : (
- <div className="flex h-32 w-full items-center justify-center">
- {error ? (
- <span className="text-sm text-neutral-500">
- Failed to load online presence data
- </span>
- ) : (
- <LoadingSpinner />
- )}
- </div>
- )}
- </div>
- </div>
- </PageWidthWrapper>
- </PageContent>
- );
-}
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page.tsx
deleted file mode 100644
index ec27179cfe..0000000000
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/sites/page.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { ProfileSocialPageClient } from "./page-client";
-
-export default function ProfileSocialPage() {
- return <ProfileSocialPageClient />;
-}
diff --git a/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
index 55b1076c09..19dc998120 100644
--- a/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/partners-sidebar-nav.tsx
@@ -9,11 +9,9 @@ import {
Bell,
CircleDollar,
CircleInfo,
- CircleUser,
ColorPalette2,
Gauge6,
Gear2,
- Globe,
GridIcon,
MoneyBills2,
Msgs,
@@ -195,45 +193,6 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {
],
}),
- // Partner profile
- profile: () => ({
- title: "Partner profile",
- direction: "left",
- content: [
- {
- items: [
- {
- name: "Profile info",
- icon: CircleUser,
- href: "/profile",
- exact: true,
- },
- {
- name: "Website and socials",
- icon: Globe,
- href: "/profile/sites",
- },
- ],
- },
- ],
- }),
-
- // Payouts
- payouts: () => ({
- title: "Payouts",
- content: [
- {
- items: [
- {
- name: "Payouts",
- icon: MoneyBills2,
- href: "/payouts",
- },
- ],
- },
- ],
- }),
-
// Partner settings
partnerSettings: () => ({
title: "Settings",
@@ -306,13 +265,13 @@ export function PartnersSidebarNav({
? "userSettings"
: pathname.startsWith("/settings")
? "partnerSettings"
- : pathname.startsWith("/profile")
- ? "profile"
- : pathname.startsWith("/payouts") || pathname.startsWith("/messages")
- ? null
- : isEnrolledProgramPage
- ? "program"
- : "programs";
+ : ["/payouts", "/profile", "/messages"].some((p) =>
+ pathname.startsWith(p),
+ )
+ ? null
+ : isEnrolledProgramPage
+ ? "program"
+ : "programs";
}, [pathname, programSlug, isEnrolledProgramPage]);
const { count: invitationsCount } = useProgramEnrollmentsCount({