Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Show competing grants only on active ones #1326

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading