diff --git a/components/work/AwardProposalCard.tsx b/components/work/AwardProposalCard.tsx index d467f43d5..01e3c9471 100644 --- a/components/work/AwardProposalCard.tsx +++ b/components/work/AwardProposalCard.tsx @@ -1,7 +1,6 @@ 'use client'; import type { ReactNode } from 'react'; -import Link from 'next/link'; import { Check, PenLine, Trophy } from 'lucide-react'; import { FundButton } from '@/components/Funding/FundButton'; import { Button } from '@/components/ui/Button'; @@ -13,7 +12,6 @@ import { getAwardPhase, } from '@/components/Funding/lib/fundingMechanism'; import { isFundraiseActive } from '@/components/Fund/lib/fundraiseUtils'; -import { getLinkedGrantLink } from '@/components/work/lib/linkedGrant'; import { isWorkAuthor } from '@/components/work/lib/workAuthors'; import { useShowProposalTab } from '@/components/work/lib/workTabs'; import { useCurrencyPreference } from '@/contexts/CurrencyPreferenceContext'; @@ -30,10 +28,8 @@ interface TimelineStep { readonly label: string; /** When it happened, beside the label. */ readonly date?: string; - /** The line under the label: the RFP's name, a date, what is waited on. */ + /** The line under the label: what was awarded, what is waited on. */ readonly detail?: ReactNode; - /** The detail stays on one line, cut short: the RFP's name can run long. */ - readonly truncate?: boolean; readonly done: boolean; /** It can no longer happen: the RFP closed or the proposal expired. */ readonly disabled: boolean; @@ -79,7 +75,7 @@ export function AwardProposalCard({ grantOpen, fundraise, }); - const who = linkedGrant.organization.trim() || 'The funder'; + const funder = linkedGrant.organization.trim(); const headline = phase === 'none' ? formatCurrency({ @@ -94,30 +90,17 @@ export function AwardProposalCard({ const isAuthor = isWorkAuthor(work.authors, user?.authorProfile?.id); const hasUpdates = updatesCount > 0; - const rfp = getLinkedGrantLink({ linkedGrant } as Work); // The award is the funder's payment into the fundraise: its first // contribution dates it. const awardedDate = awarded ? firstContributionDate(fundraise) : undefined; const steps: TimelineStep[] = [ { + // The RFP itself is the card under this one. key: 'rfp', - label: 'Applied to RFP', + label: 'Applied', // Publishing the proposal is what submits it to the RFP. date: publishedDate, - detail: rfp.title ? ( - rfp.href ? ( - - {rfp.title} - - ) : ( - rfp.title - ) - ) : undefined, - truncate: true, done: true, disabled: false, }, @@ -125,10 +108,11 @@ export function AwardProposalCard({ key: 'awarded', label: 'Awarded', date: awardedDate, + // Only a named funder says anything the step doesn't already. detail: awarded - ? `${headline} from ${who}` + ? funder && `From ${funder}` : stillOpen - ? `${who} picks who wins the prize once results are posted.` + ? funder && `${funder} picks who wins the prize once results are posted.` : 'The prize has closed', done: awarded, disabled: !awarded && !stillOpen, @@ -137,6 +121,7 @@ export function AwardProposalCard({ key: 'update', label: 'Update posted', date: hasUpdates ? latestUpdateDate : undefined, + // With none, the empty circle says so; only an author gets a nudge. detail: hasUpdates ? (