Skip to content

Commit

Permalink
fix: tender threshold display (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncomerci authored Oct 9, 2023
1 parent 11705a1 commit 482038d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/intl/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
"deliverables_too_short": "Deliverables is too short",
"deliverables_too_large": "Deliverables is too large",
"target_release_quarter_empty": "Target release quarter is empty",
"submission_vp_not_met": "This action requires at least 100 VP."
"submission_vp_not_met": "This action requires at least {threshold} VP."
},
"bid": {
"funding": {
Expand Down Expand Up @@ -1878,7 +1878,7 @@
},
"submit_tender": {
"title": "Tender proposal",
"description": "Tender proposals are the second step in the Bidding & Tendering process. The aim of this stage is to refine the problems outlined in the Pitch proposal, providing a clearer vision of what the execution teams should propose in their Bid proposals.\n\nThis action requires at least 100 VP. [Buy MANA](https://account.decentraland.org/) to get VP, or [run for delegate](https://forum.decentraland.org/t/open-call-for-delegates-apply-now/5840/5).",
"description": "Tender proposals are the second step in the Bidding & Tendering process. The aim of this stage is to refine the problems outlined in the Pitch proposal, providing a clearer vision of what the execution teams should propose in their Bid proposals.\n\nThis action requires at least {threshold} VP. [Buy MANA](https://account.decentraland.org/) to get VP, or [run for delegate](https://forum.decentraland.org/t/open-call-for-delegates-apply-now/5840/5).",
"linked_proposal_label": "Linked Pitch Proposal",
"project_name_label": "Project name",
"summary_label": "Summary",
Expand Down
23 changes: 11 additions & 12 deletions src/pages/submit/tender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ContentLayout, { ContentSection } from '../../components/Layout/ContentLa
import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import { SUBMISSION_THRESHOLD_PITCH } from '../../entities/Proposal/constants'
import { SUBMISSION_THRESHOLD_TENDER } from '../../entities/Proposal/constants'
import { NewProposalTender, newProposalTenderScheme } from '../../entities/Proposal/types'
import useFormatMessage from '../../hooks/useFormatMessage'
import usePreselectedProposal from '../../hooks/usePreselectedProposal'
Expand Down Expand Up @@ -65,7 +65,7 @@ export default function SubmitTenderProposal() {
const [account, accountState] = useAuthContext()
const { vpDistribution, isLoadingVpDistribution } = useVotingPowerDistribution(account)
const submissionVpNotMet = useMemo(
() => !!vpDistribution && vpDistribution.total < Number(SUBMISSION_THRESHOLD_PITCH),
() => !!vpDistribution && vpDistribution.total < Number(SUBMISSION_THRESHOLD_TENDER),
[vpDistribution]
)
const [formDisabled, setFormDisabled] = useState(false)
Expand Down Expand Up @@ -112,29 +112,28 @@ export default function SubmitTenderProposal() {
}
}

const title = t('page.submit_tender.title')
const description = t('page.submit_tender.description', { threshold: SUBMISSION_THRESHOLD_TENDER })

if (accountState.loading) {
return <LoadingView />
}

if (!account) {
return <LogIn title={t('page.submit_tender.title') || ''} description={t('page.submit_tender.description') || ''} />
return <LogIn title={title} description={description} />
}

return (
<ContentLayout small preventNavigation={preventNavigation.current}>
<Head
title={t('page.submit_tender.title') || ''}
description={t('page.submit_tender.description') || ''}
image="https://decentraland.org/images/decentraland.png"
/>
<Helmet title={t('page.submit_tender.title') || ''} />
<Head title={title} description={description} image="https://decentraland.org/images/decentraland.png" />
<Helmet title={title} />

<form onSubmit={handleSubmit(onSubmit)}>
<ContentSection>
<Header size="huge">{t('page.submit_tender.title')}</Header>
<Header size="huge">{title}</Header>
</ContentSection>
<ContentSection>
<Markdown>{t('page.submit_tender.description')}</Markdown>
<Markdown>{description}</Markdown>
</ContentSection>

<ContentSection>
Expand Down Expand Up @@ -368,7 +367,7 @@ export default function SubmitTenderProposal() {
{submissionVpNotMet && (
<ContentSection>
<Text size="lg" color="primary">
{t('error.tender.submission_vp_not_met')}
{t('error.tender.submission_vp_not_met', { threshold: SUBMISSION_THRESHOLD_TENDER })}
</Text>
</ContentSection>
)}
Expand Down

0 comments on commit 482038d

Please sign in to comment.