From e3c1d5b9b408c4110af239b211d6398e76372aad Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Sun, 18 May 2025 19:11:29 +0530 Subject: [PATCH] update sponsor ui --- .../(home)/_components/sponsors-section.tsx | 123 ++++++++-------- .../app/(home)/_components/stack-builder.tsx | 139 ++++++++++++------ bun.lock | 2 +- 3 files changed, 157 insertions(+), 107 deletions(-) diff --git a/apps/web/src/app/(home)/_components/sponsors-section.tsx b/apps/web/src/app/(home)/_components/sponsors-section.tsx index a486a7b..171b20f 100644 --- a/apps/web/src/app/(home)/_components/sponsors-section.tsx +++ b/apps/web/src/app/(home)/_components/sponsors-section.tsx @@ -1,5 +1,3 @@ -"use client"; - import type { Sponsor } from "@/lib/types"; import Image from "next/image"; import { useEffect, useState } from "react"; @@ -27,111 +25,116 @@ export default function SponsorsSection() { return (
-
-

- Sponsors +
+

+ Our Sponsors

-

- Thank you to our sponsors for supporting this project! +

+ This project is proudly supported by these amazing organizations and + individuals.

{loadingSponsors ? ( -
+
Loading sponsors...
) : sponsorError ? ( -
+
{sponsorError}
) : sponsors.length === 0 ? ( -
- No sponsors yet.{" "} + ) : ( -
+
{sponsors.map((entry) => { - const since = new Date(entry.createdAt).toLocaleDateString(); - const title = `@${entry.sponsor.login}\n${entry.sponsor.type}${ + const since = new Date(entry.createdAt).toLocaleDateString( + undefined, + { year: "numeric", month: "short" }, + ); + const title = `@${entry.sponsor.login} - ${entry.sponsor.type}${ entry.isOneTime ? " (One-time)" : " (Monthly)" - }\n${entry.tierName ? `${entry.tierName}\n` : ""}Since: ${since}`; + }\nTier: ${entry.tierName || "N/A"}\nSince: ${since}`; return ( - )} -
- - 0 && ( + + + Heart Icon + + + Support Our Project! + +
+ )}

); } diff --git a/apps/web/src/app/(home)/_components/stack-builder.tsx b/apps/web/src/app/(home)/_components/stack-builder.tsx index 621035d..3dbcf09 100644 --- a/apps/web/src/app/(home)/_components/stack-builder.tsx +++ b/apps/web/src/app/(home)/_components/stack-builder.tsx @@ -1910,74 +1910,121 @@ const StackBuilder = () => { ); })}
- {/* Sponsors Section */}
-
-

- Sponsors +
+

+ Our Sponsors

+

+ This project is proudly supported by these amazing + organizations and individuals. +

{loadingSponsors ? ( -
+
Loading sponsors...
) : sponsorError ? ( -
+
{sponsorError}
) : sponsors.length === 0 ? ( -
- No sponsors yet.{" "} + ) : ( -

diff --git a/bun.lock b/bun.lock index 503f083..dd6cb85 100644 --- a/bun.lock +++ b/bun.lock @@ -14,7 +14,7 @@ }, "apps/cli": { "name": "create-better-t-stack", - "version": "2.10.2", + "version": "2.10.3", "bin": { "create-better-t-stack": "dist/index.js", },