Rename fundraising goals to goals

This commit is contained in:
lemon
2026-05-07 23:10:57 -07:00
parent 1d5320eb33
commit 5cf1157636
7 changed files with 22 additions and 28 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ const KIND_LABELS: Record<number, string> = {
34139: 'a playlist',
34236: 'a divine',
34550: 'a community',
9041: 'a fundraising goal',
9041: 'a goal',
35128: 'an nsite',
36639: 'an action',
36787: 'a track',
+13 -13
View File
@@ -338,7 +338,7 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
const { data: commentsData, isLoading: commentsLoading } = useComments(event, 500);
const { membersOnly } = useMembersOnlyFilter();
// ── Fundraising goals (NIP-75) ──────────────────────────────────────────────
// ── Goals (NIP-75) ──────────────────────────────────────────────────────────
const { data: goals, isLoading: goalsLoading } = useCommunityGoals(communityATag || undefined);
const { data: communityEvents, isLoading: eventsLoading } = useCommunityEvents(communityATag || undefined);
const now = useNow(60_000);
@@ -447,11 +447,11 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
}
}, [event, toast]);
// ── FAB — visible on comments, fundraising, and members tabs ──────────────
// ── FAB — visible on comments, goals, and members tabs ─────────────────────
const handleFabClick = useCallback(() => {
if (activeTab === 'comments') {
setComposeOpen(true);
} else if (activeTab === 'fundraising') {
} else if (activeTab === 'goals') {
setGoalDialogOpen(true);
} else if (activeTab === 'events') {
setEventDialogOpen(true);
@@ -460,7 +460,7 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
}
}, [activeTab]);
const fabIcon = activeTab === 'fundraising'
const fabIcon = activeTab === 'goals'
? <Target strokeWidth={3} size={18} />
: activeTab === 'members'
? <UserPlus className="size-5" />
@@ -471,7 +471,7 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
useLayoutOptions({
showFAB:
activeTab === 'comments'
|| activeTab === 'fundraising'
|| activeTab === 'goals'
|| activeTab === 'events'
|| (activeTab === 'members' && canAddMembers),
onFabClick: handleFabClick,
@@ -586,14 +586,14 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
className="flex-none min-w-fit rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-2"
>
<MessageCircle className="size-4 mr-1.5" />
Comments
Posts
</TabsTrigger>
<TabsTrigger
value="fundraising"
value="goals"
className="flex-none min-w-fit rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none px-4 pb-3 pt-2"
>
<Target className="size-4 mr-1.5" />
Fundraising
Goals
</TabsTrigger>
<TabsTrigger
value="events"
@@ -682,8 +682,8 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
)}
</TabsContent>
{/* ── Fundraising tab ── */}
<TabsContent value="fundraising" className="mt-0">
{/* ── Goals tab ── */}
<TabsContent value="goals" className="mt-0">
{goalsLoading ? (
<div className="divide-y divide-border">
{Array.from({ length: 2 }).map((_, i) => (
@@ -693,8 +693,8 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
) : activeGoals.length === 0 && pastGoals.length === 0 ? (
<div className="py-12 text-center text-muted-foreground text-sm px-5">
{membersOnly && (goals ?? []).length > 0
? 'No fundraising goals from community members yet. Toggle the shield icon to see all goals.'
: <>No fundraising goals yet.{user ? ' Create one to get started!' : ''}</>}
? 'No goals from community members yet. Toggle the shield icon to see all goals.'
: <>No goals yet.{user ? ' Create one to get started!' : ''}</>}
</div>
) : (
<div className="divide-y divide-border">
@@ -776,7 +776,7 @@ export function CommunityDetailPage({ event }: { event: NostrEvent }) {
onOpenChange={setComposeOpen}
/>
{/* FAB-triggered goal creation dialog for the fundraising tab */}
{/* FAB-triggered goal creation dialog for the goals tab */}
{communityATag && (
<CreateGoalDialog
communityATag={communityATag}
+5 -5
View File
@@ -119,7 +119,7 @@ export function CreateGoalDialog({ communityATag, children, open: controlledOpen
tags,
});
// Refresh the fundraising tab and the community activity feed
// Refresh the goals tab and the community activity feed
await Promise.all([
queryClient.invalidateQueries({ queryKey: ['community-goals', communityATag] }),
queryClient.invalidateQueries({
@@ -132,7 +132,7 @@ export function CreateGoalDialog({ communityATag, children, open: controlledOpen
}),
]);
toast({ title: 'Fundraising goal created!' });
toast({ title: 'Goal created!' });
resetForm();
setOpen(false);
} catch {
@@ -157,7 +157,7 @@ export function CreateGoalDialog({ communityATag, children, open: controlledOpen
<DialogContent className="sm:max-w-md">
<DialogTitle className="flex items-center gap-2">
<Target className="size-5" />
Create Fundraising Goal
Create Goal
</DialogTitle>
<form onSubmit={handleSubmit} className="space-y-4 mt-2">
@@ -201,7 +201,7 @@ export function CreateGoalDialog({ communityATag, children, open: controlledOpen
<Label htmlFor="goal-summary">Description (optional)</Label>
<Textarea
id="goal-summary"
placeholder="Tell people what this fundraiser is for..."
placeholder="Tell people what this goal is for..."
value={summary}
onChange={(e) => setSummary(e.target.value)}
rows={3}
@@ -214,7 +214,7 @@ export function CreateGoalDialog({ communityATag, children, open: controlledOpen
value={imageUrl}
onChange={setImageUrl}
onUploadingChange={setIsImageUploading}
previewAlt="Fundraising goal image preview"
previewAlt="Goal image preview"
/>
<Button type="submit" className="w-full" disabled={isPending || isImageUploading}>
+1 -1
View File
@@ -1080,7 +1080,7 @@ function hasVideo(tags: string[][]): boolean {
/** Fallback labels for well-known kinds not in EXTRA_KINDS. */
const WELL_KNOWN_KIND_LABELS: Record<number, string> = {
9041: 'Fundraising Goal',
9041: 'Goal',
31990: 'App',
32267: 'Zapstore App',
30063: 'Zapstore Release',
-6
View File
@@ -16,7 +16,6 @@ import {
Share2,
SmilePlus,
PartyPopper,
Target,
Users,
Zap,
} from "lucide-react";
@@ -1695,11 +1694,6 @@ const KIND_HEADER_MAP: Record<number, KindHeaderConfig> = {
noun: "community",
nounRoute: "/communities",
},
9041: {
icon: Target,
action: "created a",
noun: "fundraising goal",
},
30009: {
icon: Award,
action: (event) => publishedAtAction(event, { created: "created a", updated: "updated a", fallback: "created a" }),
+1 -1
View File
@@ -90,7 +90,7 @@ const NOTIFICATION_KIND_NOUNS: Record<number, string> = {
34139: 'playlist',
34236: 'divine',
34550: 'community',
9041: 'fundraising goal',
9041: 'goal',
35128: 'nsite',
36787: 'track',
37381: 'Magic deck',
+1 -1
View File
@@ -127,7 +127,7 @@ function shellTitleForKind(kind?: number): string {
if (PODCAST_KINDS.has(kind)) return "Episode Details";
if (CALENDAR_EVENT_KINDS.has(kind)) return "Event Details";
if (kind === 34550) return "Community";
if (kind === 9041) return "Fundraising Goal";
if (kind === 9041) return "Goal";
if (FOLLOW_PACK_KINDS.has(kind)) return "Follow Pack";
if (kind === LIVE_STREAM_KIND) return "Live Stream";
if (kind === 30617) return "Repository";