View on GitHub
File Changes
type Props = {
  onContinue: Function,
  onClose: Function,
-
  onToggleSafetyAgreement: Function,
+
};
+

                      
+
type State = {
  safetyAgreement: boolean,
};

                      
@observer
-
export default class WalletRecoveryPhraseStep1 extends Component<Props> {
+
export default class WalletRecoveryPhraseStep1 extends Component<Props, State> {
  static contextTypes = {
    intl: intlShape.isRequired,
  };
+

                      
+
  state = {
+
    safetyAgreement: false,
+
  };
+

                      
+
  onToggleSafetyAgreement = checked => {
+
    this.setState({
+
      safetyAgreement: checked,
+
    });
+
  };
+

                      
  render() {
    const { intl } = this.context;
-
    const {
-
      onContinue,
-
      onClose,
-
      onToggleSafetyAgreement,
-
      safetyAgreement,
-
    } = this.props;
+
    const { onContinue, onClose } = this.props;
+
    const { safetyAgreement } = this.state;
    const isSubmitting = false;

                      
    const actions = [
        <p>{intl.formatMessage(messages.recoveryPhraseStep1Paragraph1)}</p>
        <p className={styles.checkboxContainer}>
          <Checkbox
-
            onChange={onToggleSafetyAgreement}
+
            onChange={this.onToggleSafetyAgreement}
            checked={safetyAgreement}
            skin={CheckboxSkin}
            className={styles.checkbox}

                      
type Props = {
  onClose: Function,
-
  onToggleSafetyAgreement: Function,
+
};
+

                      
+
type State = {
  safetyAgreement: boolean,
};

                      
@observer
-
export default class WalletRecoveryPhraseStep1 extends Component<Props> {
+
export default class WalletRecoveryPhraseStep1 extends Component<Props, State> {
  static contextTypes = {
    intl: intlShape.isRequired,
  };
+

                      
+
  state = {
+
    safetyAgreement: false,
+
  };
+

                      
+
  onToggleSafetyAgreement = checked => {
+
    this.setState({
+
      safetyAgreement: checked,
+
    });
+
  };
+

                      
  render() {
    const { intl } = this.context;
-
    const { onClose, onToggleSafetyAgreement, safetyAgreement } = this.props;
+
    const { onClose } = this.props;
+
    const { safetyAgreement } = this.state;

                      
    const actions = [
      {
        <p>{intl.formatMessage(messages.recoveryPhraseStep3Paragraph1)}</p>
        <p className={styles.checkboxContainer}>
          <Checkbox
-
            onChange={onToggleSafetyAgreement}
+
            onChange={this.onToggleSafetyAgreement}
            checked={safetyAgreement}
            skin={CheckboxSkin}
            className={styles.checkbox}

                      
type Props = InjectedDialogContainerProps;

                      
-
type State = {
-
  safetyAgreement: boolean,
-
};
-

                      
@inject('stores', 'actions')
@observer
-
export default class WalletRecoveryPhraseStep1Container extends Component<
-
  Props,
-
  State
-
> {
+
export default class WalletRecoveryPhraseStep1Container extends Component<Props> {
  static defaultProps = {
    actions: null,
    stores: null,
    children: null,
    onClose: () => {},
  };

                      
-
  state = {
-
    safetyAgreement: false,
-
  };
-

                      
-
  handleToggleSafetyAgreement = checked => {
-
    this.setState({
-
      safetyAgreement: checked,
-
    });
-
  };
-

                      
  handleContinue = () => {
    this.props.actions.dialogs.open.trigger({
      dialog: WalletRecoveryPhraseStep2Dialog,

                      
  render() {
    const { closeActiveDialog } = this.props.actions.dialogs;
-
    const { safetyAgreement } = this.state;
    return (
      <WalletRecoveryPhraseStep1Dialog
        onContinue={this.handleContinue}
        onClose={closeActiveDialog.trigger}
-
        safetyAgreement={safetyAgreement}
-
        onToggleSafetyAgreement={this.handleToggleSafetyAgreement}
      />
    );
  }

                      
type Props = InjectedDialogContainerProps;

                      
-
type State = {
-
  safetyAgreement: boolean,
-
};
-

                      
@inject('stores', 'actions')
@observer
-
export default class WalletRecoveryPhraseStep2Container extends Component<
-
  Props,
-
  State
-
> {
+
export default class WalletRecoveryPhraseStep2Container extends Component<Props> {
  static defaultProps = {
    actions: null,
    stores: null,
    children: null,
    onClose: () => {},
  };

                      
-
  state = {
-
    safetyAgreement: false,
-
  };
-

                      
-
  handleToggleSafetyAgreement = checked => {
-
    this.setState({
-
      safetyAgreement: checked,
-
    });
-
  };
-

                      
  render() {
    const { closeActiveDialog } = this.props.actions.dialogs;
-
    const { safetyAgreement } = this.state;
    return (
-
      <WalletRecoveryPhraseStep3Dialog
-
        onClose={closeActiveDialog.trigger}
-
        safetyAgreement={safetyAgreement}
-
        onToggleSafetyAgreement={this.handleToggleSafetyAgreement}
-
      />
+
      <WalletRecoveryPhraseStep3Dialog onClose={closeActiveDialog.trigger} />
    );
  }
}