UNPKG

2.73 kBtext/x-handlebars-templateView Raw
1/**
2 * React component for {{spinalcase name}} view.
3 * @class {{pascalcase name}}View
4 *
5 * Generated by {{generator}} on {{today}},
6 * from a template provided by {{pkg.name}}.
7 *
8 * @see https://facebook.github.io/react/
9 */
10
11"use strict";
12
13import React, {PropTypes as types} from 'react';
14import classnames from 'classnames';
15import {ApView, ApViewHeader, ApViewBody} from 'apeman-react-basic';
16import {ApLocaleMixin, ApViewMixin, ApSpinMixin, ApToastMixin} from 'apeman-react-mixins';
17import defineDebug from 'debug';
18
19import fragments from '{{base}}/fragments';
20import mixins from '{{base}}/../mixins';
21import services from '{{base}}/../services';
22
23const debug = defineDebug('project:react:{{spinalcase name}}');
24
25/** @lends {{pascalcase name}}View */
26let {{pascalcase name}}View = React.createClass({
27
28 //--------------------
29 // Specs
30 //--------------------
31
32 propTypes: {},
33
34 mixins: [
35 ApLocaleMixin,
36 ApViewMixin,
37 ApSpinMixin,
38 ApToastMixin
39 ],
40
41 statics: {
42 viewName: '{{spinalcase name}}'
43 },
44
45 getInitialState() {
46 return {};
47 },
48
49 getDefaultProps() {
50 return {};
51 },
52
53 render() {
54 let s = this;
55 let {state, props} = s;
56
57 let l = s.getLocale();
58
59 return (
60 <ApView className={classnames('{{spinalcase name}}-view', props.className)}>
61 <ApViewHeader leftText={null}
62 leftIcon={ApViewHeader.popIcon(props.viewWay)}
63 onLeftTap={s.popThisViewFromCurrentStack}
64 titleText={null}
65 titleIcon={null}
66 rightText={null}
67 rightIcon={null}
68 onRightTap={null}
69 />
70 <ApViewBody>
71 This is {{spinalcase name}} view.
72 </ApViewBody>
73 </ApView>
74 );
75 },
76
77 //--------------------
78 // Lifecycle
79 //--------------------
80
81 componentWillMount() {
82 let s = this;
83 },
84
85 componentDidMount() {
86 let s = this;
87 },
88
89 componentWillReceiveProps(nextProps) {
90 let s = this;
91 },
92
93 shouldComponentUpdate(nextProps, nextState) {
94 let s = this;
95 return true;
96 },
97
98 componentWillUpdate(nextProps, nextState) {
99 let s = this;
100 },
101
102 componentDidUpdate(prevProps, prevState) {
103 let s = this;
104 },
105
106 componentWillUnmount() {
107 let s = this;
108 }
109
110 //------------------
111 // Custom
112 //------------------
113
114 //------------------
115 // Private
116 //------------------
117});
118
119export default {{pascalcase name}}View;
120
\No newline at end of file