diff --git a/src/components/proposals/SubmitAction.tsx b/src/components/proposals/SubmitAction.tsx index 36c28e8ae..2ca527f46 100644 --- a/src/components/proposals/SubmitAction.tsx +++ b/src/components/proposals/SubmitAction.tsx @@ -35,6 +35,7 @@ type SubmitActionProps = { }; type ActionDisabledReasons = { + daoUpgradeMessage: string; invalidApplicantMessage: string; }; @@ -105,6 +106,7 @@ export default function SubmitAction(props: SubmitActionProps) { */ const actionDisabledReasonsRef = useRef({ + daoUpgradeMessage: '', invalidApplicantMessage: '', }); @@ -168,6 +170,18 @@ export default function SubmitAction(props: SubmitActionProps) { if (checkApplicant && checkApplicantStatus === FULFILLED) { // 1. Determine and set reasons why action would be disabled + // @todo Remove this disabled reason after the OffchainVoting contract is + // upgraded. + /** + * Reason: Pending proposals are temporarily blocked from being sponsored + * until the OffchainVoting contract is upgraded. + */ + actionDisabledReasonsRef.current = { + ...actionDisabledReasonsRef.current, + daoUpgradeMessage: + 'Sponsoring is temporarily disabled while the DAO voting contract is being upgraded.', + }; + /** * Reason: If the applicant address is invalid (see `useCheckApplicant` * hook for reasons) the `submitProposal` smart contract transaction will diff --git a/src/components/proposals/SubmitAction.unit.test.tsx b/src/components/proposals/SubmitAction.unit.test.tsx index ad390e4df..de20edc24 100644 --- a/src/components/proposals/SubmitAction.unit.test.tsx +++ b/src/components/proposals/SubmitAction.unit.test.tsx @@ -29,7 +29,8 @@ import {TX_CYCLE_MESSAGES} from '../web3/config'; import SubmitAction from './SubmitAction'; import Wrapper from '../../test/Wrapper'; -describe('SubmitAction unit tests', () => { +// @todo Enable tests after the OffchainVoting contract is upgraded. +describe.skip('SubmitAction unit tests', () => { const sponsorButtonRegex: RegExp = /^sponsor$/i; const awaitingConfirmationRegex: RegExp = /^awaiting your confirmation/i; const viewProgressRegex: RegExp = /^view progress$/i; diff --git a/src/pages/transfers/CreateTransferProposal.tsx b/src/pages/transfers/CreateTransferProposal.tsx index fdc71806a..7cdf58d7e 100644 --- a/src/pages/transfers/CreateTransferProposal.tsx +++ b/src/pages/transfers/CreateTransferProposal.tsx @@ -1,3 +1,6 @@ +// @todo Remove this eslint disable after the OffchainVoting contract is +// upgraded. +/* eslint-disable no-unreachable */ import { SnapshotType, SnapshotProposalData, @@ -583,6 +586,19 @@ export default function CreateTransferProposal() { ); } + // @todo Remove this disabled message after the OffchainVoting contract is + // upgraded. + return ( + +
+

+ New transfer proposals are temporarily disabled while the DAO voting + contract is being upgraded. +

+
+
+ ); + return (
e.preventDefault()}>