|
1 | 1 | # Generated with Atomizr - https://github.com/idleberg/atomizr.rb
|
2 |
| -'.source.js,source.jsx': |
3 |
| - 'componentWillMount()': |
4 |
| - 'prefix': 'cwm' |
5 |
| - 'body': """ |
6 |
| - componentWillMount() { |
7 |
| - ${1} |
8 |
| - }$0 |
9 |
| - """ |
| 2 | +'.source.jssource.jsx': |
10 | 3 | 'componentDidMount()':
|
11 | 4 | 'prefix': 'cdm'
|
12 | 5 | 'body': """
|
13 | 6 | componentDidMount() {
|
14 | 7 | ${1}
|
15 | 8 | }$0
|
16 | 9 | """
|
| 10 | + 'flex: 1': |
| 11 | + 'prefix': 'f1' |
| 12 | + 'body': 'flex: ${1:1},$0' |
| 13 | + 'React.PropTypes.': |
| 14 | + 'prefix': 'rpt' |
| 15 | + 'body': 'React.PropTypes.${1}$0' |
17 | 16 | 'componentWillUnmount()':
|
18 | 17 | 'prefix': 'cwum'
|
19 | 18 | 'body': """
|
20 | 19 | componentWillUnmount() {
|
21 | 20 | ${1}
|
22 | 21 | }$0
|
23 | 22 | """
|
24 |
| - 'alignItems: \'center\',': |
25 |
| - 'prefix': 'ai' |
26 |
| - 'body': 'alignItems: \'${1:center}\',$0' |
27 |
| - 'Create react-native Class': |
28 |
| - 'prefix': 'rncc' |
| 23 | + 'StyleSheet.create()': |
| 24 | + 'prefix': 'ssc' |
29 | 25 | 'body': """
|
30 |
| - \'use strict\'; |
31 |
| -
|
32 |
| - import React, { Component } from \'react\'; |
33 |
| -
|
34 |
| - import { |
35 |
| - StyleSheet, |
36 |
| - View, |
37 |
| - } from \'react-native\'; |
38 |
| -
|
39 |
| - class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}} extends Component { |
40 |
| - render() { |
41 |
| - return ( |
42 |
| - ${2:<View />} |
43 |
| - ); |
44 |
| - } |
45 |
| - } |
46 |
| -
|
47 | 26 | const styles = StyleSheet.create({
|
48 |
| -
|
49 |
| - }); |
50 |
| -
|
51 |
| -
|
52 |
| - export default ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};$0 |
| 27 | + ${1}: ${2}, |
| 28 | + });$0 |
53 | 29 | """
|
54 |
| - 'componentWillReceiveProps(object nextProps)': |
55 |
| - 'prefix': 'cwrp' |
| 30 | + 'Create StyleSheet': |
| 31 | + 'prefix': 'css' |
56 | 32 | 'body': """
|
57 |
| - componentWillReceiveProps(nextProps) { |
58 |
| - ${1} |
59 |
| - }$0 |
| 33 | + /* @flow */ |
| 34 | + \'use strict\'; |
| 35 | + |
| 36 | + import { StyleSheet } from \'react-native\'; |
| 37 | + |
| 38 | + module.exports = StyleSheet.create({ |
| 39 | + ${1}: ${2}, |
| 40 | + });$0 |
60 | 41 | """
|
61 |
| - 'componentWillUpdate(object nextProps, object nextState)': |
62 |
| - 'prefix': 'cwud' |
| 42 | + 'componentDidUpdate(object prevProps, object prevState)': |
| 43 | + 'prefix': 'cdud' |
63 | 44 | 'body': """
|
64 |
| - componentWillUpdate(nextProps, nextState) { |
| 45 | + componentDidUpdate(prevProps, prevState) { |
65 | 46 | ${1}
|
66 | 47 | }$0
|
67 | 48 | """
|
68 |
| - 'shouldComponentUpdate(object nextProps, object nextState)': |
69 |
| - 'prefix': 'scud' |
| 49 | + 'constructor()': |
| 50 | + 'prefix': 'constructor()' |
70 | 51 | 'body': """
|
71 |
| - shouldComponentUpdate(nextProps, nextState) { |
72 |
| - ${1} |
| 52 | + constructor(props) { |
| 53 | + super(props); |
| 54 | + |
| 55 | + this.state = {}; |
73 | 56 | }$0
|
74 | 57 | """
|
75 |
| - 'ActivityIndicatorIOS': |
76 |
| - 'prefix': 'rnActivityIndicatorIOS' |
| 58 | + 'export default': |
| 59 | + 'prefix': 'ed' |
| 60 | + 'body': 'export default ${1}$0' |
| 61 | + 'propTypes': |
| 62 | + 'prefix': 'propTypes' |
77 | 63 | 'body': """
|
78 |
| - <ActivityIndicatorIOS |
79 |
| - ${1:animating={true\}} |
80 |
| - ${2:color={\'#808080\'\}} |
81 |
| - ${3:size={\'small\'\}} |
82 |
| - /> |
83 |
| - ${4}$0 |
| 64 | + static propTypes = { |
| 65 | + ${2:prop}: React.PropTypes.${3:Type} |
| 66 | + }$0 |
84 | 67 | """
|
85 |
| - 'PickerIOS': |
86 |
| - 'prefix': 'rnPickerIOS' |
| 68 | + 'defaultProps': |
| 69 | + 'prefix': 'defaultProps' |
87 | 70 | 'body': """
|
88 |
| - <PickerIOS |
89 |
| - onValueChange={${1:this.onValueChange}} |
90 |
| - selectedValue={${2}} |
91 |
| - />$0 |
| 71 | + static defaultProps = { |
| 72 | + ${2:prop}: ${3:\'value\'} |
| 73 | + }$0 |
92 | 74 | """
|
93 |
| - 'DatePickerIOS': |
94 |
| - 'prefix': 'rnDatePickerIOS' |
| 75 | + 'shouldComponentUpdate(object nextProps, object nextState)': |
| 76 | + 'prefix': 'scud' |
95 | 77 | 'body': """
|
96 |
| - <DatePickerIOS |
97 |
| - ${1:date={Date.now()\}} |
98 |
| - ${2: minuteInterval={${3:10}\}} |
99 |
| - ${4: mode={${5:\'datetime\'}\}} |
100 |
| - ${6: onDateChange={${7}\}} |
101 |
| - ${8: maximumDate={${9}\}} |
102 |
| - ${10: minimumDate={${11}\}} |
103 |
| - /> |
104 |
| - ${12}$0 |
| 78 | + shouldComponentUpdate(nextProps, nextState) { |
| 79 | + ${1} |
| 80 | + }$0 |
105 | 81 | """
|
106 |
| - 'NavigatorIOS': |
107 |
| - 'prefix': 'rnNavigatorIOS' |
| 82 | + 'TouchableHighlight': |
| 83 | + 'prefix': 'rnTouchableHighlight' |
108 | 84 | 'body': """
|
109 |
| - <NavigatorIOS |
110 |
| - style={${1}} |
111 |
| - initialRoute={{ |
112 |
| - title: \'${1:Title}\', |
113 |
| - component: ${2:View} |
114 |
| - }} |
115 |
| - /> |
116 |
| - ${3}$0 |
| 85 | + <TouchableHighlight |
| 86 | + onPress={${1}} |
| 87 | + style={${2}} |
| 88 | + underlayColor=\'${3}\'> |
| 89 | + ${4} |
| 90 | + </TouchableHighlight>$0 |
117 | 91 | """
|
118 | 92 | 'MapView':
|
119 | 93 | 'prefix': 'rnMapView'
|
|
130 | 104 | />
|
131 | 105 | ${5}$0
|
132 | 106 | """
|
133 |
| - 'ListView': |
134 |
| - 'prefix': 'rnListView' |
| 107 | + 'Image': |
| 108 | + 'prefix': 'rnImage' |
135 | 109 | 'body': """
|
136 |
| - <ListView |
| 110 | + <Image |
137 | 111 | style={${1}}
|
138 |
| - dataSource={${2:this.state.dataSource}} |
139 |
| - renderRow={${3:(rowData) => ${4:<Text>{rowData\}</Text>}}} |
| 112 | + source={{uri: \'${2}\'}} |
140 | 113 | />
|
141 |
| - ${5}$0 |
| 114 | + ${3}$0 |
142 | 115 | """
|
143 | 116 | 'View':
|
144 | 117 | 'prefix': 'rnView'
|
|
150 | 123 | ${2}
|
151 | 124 | </Text>$0
|
152 | 125 | """
|
| 126 | + 'ListView': |
| 127 | + 'prefix': 'rnListView' |
| 128 | + 'body': """ |
| 129 | + <ListView |
| 130 | + style={${1}} |
| 131 | + dataSource={${2:this.state.dataSource}} |
| 132 | + renderRow={${3:(rowData) => ${4:<Text>{rowData\}</Text>}}} |
| 133 | + /> |
| 134 | + ${5}$0 |
| 135 | + """ |
| 136 | + 'Navigator': |
| 137 | + 'prefix': 'rnNavigator' |
| 138 | + 'body': """ |
| 139 | + <Navigator |
| 140 | + initialRoute={{name: \'${1:My First Scene}\', index: 0}} |
| 141 | + renderScene={(route, navigator) => { |
| 142 | + ${2} |
| 143 | + }} |
| 144 | + />$0 |
| 145 | + """ |
153 | 146 | 'ScrollView':
|
154 | 147 | 'prefix': 'rnScrollView'
|
155 | 148 | 'body': """
|
|
159 | 152 | ${3}
|
160 | 153 | </ScrollView>$0
|
161 | 154 | """
|
162 |
| - 'Image': |
163 |
| - 'prefix': 'rnImage' |
| 155 | + 'DatePickerIOS': |
| 156 | + 'prefix': 'rnDatePickerIOS' |
164 | 157 | 'body': """
|
165 |
| - <Image |
166 |
| - style={${1}} |
167 |
| - source={{uri: \'${2}\'}} |
| 158 | + <DatePickerIOS |
| 159 | + ${1:date={Date.now()\}} |
| 160 | + ${2: minuteInterval={${3:10}\}} |
| 161 | + ${4: mode={${5:\'datetime\'}\}} |
| 162 | + ${6: onDateChange={${7}\}} |
| 163 | + ${8: maximumDate={${9}\}} |
| 164 | + ${10: minimumDate={${11}\}} |
168 | 165 | />
|
169 |
| - ${3}$0 |
170 |
| - """ |
171 |
| - 'TouchableHighlight': |
172 |
| - 'prefix': 'rnTouchableHighlight' |
173 |
| - 'body': """ |
174 |
| - <TouchableHighlight |
175 |
| - onPress={${1}} |
176 |
| - style={${2}} |
177 |
| - underlayColor=\'${3}\'> |
178 |
| - ${4} |
179 |
| - </TouchableHighlight>$0 |
| 166 | + ${12}$0 |
180 | 167 | """
|
181 |
| - 'Navigator': |
182 |
| - 'prefix': 'rnNavigator' |
| 168 | + 'NavigatorIOS': |
| 169 | + 'prefix': 'rnNavigatorIOS' |
183 | 170 | 'body': """
|
184 |
| - <Navigator |
185 |
| - initialRoute={{name: \'${1:My First Scene}\', index: 0}} |
186 |
| - renderScene={(route, navigator) => { |
187 |
| - ${2} |
| 171 | + <NavigatorIOS |
| 172 | + style={${1}} |
| 173 | + initialRoute={{ |
| 174 | + title: \'${1:Title}\', |
| 175 | + component: ${2:View} |
188 | 176 | }}
|
189 |
| - />$0 |
| 177 | + /> |
| 178 | + ${3}$0 |
190 | 179 | """
|
191 |
| - 'propTypes': |
192 |
| - 'prefix': 'propTypes' |
| 180 | + 'PickerIOS': |
| 181 | + 'prefix': 'rnPickerIOS' |
193 | 182 | 'body': """
|
194 |
| - static propTypes = { |
195 |
| - ${2:prop}: React.PropTypes.${3:Type} |
196 |
| - }$0 |
| 183 | + <PickerIOS |
| 184 | + onValueChange={${1:this.onValueChange}} |
| 185 | + selectedValue={${2}} |
| 186 | + />$0 |
197 | 187 | """
|
198 |
| - 'defaultProps': |
199 |
| - 'prefix': 'defaultProps' |
| 188 | + 'ActivityIndicatorIOS': |
| 189 | + 'prefix': 'rnActivityIndicatorIOS' |
200 | 190 | 'body': """
|
201 |
| - static defaultProps = { |
202 |
| - ${2:prop}: ${3:\'value\'} |
203 |
| - }$0 |
| 191 | + <ActivityIndicatorIOS |
| 192 | + ${1:animating={true\}} |
| 193 | + ${2:color={\'#808080\'\}} |
| 194 | + ${3:size={\'small\'\}} |
| 195 | + /> |
| 196 | + ${4}$0 |
204 | 197 | """
|
205 |
| - 'componentDidUpdate(object prevProps, object prevState)': |
206 |
| - 'prefix': 'cdud' |
| 198 | + 'justifyContent: 'center',': |
| 199 | + 'prefix': 'jc' |
| 200 | + 'body': 'justifyContent: \'${1:center}\',$0' |
| 201 | + 'componentWillMount()': |
| 202 | + 'prefix': 'cwm' |
207 | 203 | 'body': """
|
208 |
| - componentDidUpdate(prevProps, prevState) { |
| 204 | + componentWillMount() { |
209 | 205 | ${1}
|
210 | 206 | }$0
|
211 | 207 | """
|
212 |
| - 'StyleSheet.create()': |
213 |
| - 'prefix': 'ssc' |
| 208 | + 'Create react-native Class': |
| 209 | + 'prefix': 'rncc' |
214 | 210 | 'body': """
|
| 211 | + \'use strict\'; |
| 212 | + |
| 213 | + import React, { Component } from \'react\'; |
| 214 | + |
| 215 | + import { |
| 216 | + StyleSheet, |
| 217 | + View, |
| 218 | + } from \'react-native\'; |
| 219 | + |
| 220 | + class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}} extends Component { |
| 221 | + render() { |
| 222 | + return ( |
| 223 | + ${2:<View />} |
| 224 | + ); |
| 225 | + } |
| 226 | + } |
| 227 | + |
215 | 228 | const styles = StyleSheet.create({
|
216 |
| - ${1}: ${2}, |
217 |
| - });$0 |
| 229 | + |
| 230 | + }); |
| 231 | + |
| 232 | + |
| 233 | + export default ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};$0 |
218 | 234 | """
|
219 |
| - 'flex: 1': |
220 |
| - 'prefix': 'f1' |
221 |
| - 'body': 'flex: ${1:1},$0' |
222 |
| - 'Create StyleSheet': |
223 |
| - 'prefix': 'css' |
| 235 | + 'alignItems: 'center',': |
| 236 | + 'prefix': 'ai' |
| 237 | + 'body': 'alignItems: \'${1:center}\',$0' |
| 238 | + 'componentWillReceiveProps(object nextProps)': |
| 239 | + 'prefix': 'cwrp' |
224 | 240 | 'body': """
|
225 |
| - /* @flow */ |
226 |
| - \'use strict\'; |
227 |
| -
|
228 |
| - import { StyleSheet } from \'react-native\'; |
229 |
| -
|
230 |
| - module.exports = StyleSheet.create({ |
231 |
| - ${1}: ${2}, |
232 |
| - });$0 |
| 241 | + componentWillReceiveProps(nextProps) { |
| 242 | + ${1} |
| 243 | + }$0 |
233 | 244 | """
|
234 |
| - 'justifyContent: \'center\',': |
235 |
| - 'prefix': 'jc' |
236 |
| - 'body': 'justifyContent: \'${1:center}\',$0' |
237 |
| - 'constructor()': |
238 |
| - 'prefix': 'constructor()' |
| 245 | + 'componentWillUpdate(object nextProps, object nextState)': |
| 246 | + 'prefix': 'cwud' |
239 | 247 | 'body': """
|
240 |
| - constructor(props) { |
241 |
| - super(props); |
242 |
| -
|
243 |
| - this.state = {}; |
| 248 | + componentWillUpdate(nextProps, nextState) { |
| 249 | + ${1} |
244 | 250 | }$0
|
245 | 251 | """
|
246 |
| - 'React.PropTypes.': |
247 |
| - 'prefix': 'rpt' |
248 |
| - 'body': 'React.PropTypes.${1}$0' |
|
0 commit comments