mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-29 16:30:54 +05:30
Добавлено автоматическое установление E-mail адреса пользователя в форму обратной связи
This commit is contained in:
parent
56d88100da
commit
e543fae4ec
@ -20,17 +20,20 @@ const CONTACT_CATEGORIES = [
|
|||||||
<Message {...messages.other} />
|
<Message {...messages.other} />
|
||||||
];
|
];
|
||||||
|
|
||||||
export default class ContactForm extends Component {
|
class ContactForm extends Component {
|
||||||
static displayName = 'ContactForm';
|
static displayName = 'ContactForm';
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onClose: PropTypes.func.isRequired
|
onClose: PropTypes.func.isRequired,
|
||||||
|
user: PropTypes.shape({
|
||||||
|
email: PropTypes.string
|
||||||
|
}).isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
form = new FormModel();
|
form = new FormModel();
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {onClose} = this.props;
|
const {onClose, user} = this.props;
|
||||||
const {form} = this;
|
const {form} = this;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -69,6 +72,7 @@ export default class ContactForm extends Component {
|
|||||||
label={messages.email}
|
label={messages.email}
|
||||||
type="email"
|
type="email"
|
||||||
skin="light"
|
skin="light"
|
||||||
|
defaultValue={user.email}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -106,3 +110,9 @@ export default class ContactForm extends Component {
|
|||||||
;
|
;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
export default connect((state) => ({
|
||||||
|
user: state.user
|
||||||
|
}))(ContactForm);
|
||||||
|
Loading…
Reference in New Issue
Block a user