feat(supporters): Dec-2025 cutoff + collapse list to top 10 (show all)
This commit is contained in:
parent
24e1369f6c
commit
66d83123cd
3 changed files with 27 additions and 3 deletions
|
|
@ -6502,6 +6502,8 @@ walletUi: {
|
|||
quietNote: 'Plus everyone who gave quietly — thank you. ❤️',
|
||||
tiersNote: 'Tiers: Supporter under 100k sats · Patron 100k–1M · Legend 1M+',
|
||||
joinSupporters: 'Join {{count}} supporters',
|
||||
showAll: 'Show all {{count}}',
|
||||
showLess: 'Show less',
|
||||
impactSeeStats: 'See the full picture →',
|
||||
impactAsOf: 'live from the community relays',
|
||||
anonymousBacker: 'Anonymous supporter',
|
||||
|
|
|
|||
|
|
@ -6502,6 +6502,8 @@ walletUi: {
|
|||
quietNote: 'Y a todos los que aportaron en silencio — gracias. ❤️',
|
||||
tiersNote: 'Niveles: Colaborador menos de 100k sats · Patrón 100k–1M · Leyenda 1M+',
|
||||
joinSupporters: 'Únete a {{count}} patrocinadores',
|
||||
showAll: 'Ver los {{count}}',
|
||||
showLess: 'Ver menos',
|
||||
impactSeeStats: 'Ver el panorama completo →',
|
||||
impactAsOf: 'en vivo desde los relés de la comunidad',
|
||||
anonymousBacker: 'Patrocinador anónimo',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useMemo } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useSeoMeta } from '@unhead/react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
|
|
@ -15,6 +15,13 @@ import { useTranslation } from '@/contexts/language';
|
|||
|
||||
const ANGOR_PROJECT_URL = 'https://angor.io/project/angor1qtunna00uqyx52rr0nvqa059z2gknhrmn7urd6z';
|
||||
|
||||
// Only count support received from this point (the project's public launch era).
|
||||
// Zaps to the platform before this are ignored. NOTE: as of 2026-10-05 every
|
||||
// platform zap is already ≥ 2026-01, so this doesn't currently trim the list —
|
||||
// the visible cap below is what keeps it short.
|
||||
const SUPPORTERS_SINCE = Math.floor(Date.UTC(2025, 11, 1) / 1000); // 2025-12-01
|
||||
const VISIBLE_LIMIT = 10;
|
||||
|
||||
// ─── Static data — edit these arrays to add/remove entries ──────────────────
|
||||
|
||||
interface Collaborator {
|
||||
|
|
@ -343,12 +350,13 @@ function PlaceholderCard({ label }: { label: string }) {
|
|||
|
||||
export default function SupportersPage() {
|
||||
const { t } = useTranslation();
|
||||
const { data: zaps } = useZapLeaderboard(undefined, PLATFORM_OWNER_PUBKEYS);
|
||||
const { data: zaps } = useZapLeaderboard(SUPPORTERS_SINCE, PLATFORM_OWNER_PUBKEYS);
|
||||
const zappers = useMemo(() => zaps?.senders ?? [], [zaps]);
|
||||
const zapTotal = zappers.reduce((sum, z) => sum + z.sats, 0);
|
||||
const allSats = BACKERS_TOTAL_SATS + zapTotal;
|
||||
const totalUsd = useSatsToUsd(allSats);
|
||||
const { data: stats } = useGrowthStats();
|
||||
const [showAll, setShowAll] = useState(false);
|
||||
|
||||
// One ranked wall: Angor backers + Lightning zaps to the project, merged by npub.
|
||||
const supporters = useMemo<SupporterEntry[]>(() => {
|
||||
|
|
@ -551,10 +559,22 @@ export default function SupportersPage() {
|
|||
{supporters.length > 0 ? (
|
||||
<>
|
||||
<div className="flex flex-col gap-2">
|
||||
{supporters.map((entry, i) => (
|
||||
{(showAll ? supporters : supporters.slice(0, VISIBLE_LIMIT)).map((entry, i) => (
|
||||
<SupporterRow key={entry.key} rank={i + 1} entry={entry} />
|
||||
))}
|
||||
</div>
|
||||
{supporters.length > VISIBLE_LIMIT && (
|
||||
<div className="mt-3 text-center">
|
||||
<button
|
||||
onClick={() => setShowAll((v) => !v)}
|
||||
className="min-h-0 min-w-0 text-xs font-bold uppercase tracking-wide text-[#22d3ee]/80 transition-colors hover:text-[#22d3ee]"
|
||||
>
|
||||
{showAll
|
||||
? t('walletUi.supporters.showLess')
|
||||
: t('walletUi.supporters.showAll', { count: supporters.length })}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<p className="mt-4 text-center text-sm text-gray-400">
|
||||
{t('walletUi.supporters.supportersTotals', {
|
||||
|
|
|
|||
Loading…
Reference in a new issue