Reorganizing template

This commit is contained in:
Richard Ramos 2018-05-15 08:33:07 -04:00 committed by Pascal Precht
parent 6dfd31639a
commit 04ad83aee3
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 27 additions and 29 deletions

View File

@ -6,8 +6,34 @@ import ReactDOM from 'react-dom';
import { FormGroup, ControlLabel, FormControl, Checkbox, Button, Alert, InputGroup } from 'react-bootstrap'; import { FormGroup, ControlLabel, FormControl, Checkbox, Button, Alert, InputGroup } from 'react-bootstrap';
class {{contractName}}UI extends React.Component {
constructor (props) {
super(props);
this.state = {
};
}
render(){
return (<div>
{{#each functions}}
<{{capitalize name}}Form{{@index}} />
{{/each}}
</div>);
}
}
ReactDOM.render(<div>
<h1>{{title}}</h1>
<{{contractName}}UI />
</div>,
document.getElementById('app')
);
{{#each functions}} {{#each functions}}
class {{capitalize name}}_{{@index}}_Form extends React.Component { class {{capitalize name}}Form{{@index}} extends React.Component {
constructor(props){ constructor(props){
super(props); super(props);
this.state = { this.state = {
@ -77,13 +103,10 @@ class {{capitalize name}}_{{@index}}_Form extends React.Component {
console.log(err); console.log(err);
this.setState({error: err.message}); this.setState({error: err.message});
}); });
// TODO payable
{{/ifview}} {{/ifview}}
} catch(err) { } catch(err) {
this.setState({error: err.message}); this.setState({error: err.message});
} }
// TODO validate
} }
render(){ render(){
@ -163,28 +186,3 @@ class {{capitalize name}}_{{@index}}_Form extends React.Component {
} }
{{/each}} {{/each}}
class {{contractName}}UI extends React.Component {
constructor (props) {
super(props);
this.state = {
};
}
render(){
return (<div>
{{#each functions}}
<{{capitalize name}}_{{@index}}_Form />
{{/each}}
</div>);
}
}
ReactDOM.render(<div>
<h1>{{title}}</h1>
<{{contractName}}UI />
</div>,
document.getElementById('app')
);