Skip to content

Commit

Permalink
fix: Show competing grants only on active ones (#1326)
Browse files Browse the repository at this point in the history
* fix: show competing grants only on active ones

* fix
  • Loading branch information
ncomerci authored Oct 6, 2023
1 parent 08de0f6 commit 11705a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Proposal/View/Budget/CompetingGrants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/components/Proposal/View/Budget/ProposalBudget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 (
<ContentSection>
Expand All @@ -28,7 +29,7 @@ export default function ProposalBudget({ proposal, budget }: Props) {
<CategoryTotalCard proposal={proposal} budget={budget} />
</div>
<Desktop>
{contestantsAmount > 0 && (
{contestantsAmount > 0 && isActive && (
<div className="ProposalBudget__Row">
<CompetingGrants proposal={proposal} budget={budget} />
</div>
Expand Down

0 comments on commit 11705a1

Please sign in to comment.