-
Notifications
You must be signed in to change notification settings - Fork 2
/
MySnippets.json
101 lines (101 loc) · 2.47 KB
/
MySnippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
"RN Functional Component": {
"prefix": "rnfc",
"body": [
"import React from 'react';",
"import { View, StyleSheet, Text, StatusBar } from 'react-native';",
"",
"const ${TM_FILENAME_BASE} = (props) => {",
" return (",
" <>",
" <StatusBar barStyle='dark-content' backgroundColor={styles.container?.backgroundColor} />",
" <View style={styles.container}>",
" <Text>${TM_FILENAME_BASE}</Text>",
" </View>",
" </>",
" );",
"}",
"",
"const styles = StyleSheet.create({",
" container: {",
" flex: 1,",
" alignItems: 'center',",
" justifyContent: 'center',",
" backgroundColor: '#F5F5F5',",
" },",
"});",
"",
"export default ${TM_FILENAME_BASE};",
""
]
},
"RN Class Component": {
"prefix": "rncc",
"body": [
"import React, { Component } from 'react';",
"import { View, StyleSheet, Text, StatusBar } from 'react-native';",
"",
"class ${TM_FILENAME_BASE} extends Component {",
" render() {",
" return (",
" <>",
" <StatusBar barStyle='dark-content' backgroundColor={styles.container?.backgroundColor} />",
" <View style={styles.container}>",
" <Text> ${TM_FILENAME_BASE} </Text>",
" </View>",
" </>",
" );",
" }",
"}",
"",
"const styles = StyleSheet.create({",
" container: {",
" flex: 1,",
" alignItems: 'center',",
" justifyContent: 'center',",
" backgroundColor: '#f5f5f5',",
" },",
"});",
"",
"export default ${TM_FILENAME_BASE};",
""
]
},
"RN Style Component": {
"prefix": "rnss",
"body": [
"import { StyleSheet } from 'react-native';",
"",
"const styles = StyleSheet.create({});",
"",
"export default ${TM_FILENAME_BASE};"
]
},
"Print to console with title": {
"prefix": "clg",
"body": [
"console.log('>>>$1<<<', $2);"
]
},
"Display borders": {
"prefix": "dbor",
"body": [
"borderWidth: 1,",
"borderColor: 'red',"
]
},
"Display comments": {
"prefix": "comm",
"body": [
"/** --------------------------",
" * $1",
" --------------------------**/"
]
},
"Object Destructure": {
"prefix": "dest",
"body": [
"const { $2 } = $1;"
]
},
}