From a590001b51fb98f76e017274ad6287377672c1db Mon Sep 17 00:00:00 2001 From: nicktytarenko Date: Thu, 19 Nov 2026 15:38:28 +0200 Subject: [PATCH 1/3] Add the linked RFP card to the proposal sidebar A white sidebar card under the money card shows the RFP a proposal answers: its image, name, funder and amount, whether it is open and how many proposals it has, linking to the RFP. It reads "Submitted to" on regular proposals and "Competing for" on prize ones. The prize timeline's first step becomes a plain "Applied" with its date. --- components/work/AwardProposalCard.tsx | 24 +------- components/work/LinkedRfpCard.tsx | 87 +++++++++++++++++++++++++++ components/work/ProposalSidebar.tsx | 4 +- 3 files changed, 93 insertions(+), 22 deletions(-) create mode 100644 components/work/LinkedRfpCard.tsx diff --git a/components/work/AwardProposalCard.tsx b/components/work/AwardProposalCard.tsx index d467f43d5..223c8d971 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; @@ -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, }, @@ -233,7 +216,6 @@ export function AwardProposalCard({

diff --git a/components/work/LinkedRfpCard.tsx b/components/work/LinkedRfpCard.tsx new file mode 100644 index 000000000..f5116b4f3 --- /dev/null +++ b/components/work/LinkedRfpCard.tsx @@ -0,0 +1,87 @@ +'use client'; + +import Link from 'next/link'; +import { ChevronRight } from 'lucide-react'; +import { DocumentThumbnail } from '@/components/Funding/dashboard/DocumentThumbnail'; +import { isAwardMechanism } from '@/components/Funding/lib/fundingMechanism'; +import { SidebarCard } from '@/components/ui/SidebarCard'; +import { getLinkedGrantLink } from '@/components/work/lib/linkedGrant'; +import { useCurrencyPreference } from '@/contexts/CurrencyPreferenceContext'; +import { useExchangeRate } from '@/contexts/ExchangeRateContext'; +import type { Work } from '@/types/work'; +import { formatCurrencyAmount } from '@/utils/currency'; +import { pluralizeSuffix } from '@/utils/stringUtils'; +import { cn } from '@/utils/styles'; + +/** + * The RFP a proposal answers, in its sidebar under the funding card: the RFP's + * image, name, funder and amount, whether it is still open and how many + * proposals it has. The whole row opens the RFP. + */ +export function LinkedRfpCard({ work }: { work: Work }) { + const { showUSD } = useCurrencyPreference(); + const { exchangeRate } = useExchangeRate(); + const grant = work.linkedGrant; + const { title, href } = getLinkedGrantLink(work); + if (!grant || !title) return null; + + const isPrize = isAwardMechanism(grant.fundingMechanism); + const isOpen = grant.status === 'OPEN'; + const count = grant.applicantCount; + const amount = + grant.fundingAmount > 0 + ? formatCurrencyAmount({ + amount: grant.fundingAmount, + currency: grant.currency === 'USD' ? 'USD' : 'RSC', + showUSD, + exchangeRate, + shorten: true, + }) + : undefined; + // The title falls back to the organization, so don't name it twice. + const funder = grant.organization.trim() !== title ? grant.organization.trim() : ''; + const byline = [funder, amount].filter(Boolean).join(' · '); + + const row = ( + <> + + + {title} + {byline && {byline}} + + + + + ); + + return ( + + {href ? ( + + {row} +

{row}
+ )} + + ); +} diff --git a/components/work/ProposalSidebar.tsx b/components/work/ProposalSidebar.tsx index 44a136fc5..2f04499d0 100644 --- a/components/work/ProposalSidebar.tsx +++ b/components/work/ProposalSidebar.tsx @@ -4,6 +4,7 @@ import type { WorkMetadata } from '@/services/metadata.service'; import type { Work } from '@/types/work'; import { isAwardMechanism } from '@/components/Funding/lib/fundingMechanism'; import { AwardProposalCard } from './AwardProposalCard'; +import { LinkedRfpCard } from './LinkedRfpCard'; import { ProposalFundingCard } from './ProposalFundingCard'; import { ProposalReviewsCard } from './ProposalReviewsCard'; import { AiPeerReviewSection } from './components/AiPeerReviewSection'; @@ -20,7 +21,7 @@ interface ProposalSidebarProps { /** * The proposal page's right sidebar, in the RFP sidebar's style: the funding - * card over who reviewed it, then the AI's key insights and the nonprofit the + * card, the RFP it answers, who reviewed it, then the AI's key insights and the nonprofit the * money goes to, where it has them. */ export function ProposalSidebar({ @@ -45,6 +46,7 @@ export function ProposalSidebar({ /> )} {fundraise && !isAward && } + {fundraise && } From 484484d0ccae4049cfce6a9456352f8ead067e9f Mon Sep 17 00:00:00 2001 From: nicktytarenko Date: Thu, 19 Nov 2026 15:40:30 +0200 Subject: [PATCH 2/3] Drop filler lines from the prize timeline The Awarded step names the funder only when the RFP has one, instead of falling back to "The funder". Update posted shows no "No updates yet" line for visitors; its empty circle already says so. --- components/work/AwardProposalCard.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/work/AwardProposalCard.tsx b/components/work/AwardProposalCard.tsx index 223c8d971..01e3c9471 100644 --- a/components/work/AwardProposalCard.tsx +++ b/components/work/AwardProposalCard.tsx @@ -75,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({ @@ -108,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, @@ -120,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 ? (