From d39f2b2907aa49f5fa383d2246875220a77c818c Mon Sep 17 00:00:00 2001 From: Anike Arni Date: Tue, 28 Mar 2017 11:26:11 -0300 Subject: [#932] Adds logic to go to next step --- web-ui/src/account_recovery/page.js | 48 +++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'web-ui/src/account_recovery/page.js') diff --git a/web-ui/src/account_recovery/page.js b/web-ui/src/account_recovery/page.js index 2a2f6fe6..93781729 100644 --- a/web-ui/src/account_recovery/page.js +++ b/web-ui/src/account_recovery/page.js @@ -20,25 +20,49 @@ import { translate } from 'react-i18next'; import DocumentTitle from 'react-document-title'; import Header from 'src/common/header/header'; import AdminRecoveryCodeForm from 'src/account_recovery/forms/admin_recovery_code_form'; +import UserRecoveryCodeForm from 'src/account_recovery/forms/user_recovery_code_form'; import Footer from 'src/common/footer/footer'; import 'font-awesome/scss/font-awesome.scss'; import './page.scss'; -export const Page = ({ t }) => ( - -
-
-
-
- +export class Page extends React.Component { + + constructor(props) { + super(props); + this.state = { step: 0 }; + } + + nextStep = (event) => { + event.preventDefault(); + this.setState({ step: this.state.step + 1 }); + } + + steps = { + 0: , + 1: + } + + mainContent = () => this.steps[this.state.step]; + + render() { + const t = this.props.t; + return ( + +
+
+
+
+ {this.mainContent()} +
+
+
-
-
-
-); + + ); + } +} Page.propTypes = { t: React.PropTypes.func.isRequired -- cgit v1.2.3