From 11705a1ab65f676d6b193032bf8679c87e66b9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Comerci?= <45410089+ncomerci@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:35:35 -0300 Subject: [PATCH] fix: Show competing grants only on active ones (#1326) * fix: show competing grants only on active ones * fix --- src/components/Proposal/View/Budget/CompetingGrants.tsx | 2 +- src/components/Proposal/View/Budget/ProposalBudget.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Proposal/View/Budget/CompetingGrants.tsx b/src/components/Proposal/View/Budget/CompetingGrants.tsx index d7b1b9bea..abb8b4267 100644 --- a/src/components/Proposal/View/Budget/CompetingGrants.tsx +++ b/src/components/Proposal/View/Budget/CompetingGrants.tsx @@ -14,7 +14,7 @@ interface Props { budget: BudgetWithContestants } -export default function CompetingProposals({ proposal, budget }: Props) { +export default function CompetingGrants({ proposal, budget }: Props) { const t = useFormatMessage() const [sidebarOpen, setSidebarOpen] = useState(false) const grantCategory = proposal.configuration.category diff --git a/src/components/Proposal/View/Budget/ProposalBudget.tsx b/src/components/Proposal/View/Budget/ProposalBudget.tsx index 7fe3d27b0..77a14f601 100644 --- a/src/components/Proposal/View/Budget/ProposalBudget.tsx +++ b/src/components/Proposal/View/Budget/ProposalBudget.tsx @@ -4,7 +4,7 @@ import { Desktop } from 'decentraland-ui/dist/components/Media/Media' import snakeCase from 'lodash/snakeCase' import { BudgetWithContestants } from '../../../../entities/Budget/types' -import { ProposalAttributes } from '../../../../entities/Proposal/types' +import { ProposalAttributes, ProposalStatus } from '../../../../entities/Proposal/types' import { ContentSection } from '../../../Layout/ContentLayout' import CategoryTotalCard from './CategoryTotalCard' @@ -20,6 +20,7 @@ interface Props { export default function ProposalBudget({ proposal, budget }: Props) { const grantCategory = proposal.configuration.category const contestantsAmount = (budget.categories[snakeCase(grantCategory)]?.contestants.length || 0) - 1 + const isActive = proposal.status === ProposalStatus.Active return ( @@ -28,7 +29,7 @@ export default function ProposalBudget({ proposal, budget }: Props) { - {contestantsAmount > 0 && ( + {contestantsAmount > 0 && isActive && (