Skip to content

Commit a444c9d

Browse files
authored
Merge pull request #16 from msmsmsmsms/stylesheet-typo
fixed typo in css scaffold (Stylesheet -> StyleSheet)
2 parents 0240a6a + 460efb9 commit a444c9d

File tree

3 files changed

+132
-132
lines changed

3 files changed

+132
-132
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
install:
2-
gem install atmomizr
2+
gem install atomizr
33

44
atom:
55
atomizr -i "snippets/**/*.sublime-snippet" -o snippets.cson --merge

snippets/StyleSheet_react_native.sublime-snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* @flow */
44
'use strict';
55
6-
import { Stylesheet } from 'react-native';
6+
import { StyleSheet } from 'react-native';
77
88
module.exports = StyleSheet.create({
99
${1}: ${2},

snippets/snippets.cson

Lines changed: 130 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,74 @@
11
# Generated with Atomizr - https://github.com/idleberg/atomizr.rb
22
'.source.js,source.jsx':
3+
'componentWillMount()':
4+
'prefix': 'cwm'
5+
'body': """
6+
componentWillMount() {
7+
${1}
8+
}$0
9+
"""
10+
'componentDidMount()':
11+
'prefix': 'cdm'
12+
'body': """
13+
componentDidMount() {
14+
${1}
15+
}$0
16+
"""
17+
'componentWillUnmount()':
18+
'prefix': 'cwum'
19+
'body': """
20+
componentWillUnmount() {
21+
${1}
22+
}$0
23+
"""
324
'alignItems: \'center\',':
425
'prefix': 'ai'
526
'body': 'alignItems: \'${1:center}\',$0'
6-
'componentDidMount()':
7-
'prefix': 'tss'
27+
'Create react-native Class':
28+
'prefix': 'rncc'
829
'body': """
9-
this.setState({
10-
${1:key}: ${2:\'value\'},
11-
});$0
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+
const styles = StyleSheet.create({
48+
49+
});
50+
51+
52+
export default ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};$0
1253
"""
13-
'componentDidUpdate(object prevProps, object prevState)':
14-
'prefix': 'cdud'
54+
'componentWillReceiveProps(object nextProps)':
55+
'prefix': 'cwrp'
1556
'body': """
16-
componentDidUpdate(prevProps, prevState) {
57+
componentWillReceiveProps(nextProps) {
58+
${1}
59+
}$0
60+
"""
61+
'componentWillUpdate(object nextProps, object nextState)':
62+
'prefix': 'cwud'
63+
'body': """
64+
componentWillUpdate(nextProps, nextState) {
65+
${1}
66+
}$0
67+
"""
68+
'shouldComponentUpdate(object nextProps, object nextState)':
69+
'prefix': 'scud'
70+
'body': """
71+
shouldComponentUpdate(nextProps, nextState) {
1772
${1}
1873
}$0
1974
"""
@@ -27,6 +82,14 @@
2782
/>
2883
${4}$0
2984
"""
85+
'PickerIOS':
86+
'prefix': 'rnPickerIOS'
87+
'body': """
88+
<PickerIOS
89+
onValueChange={${1:this.onValueChange}}
90+
selectedValue={${2}}
91+
/>$0
92+
"""
3093
'DatePickerIOS':
3194
'prefix': 'rnDatePickerIOS'
3295
'body': """
@@ -52,33 +115,6 @@
52115
/>
53116
${3}$0
54117
"""
55-
'PickerIOS':
56-
'prefix': 'rnPickerIOS'
57-
'body': """
58-
<PickerIOS
59-
onValueChange={${1:this.onValueChange}}
60-
selectedValue={${2}}
61-
/>$0
62-
"""
63-
'Image':
64-
'prefix': 'rnImage'
65-
'body': """
66-
<Image
67-
style={${1}}
68-
source={{uri: \'${2}\'}}
69-
/>
70-
${3}$0
71-
"""
72-
'ListView':
73-
'prefix': 'rnListView'
74-
'body': """
75-
<ListView
76-
style={${1}}
77-
dataSource={${2:this.state.dataSource}}
78-
renderRow={${3:(rowData) => ${4:<Text>{rowData\}</Text>}}}
79-
/>
80-
${5}$0
81-
"""
82118
'MapView':
83119
'prefix': 'rnMapView'
84120
'body': """
@@ -94,15 +130,25 @@
94130
/>
95131
${5}$0
96132
"""
97-
'Navigator':
98-
'prefix': 'rnNavigator'
133+
'ListView':
134+
'prefix': 'rnListView'
99135
'body': """
100-
<Navigator
101-
initialRoute={{name: \'${1:My First Scene}\', index: 0}}
102-
renderScene={(route, navigator) => {
103-
${2}
104-
}}
105-
/>$0
136+
<ListView
137+
style={${1}}
138+
dataSource={${2:this.state.dataSource}}
139+
renderRow={${3:(rowData) => ${4:<Text>{rowData\}</Text>}}}
140+
/>
141+
${5}$0
142+
"""
143+
'View':
144+
'prefix': 'rnView'
145+
'body': '<View style={styles.${1}}>${2}</View>$0'
146+
'Text':
147+
'prefix': 'rnText'
148+
'body': """
149+
<Text style={styles.${1}}>
150+
${2}
151+
</Text>$0
106152
"""
107153
'ScrollView':
108154
'prefix': 'rnScrollView'
@@ -113,12 +159,14 @@
113159
${3}
114160
</ScrollView>$0
115161
"""
116-
'Text':
117-
'prefix': 'rnText'
162+
'Image':
163+
'prefix': 'rnImage'
118164
'body': """
119-
<Text style={styles.${1}}>
120-
${2}
121-
</Text>$0
165+
<Image
166+
style={${1}}
167+
source={{uri: \'${2}\'}}
168+
/>
169+
${3}$0
122170
"""
123171
'TouchableHighlight':
124172
'prefix': 'rnTouchableHighlight'
@@ -130,100 +178,34 @@
130178
${4}
131179
</TouchableHighlight>$0
132180
"""
133-
'View':
134-
'prefix': 'rnView'
135-
'body': '<View style={styles.${1}}>${2}</View>$0'
136-
'componentWillMount()':
137-
'prefix': 'cwm'
138-
'body': """
139-
componentWillMount() {
140-
${1}
141-
}$0
142-
"""
143-
'componentWillReceiveProps(object nextProps)':
144-
'prefix': 'cwrp'
145-
'body': """
146-
componentWillReceiveProps(nextProps) {
147-
${1}
148-
}$0
149-
"""
150-
'componentWillUnmount()':
151-
'prefix': 'cwum'
152-
'body': """
153-
componentWillUnmount() {
154-
${1}
155-
}$0
156-
"""
157-
'componentWillUpdate(object nextProps, object nextState)':
158-
'prefix': 'cwud'
181+
'Navigator':
182+
'prefix': 'rnNavigator'
159183
'body': """
160-
componentWillUpdate(nextProps, nextState) {
161-
${1}
162-
}$0
184+
<Navigator
185+
initialRoute={{name: \'${1:My First Scene}\', index: 0}}
186+
renderScene={(route, navigator) => {
187+
${2}
188+
}}
189+
/>$0
163190
"""
164-
'constructor()':
165-
'prefix': 'constructor()'
191+
'propTypes':
192+
'prefix': 'propTypes'
166193
'body': """
167-
constructor(props) {
168-
super(props);
169-
170-
this.state = {};
194+
static propTypes = {
195+
${2:prop}: React.PropTypes.${3:Type}
171196
}$0
172197
"""
173-
'Create react-native Class':
174-
'prefix': 'rncc'
175-
'body': """
176-
\'use strict\';
177-
178-
import React, { Component } from \'react\';
179-
180-
import {
181-
StyleSheet,
182-
View,
183-
} from \'react-native\';
184-
185-
class ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}} extends Component {
186-
render() {
187-
return (
188-
${2:<View />}
189-
);
190-
}
191-
}
192-
193-
const styles = StyleSheet.create({
194-
195-
});
196-
197-
198-
export default ${1:${TM_FILENAME/(.+)\..+|.*/$1/:MyComponent}};$0
199-
"""
200198
'defaultProps':
201199
'prefix': 'defaultProps'
202200
'body': """
203201
static defaultProps = {
204202
${2:prop}: ${3:\'value\'}
205203
}$0
206204
"""
207-
'flex: 1':
208-
'prefix': 'f1'
209-
'body': 'flex: ${1:1},$0'
210-
'justifyContent: \'center\',':
211-
'prefix': 'jc'
212-
'body': 'justifyContent: \'${1:center}\',$0'
213-
'propTypes':
214-
'prefix': 'propTypes'
215-
'body': """
216-
static propTypes = {
217-
${2:prop}: React.PropTypes.${3:Type}
218-
}$0
219-
"""
220-
'React.PropTypes.':
221-
'prefix': 'rpt'
222-
'body': 'React.PropTypes.${1}$0'
223-
'shouldComponentUpdate(object nextProps, object nextState)':
224-
'prefix': 'scud'
205+
'componentDidUpdate(object prevProps, object prevState)':
206+
'prefix': 'cdud'
225207
'body': """
226-
shouldComponentUpdate(nextProps, nextState) {
208+
componentDidUpdate(prevProps, prevState) {
227209
${1}
228210
}$0
229211
"""
@@ -234,15 +216,33 @@
234216
${1}: ${2},
235217
});$0
236218
"""
219+
'flex: 1':
220+
'prefix': 'f1'
221+
'body': 'flex: ${1:1},$0'
237222
'Create StyleSheet':
238223
'prefix': 'css'
239224
'body': """
240225
/* @flow */
241226
\'use strict\';
242227
243-
import { Stylesheet } from \'react-native\';
228+
import { StyleSheet } from \'react-native\';
244229
245230
module.exports = StyleSheet.create({
246231
${1}: ${2},
247232
});$0
248233
"""
234+
'justifyContent: \'center\',':
235+
'prefix': 'jc'
236+
'body': 'justifyContent: \'${1:center}\',$0'
237+
'constructor()':
238+
'prefix': 'constructor()'
239+
'body': """
240+
constructor(props) {
241+
super(props);
242+
243+
this.state = {};
244+
}$0
245+
"""
246+
'React.PropTypes.':
247+
'prefix': 'rpt'
248+
'body': 'React.PropTypes.${1}$0'

0 commit comments

Comments
 (0)