import * as React from "react"; import { TransactionButton } from "@joincivil/components"; import { ViewModule, ViewModuleHeader } from "../utility/ViewModules"; import { StyledFormContainer, FormGroup, InputElement } from "../utility/FormElements"; import { CivilHelper, CivilHelperContext } from "../../apis/CivilHelper"; import { TwoStepEthTransaction } from "@joincivil/core"; export interface SetAppellateState { newValue: string; } export class SetAppellate extends React.Component<{}, SetAppellateState> { public static contextType = CivilHelperContext; public context: CivilHelper; constructor(props: any) { super(props); this.state = { newValue: "", }; } public render(): JSX.Element { return ( Set Appellate Update Government Parameter ); } private updateAppellateValue = (event: any): void => { const val = event.target.value; this.setState({ newValue: val }); }; // @TODO(jon): This would probably be a nice place for a confirm dialog private setAppellate = async (): Promise | void> => { if (this.state.newValue.length !== 42) { throw new Error("oops. the address was not set correctly."); } return this.context.setAppellate(this.state.newValue); }; }