From e543fae4ec3c602de6741312bf22147a21ba53b7 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Thu, 16 Jun 2016 10:42:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D1=83=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20E-mail=20?= =?UTF-8?q?=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D1=83=20=D0=BE=D0=B1=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/contact/ContactForm.jsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/contact/ContactForm.jsx b/src/components/contact/ContactForm.jsx index 46e911e..2ed93fe 100644 --- a/src/components/contact/ContactForm.jsx +++ b/src/components/contact/ContactForm.jsx @@ -20,17 +20,20 @@ const CONTACT_CATEGORIES = [ ]; -export default class ContactForm extends Component { +class ContactForm extends Component { static displayName = 'ContactForm'; static propTypes = { - onClose: PropTypes.func.isRequired + onClose: PropTypes.func.isRequired, + user: PropTypes.shape({ + email: PropTypes.string + }).isRequired }; form = new FormModel(); render() { - const {onClose} = this.props; + const {onClose, user} = this.props; const {form} = this; return ( @@ -69,6 +72,7 @@ export default class ContactForm extends Component { label={messages.email} type="email" skin="light" + defaultValue={user.email} /> @@ -106,3 +110,9 @@ export default class ContactForm extends Component { ; }; } + +import { connect } from 'react-redux'; + +export default connect((state) => ({ + user: state.user +}))(ContactForm);