2018-05-21 20:03:46 +00:00
|
|
|
// License: LGPL-3.0-or-later
|
|
|
|
import * as React from 'react';
|
|
|
|
import {observer} from 'mobx-react';
|
|
|
|
import {InjectedIntlProps, injectIntl} from 'react-intl';
|
|
|
|
import {Field} from "mobx-react-form";
|
|
|
|
import {computed} from 'mobx';
|
|
|
|
import {WizardPanel, WizardTabPanelProps} from "../common/wizard/WizardPanel";
|
|
|
|
import {WizardTabPanelState} from "../common/wizard/wizard_state";
|
2018-05-22 20:02:27 +00:00
|
|
|
import UserInfoForm from "./UserInfoForm";
|
2018-05-21 20:03:46 +00:00
|
|
|
|
|
|
|
export interface UserInfoPanelProps extends WizardTabPanelProps {
|
|
|
|
buttonText: string
|
2018-06-28 18:32:49 +00:00
|
|
|
inProgressTitle?:string
|
2018-05-21 20:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class UserInfoPanel extends React.Component<UserInfoPanelProps & InjectedIntlProps, {}> {
|
|
|
|
|
|
|
|
@computed
|
|
|
|
get wizardTab(): WizardTabPanelState {
|
|
|
|
return this.props.tab
|
|
|
|
}
|
|
|
|
|
|
|
|
@computed
|
|
|
|
get form():Field{
|
|
|
|
return this.wizardTab.form
|
|
|
|
}
|
|
|
|
|
|
|
|
@computed
|
|
|
|
get submit() {
|
|
|
|
return this.form.onSubmit
|
|
|
|
}
|
|
|
|
|
|
|
|
@computed
|
|
|
|
get tabName() {
|
|
|
|
return this.wizardTab.tabName;
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return <WizardPanel
|
2018-05-22 20:15:30 +00:00
|
|
|
tab={this.wizardTab} key={this.tabName}
|
2018-05-21 20:03:46 +00:00
|
|
|
>
|
2018-06-28 18:32:49 +00:00
|
|
|
<UserInfoForm form={this.form} buttonText={this.props.buttonText} inProgressTitle={this.props.inProgressTitle}/>
|
2018-05-21 20:03:46 +00:00
|
|
|
|
|
|
|
</WizardPanel>;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(observer(UserInfoPanel))
|
|
|
|
|
|
|
|
|
|
|
|
|