Skip to content

Commit a377ca7

Browse files
committed
include SidebarUsage on free plans + improve PAYOUT_STATUS_DESCRIPTIONS
1 parent f7bd6df commit a377ca7

8 files changed

Lines changed: 68 additions & 309 deletions

File tree

apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/payout-stats.tsx

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import usePartnerPayoutsCount from "@/lib/swr/use-partner-payouts-count";
44
import usePartnerProfile from "@/lib/swr/use-partner-profile";
55
import { PayoutsCount } from "@/lib/types";
66
import { PayoutStatusBadges } from "@/ui/partners/payout-status-badges";
7+
import { PAYOUT_STATUS_DESCRIPTIONS } from "@/ui/partners/payout-status-descriptions";
78
import { AlertCircleFill } from "@/ui/shared/icons";
89
import { PayoutStatus } from "@dub/prisma/client";
910
import { Tooltip } from "@dub/ui";
@@ -15,30 +16,6 @@ import {
1516
} from "@dub/utils";
1617
import { HelpCircle } from "lucide-react";
1718

18-
const tooltips = {
19-
stripe: {
20-
pending:
21-
"Payouts that have passed the program's holding period and are waiting to be processed.",
22-
processing:
23-
" Payouts that are being processed by the program – this can take up to 5 business days.",
24-
processed:
25-
"Payouts that have been processed by the program and will be paid out to your connected bank account once they reach your minimum withdrawal balance.",
26-
sent: "Payouts that are on their way to your connected bank account – this can take anywhere from 1 to 14 business days depending on your bank location.",
27-
completed:
28-
"Payouts that have been paid out to your connected bank account.",
29-
},
30-
31-
paypal: {
32-
pending:
33-
"Payouts that have passed the program's holding period and are waiting to be processed.",
34-
processing:
35-
"Payouts that have been processed by the program and are on their way to your PayPal account - this can take up to 5 business days.",
36-
processed: "",
37-
sent: "",
38-
completed: "Payouts that have been paid out to your PayPal account",
39-
},
40-
} as const;
41-
4219
function PayoutStatsCard({
4320
label,
4421
amount,
@@ -143,7 +120,9 @@ export function PayoutStats() {
143120
}
144121
}
145122

146-
const tooltip = payoutMethod ? tooltips[payoutMethod] : undefined;
123+
const tooltip = payoutMethod
124+
? PAYOUT_STATUS_DESCRIPTIONS[payoutMethod]
125+
: undefined;
147126

148127
const payoutStats = [
149128
{

apps/web/ui/layout/sidebar/app-sidebar-nav.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import { Hyperlink } from "./icons/hyperlink";
4343
import { LinesY } from "./icons/lines-y";
4444
import { User } from "./icons/user";
4545
import { SidebarNav, SidebarNavAreas, SidebarNavGroups } from "./sidebar-nav";
46+
import { SidebarUsage } from "./usage";
4647
import { useProgramApplicationsCount } from "./use-program-applications-count";
4748
import { WorkspaceDropdown } from "./workspace-dropdown";
4849

@@ -439,7 +440,7 @@ export function AppSidebarNav({
439440
showConversionGuides: canTrackConversions && customersCount === 0,
440441
}}
441442
toolContent={toolContent}
442-
newsContent={newsContent}
443+
newsContent={plan && (plan === "free" ? <SidebarUsage /> : newsContent)}
443444
switcher={<WorkspaceDropdown />}
444445
/>
445446
);

apps/web/ui/layout/sidebar/news.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function News({ articles }: { articles: NewsArticle[] }) {
3838

3939
return cards.length || showCompleted ? (
4040
<div
41-
className="group overflow-hidden border-t border-neutral-200 px-3 pt-6 transition-all duration-200 hover:pt-10"
41+
className="group overflow-hidden border-t border-neutral-200 p-3 pt-6 transition-all duration-200 hover:pt-10"
4242
data-active={cardCount !== 0}
4343
>
4444
<div className="relative size-full">

apps/web/ui/layout/sidebar/sidebar-nav-old.tsx

Lines changed: 0 additions & 258 deletions
This file was deleted.

apps/web/ui/layout/sidebar/sidebar-nav.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,17 @@ export function SidebarNav<T extends Record<any, any>>({
203203
</div>
204204

205205
{/* Fixed bottom sections */}
206-
<div className="flex flex-col gap-2 p-3 pt-0">
206+
<div className="flex flex-col gap-2">
207207
{data.showConversionGuides && (
208-
<Link
209-
href={`/${data.slug}/guides`}
210-
className="flex items-center gap-2 rounded-lg bg-neutral-200/75 px-2.5 py-2 text-xs text-neutral-700 transition-colors hover:bg-neutral-200"
211-
>
212-
<BookOpen className="size-4" />
213-
Set up conversion tracking
214-
</Link>
208+
<div className="px-3 pb-2">
209+
<Link
210+
href={`/${data.slug}/guides`}
211+
className="flex items-center gap-2 rounded-lg bg-neutral-200/75 px-2.5 py-2 text-xs text-neutral-700 transition-colors hover:bg-neutral-200"
212+
>
213+
<BookOpen className="size-4" />
214+
Set up conversion tracking
215+
</Link>
216+
</div>
215217
)}
216218

217219
<AnimatePresence>

apps/web/ui/layout/sidebar/usage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Link from "next/link";
1818
import { useParams } from "next/navigation";
1919
import { CSSProperties, forwardRef, useMemo, useState } from "react";
2020

21-
export function Usage() {
21+
export function SidebarUsage() {
2222
const { slug } = useParams() as { slug?: string };
2323

2424
return slug ? <UsageInner /> : null;

0 commit comments

Comments
 (0)