-
Notifications
You must be signed in to change notification settings - Fork 0
/
zalim.code-snippets
153 lines (153 loc) · 3.82 KB
/
zalim.code-snippets
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{
"Var": {
"prefix": "var",
"description": "${} ekler.",
"body": "${$1}"
},
"View": {
"prefix": "view",
"description": "View component ekler.",
"body": ["<View style={styles.$1}>", " ", "</View>"]
},
"Text": {
"prefix": "text",
"description": "Text component ekler.",
"body": ["<Text style={styles.x}> $1 </Text>"]
},
"Button": {
"prefix": "button",
"description": "TouchableOpacity componenti ekler.",
"body": [
"<TouchableOpacity onPress={() => {}}>",
" <Text> $1 </Text>",
"</TouchableOpacity>"
]
},
"Style File": {
"prefix": "rns",
"description": "Temel bir style dosyası hazırlar.",
"body": [
"import { StyleSheet, Dimensions } from \"react-native\";",
"const { HEIGHT, WIDTH } = Dimensions.get(\"window\");",
"",
"export const styles = StyleSheet.create({",
" container: {",
" flex: 1,",
" },",
" center: {},",
"});",
""
]
},
"Screen File": {
"prefix": "rnc",
"description": "Redux'lı bir ekran dosyası hazırlar.",
"body": [
"import React, { Component } from \"react\";",
"import { Text, View } from \"react-native\";",
"",
"import { connect } from \"react-redux\";",
"import { bindActionCreators } from \"redux\";",
"",
"import { styles } from \"./style\";",
"import {} from \"../../../redux/actions/A_$1\";",
"",
"class $1 extends Component {",
" render() {",
" return (",
" <View style={styles.container}>",
" <Text style={styles.center}>$1 sayfasındasın.</Text>",
" </View>",
" );",
" }",
"}",
"",
"export default connect(",
" __ => ({",
" //isAuth: state.R_Welcome.isAuth,",
" }),",
" dispatch => ({",
" __: bindActionCreators(Object.assign({}), dispatch),",
" }),",
")($1);",
""
]
},
"create constuctor": {
"prefix": "constructor",
"description": "Constructor ayarlar.",
"body": [
" constructor(props) {",
" super(props);",
" this.state = {",
" $1: \"\",",
" };",
" }"
]
},
"navigation": {
"prefix": "nav",
"description": "react navigation",
"body": ["this.props.navigation.navigate(\"xxxxxxxxx\")"]
},
"define Func": {
"prefix": "ok",
"description": "() => {",
"body": ["() => {", " $1", "}"]
},
"create reducer": {
"prefix": "rnr",
"description": "Örnek bir reducer dosyası hazırlar.",
"body": [
"import { types } from \"../actions/A_$1\";",
"",
"const INITIAL_STATE = {",
" xxxxx: \"\",",
"};",
"",
"export default (state = INITIAL_STATE, actions) => {",
" switch (actions.type) {",
" //////////////////////",
" case types.YYYYYYY:",
" return { ...state, loading: true };",
"",
" default:",
" return state;",
" }",
"};",
""
]
},
"create action": {
"prefix": "rna",
"description": "Örnek bir action dosyası hazırlar.",
"body": [
"export const types = {",
" XXXXXXXX_XXXXXXXX_XXXX: \"xxxxxxxxxx\",",
"};",
"",
"export const $1 = () => async dispatch => {};"
]
},
"create Comp": {
"prefix": "rncom",
"description": "Temel bir component hazırlar.",
"body": [
"import React from \"react\";",
"import { View, Text } from \"react-native\";",
"",
"import { styles } from \"./style\";",
"",
"const $1 = ({ arg }) => {",
" return (",
" <View style={styles.container}>",
" <Text style={styles.center}> okan </Text>",
" </View>",
" );",
"};",
"",
"export { $1 };",
""
]
}
}