diff --git a/packages/dapp/src/components/listing/RequestAppeal.tsx b/packages/dapp/src/components/listing/RequestAppeal.tsx index 9dc7409116..3111d297f1 100644 --- a/packages/dapp/src/components/listing/RequestAppeal.tsx +++ b/packages/dapp/src/components/listing/RequestAppeal.tsx @@ -18,12 +18,14 @@ import { State } from "../../reducers"; export interface RequestAppealPageProps { match: any; + history?: any; } interface RequestAppealProps { listingAddress: EthAddress; listingURI: string; governanceGuideURI: string; + history?: any; } interface RequestAppealReduxProps { @@ -75,16 +77,21 @@ class RequestAppealComponent extends React.Component; } private updateStatement = (key: string, value: any): void => { - const stateKey = `appealStatement{key.charAt(0).toUpperCase()}${key.substring(1)}`; + const stateKey = `appealStatement${key.charAt(0).toUpperCase()}${key.substring(1)}Value`; this.setState(() => ({ [stateKey]: value })); }; + private onSubmitChallengeSuccess = (): void => { + this.props.history.push("/listing/" + this.props.listingAddress); + }; + // Transactions private appeal = async (): Promise> => { const { @@ -173,7 +180,12 @@ const RequestAppealPage: React.SFC = props => { const listingURI = `/listing/${listingAddress}`; const governanceGuideURI = "https://civil.co"; return ( - + ); }; diff --git a/packages/dapp/src/components/listing/SubmitChallenge.tsx b/packages/dapp/src/components/listing/SubmitChallenge.tsx index 3292dcfa9d..c16a04dcb3 100644 --- a/packages/dapp/src/components/listing/SubmitChallenge.tsx +++ b/packages/dapp/src/components/listing/SubmitChallenge.tsx @@ -18,9 +18,11 @@ import { State } from "../../reducers"; export interface SubmitChallengePageProps { match: any; + history?: any; } interface SubmitChallengeProps { + history?: any; listingAddress: EthAddress; listingURI: string; governanceGuideURI: string; @@ -88,16 +90,21 @@ class SubmitChallengeComponent extends React.Component< updateStatementValue: this.updateStatement, transactions, modalContentComponents, + postExecuteTransactions: this.onSubmitChallengeSuccess, }; return ; } private updateStatement = (key: string, value: any): void => { - const stateKey = `challengeStatement{key.charAt(0).toUpperCase()}${key.substring(1)}`; + const stateKey = `challengeStatement${key.charAt(0).toUpperCase()}${key.substring(1)}Value`; this.setState(() => ({ [stateKey]: value })); }; + private onSubmitChallengeSuccess = (): void => { + this.props.history.push("/listing/" + this.props.listingAddress); + }; + // Transactions private challenge = async (): Promise> => { const { @@ -164,7 +171,6 @@ const mapStateToProps = ( let revealStageLen = ""; if (parameters && Object.keys(parameters).length) { const civil = getCivil(); - console.log(parameters); minDeposit = getFormattedParameterValue( Parameters.minDeposit, civil.toBigNumber(parameters[Parameters.minDeposit]), @@ -196,7 +202,12 @@ const SubmitChallengePage: React.SFC = props => { const listingURI = `/listing/${listingAddress}`; const governanceGuideURI = "https://civil.co"; return ( - + ); };