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.

Fix bounties empty state create button

Tim Wilsona08665928dec
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
index 2445bb27b8..0ce927ec18 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/bounty-list.tsx
@@ -49,8 +49,8 @@ export function BountyList() {
? bounties?.find((b) => b?.id === bountySheetState.bountyId)
: undefined;
- return bounties?.length !== 0 || isLoading ? (
- <div className="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3">
+ return (
+ <>
{bountySheetState.open &&
(!bountySheetState.bountyId || currentBounty) && (
<BountySheet
@@ -61,49 +61,53 @@ export function BountyList() {
bounty={currentBounty}
/>
)}
- {isLoading
- ? Array.from({ length: 3 }, (_, index) => (
- <BountyCardSkeleton key={index} />
- ))
- : bounties?.map((bounty) => (
- <BountyCard key={bounty.id} bounty={bounty} />
- ))}
- </div>
- ) : (
- <>
- <AnimatedEmptyState
- title="No bounties active"
- description={
- <>
- This program doesn't have any active bounties.{" "}
- <a
- href="https://dub.co/help/article/bounties"
- target="_blank"
- className="hover:text-content-default underline sm:whitespace-nowrap"
- >
- Learn more about bounties
- </a>
- .
- </>
- }
- cardContent={() => (
- <>
- <Trophy className="size-4 text-neutral-700" />
- <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
- </>
- )}
- addButton={
- <Button
- text="Create bounty"
- variant="primary"
- onClick={() =>
- setBountySheetState(
- (s) => ({ bountyId: null, open: true }) as any,
- )
+ {bounties?.length !== 0 || isLoading ? (
+ <div className="grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-3">
+ {isLoading
+ ? Array.from({ length: 3 }, (_, index) => (
+ <BountyCardSkeleton key={index} />
+ ))
+ : bounties?.map((bounty) => (
+ <BountyCard key={bounty.id} bounty={bounty} />
+ ))}
+ </div>
+ ) : (
+ <>
+ <AnimatedEmptyState
+ title="No bounties active"
+ description={
+ <>
+ This program doesn't have any active bounties.{" "}
+ <a
+ href="https://dub.co/help/article/bounties"
+ target="_blank"
+ className="hover:text-content-default underline sm:whitespace-nowrap"
+ >
+ Learn more about bounties
+ </a>
+ .
+ </>
+ }
+ cardContent={() => (
+ <>
+ <Trophy className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ </>
+ )}
+ addButton={
+ <Button
+ text="Create bounty"
+ variant="primary"
+ onClick={() =>
+ setBountySheetState(
+ (s) => ({ bountyId: null, open: true }) as any,
+ )
+ }
+ />
}
/>
- }
- />
+ </>
+ )}
</>
);
}