Initial commit
[waldo-signature-composer.git] / src / components / SignatureCreator / SignatureCreator.js
blobbd07f02e242dd5c2e2baff3ff30940eb822e8e16
1 import React, { Component } from 'react';
2 import SignaturePreview from './SignaturePreview/SignaturePreview';
3 import SignatureForm from './SignatureForm/SignatureForm';
4 import './SignatureCreator.css';
6 class SignatureCreator extends Component {
7   constructor(props) {
8     super(props);
10     // Hard-coded initial state, hopefully some day...
11     this.state = {
12       name: 'Roberto Dip',
13       position: 'Front End Developer'
14     };
15   }
17   handleFormChange = (e) => {
18     const { name, value } = e.target;
20     this.setState({...this.state, [name]: value });
21   }
23   handleFormSubmit = (e) => {
24     e.preventDefault();
25   }
27   render() {
28     return (
29       <div className='SignatureCreator'>
30         <SignaturePreview data={this.state} />
31         <SignatureForm
32           onChange={this.handleFormChange}
33           onSubmit={this.handleFormSubmit}
34           className='SignatureCreator-form' />
35       </div>
36     );
37   }
40 export default SignatureCreator;