Skip to content

Commit b528f5b

Browse files
committed
updating snippets
1 parent 4ee8b93 commit b528f5b

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

extensions/rnuilib-snippets/snippets/snippets.code-snippets

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"prefix": "radioGroup",
44
"description": "Wrap a group of Radio Buttons to automatically control their selection",
55
"body": [
6-
"<RadioGroup initialValue={this.state.value$1} onValueChange={() => console.log('value changed)$2}>",
6+
"<RadioGroup initialValue={this.state.value$1} onValueChange={() => console.log('value changed')$2}>",
77
" <RadioButton value={'yes'$3} label={'Yes'$4}/>",
88
" <RadioButton value={'no'$5} label={'No'$6}/>",
99
"</RadioGroup>"
@@ -41,8 +41,13 @@
4141
"prefix": "drawer",
4242
"description": "Drawer Component",
4343
"body": [
44-
"<Drawer rightItems:{[{text: 'Read', onPress: () => console.log('read pressed')}, {text: 'Delete', onPress: () => console.log('delete pressed')}]}$1>",
45-
" <ListItem><Text grey10 text60 marginL-10>The item</Text></ListItem>$2",
44+
"<Drawer",
45+
" rightItems={[{text: 'Read', background: Colors.blue30, onPress: () => console.log('read pressed')}]$1}",
46+
" leftItem={{text: 'Delete', background: Colors.red30, onPress: () => console.log('delete pressed')}$2}",
47+
">",
48+
" <View centerV padding-s4 bg-white style={{height: 60}}>",
49+
" <Text text70>Item</Text>",
50+
" </View>",
4651
"</Drawer>"
4752
]
4853
},
@@ -123,7 +128,7 @@
123128
"<Picker",
124129
" value={this.state.value$1}",
125130
" placeholder={'Placeholder'$2}",
126-
" onChange={() => console.log('changed)$3}",
131+
" onChange={() => console.log('changed')$3}",
127132
">",
128133
" {_.map(items, item => (",
129134
" return this.renderItem(item, index);",
@@ -135,7 +140,7 @@
135140
"prefix": "floatingButton",
136141
"description": "Hovering button with gradient background",
137142
"body": [
138-
"<FloatingButton visible={this.state.visible$1} button={button={{label: 'Approve', onPress: () => console.log('approved')}}$2}/>"
143+
"<FloatingButton visible={this.state.visible$1} button={{label: 'Approve', onPress: () => console.log('approved')}}$2}/>"
139144
]
140145
},
141146
"MaskedInput": {
@@ -151,14 +156,14 @@
151156
" visible={this.state.visible$1}",
152157
" position={'top'$2}",
153158
" autoDismiss={5000$2}",
154-
" onDismiss={() => console.log('dismissed)$3}",
159+
" onDismiss={() => console.log('dismissed')$3}",
155160
">"
156161
]
157162
},
158163
"Chip": {
159164
"prefix": "chip",
160165
"description": "Chip component",
161-
"body": ["<Chip label={'Chip'$1} onPress={() => console.log('pressed)$2}/>"]
166+
"body": ["<Chip label={'Chip'$1} onPress={() => console.log('pressed')$2}/>"]
162167
},
163168
"Wizard.Step": {
164169
"prefix": "wizard.Step",
@@ -169,7 +174,7 @@
169174
"prefix": "wizard",
170175
"description": "A wizard presents a series of steps in prescribed order. That the user needs to complete in order to accomplish a goal (e.g. purchase a product)",
171176
"body": [
172-
"<Wizard activeIndex={0$1} onActiveIndexChanged={() => console.log('changed)$2}>",
177+
"<Wizard activeIndex={0$1} onActiveIndexChanged={() => console.log('changed')$2}>",
173178
" {_.map(items, item => (",
174179
" return this.renderItem(item, index);",
175180
" ))}",
@@ -183,14 +188,14 @@
183188
"<ColorPalette",
184189
" colors={['transparent', Colors.green30, Colors.yellow30, Colors.red30]$1}",
185190
" value={this.state.selectedColor$2}",
186-
" onValueChange={() => console.log('value changed)$3}",
191+
" onValueChange={() => console.log('value changed')$3}",
187192
"/>"
188193
]
189194
},
190195
"Checkbox": {
191196
"prefix": "checkbox",
192197
"description": "Checkbox component for toggling boolean value related to some context",
193-
"body": ["<Checkbox value={false$1} onValueChange={() => console.log('value changed)$2}/>"]
198+
"body": ["<Checkbox value={false$1} onValueChange={() => console.log('value changed')$2}/>"]
194199
},
195200
"TextField": {
196201
"prefix": "textField",
@@ -199,7 +204,7 @@
199204
"<TextField",
200205
" placeholder={'Placeholder$1}",
201206
" floatingPlaceholder",
202-
" onChangeText={() => console.log('changed)$2}",
207+
" onChangeText={() => console.log('changed')$2}",
203208
" enableErrors",
204209
" validate={['required', 'email', (value) => value.length > 6]$3}",
205210
" validationMessage={['Field is required', 'Email is invalid', 'Password is too short']$4}",
@@ -225,7 +230,7 @@
225230
"description": "Stack aggregator component",
226231
"body": [
227232
"<StackAggregator",
228-
" onItemPress={() => console.log('pressed)$1}",
233+
" onItemPress={() => console.log('pressed')$1}",
229234
">",
230235
" {_.map(items, (item, index) => {",
231236
" return this.renderItem(item, index);",
@@ -271,7 +276,7 @@
271276
"prefix": "listItem",
272277
"description": "List item component to render inside a List component",
273278
"body": [
274-
"<ListItem onPress={() => console.log('pressed)$1}>",
279+
"<ListItem onPress={() => console.log('pressed')$1}>",
275280
" <Text grey10 text60 marginL-10>The item</Text>$2",
276281
"</ListItem>"
277282
]
@@ -335,7 +340,7 @@
335340
"TouchableOpacity": {
336341
"prefix": "touchableOpacity",
337342
"description": "A wrapper for TouchableOpacity component. Support onPress, throttling and activeBackgroundColor",
338-
"body": ["<TouchableOpacity onPress={() => console.log('pressed)$1}/>"]
343+
"body": ["<TouchableOpacity onPress={() => console.log('pressed')$1}/>"]
339344
},
340345
"StateScreen": {
341346
"prefix": "stateScreen",
@@ -379,7 +384,7 @@
379384
"Switch": {
380385
"prefix": "switch",
381386
"description": "Switch component for toggling boolean value related to some context",
382-
"body": ["<Switch value={false$1} onValueChange={() => console.log('value changed)$2}/>"]
387+
"body": ["<Switch value={false$1} onValueChange={() => console.log('value changed')$2}/>"]
383388
},
384389
"DateTimePicker": {
385390
"prefix": "dateTimePicker",
@@ -441,7 +446,7 @@
441446
"prefix": "modal",
442447
"description": "Component that present content on top of the invoking screen",
443448
"body": [
444-
"<Modal visible={this.state.visible$1} onBackgroundPress={() => console.log('background pressed)$3}>",
449+
"<Modal visible={this.state.visible$1} onBackgroundPress={() => console.log('background pressed')$3}>",
445450
" <Text text60>Content</Text>$4",
446451
"</Modal>"
447452
]
@@ -532,7 +537,7 @@
532537
"<WheelPicker",
533538
" items={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}, {label: 'Maybe', value: 'maybe'}]$1}",
534539
" initialValue={'yes'$2}",
535-
" onChange={() => console.log('changed)$3}",
540+
" onChange={() => console.log('changed')$3}",
536541
"/>"
537542
]
538543
},

src/components/floatingButton/floatingButton.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
}
2828
],
2929
"snippet": [
30-
"<FloatingButton visible={this.state.visible$1} button={button={{label: 'Approve', onPress: () => console.log('approved')}}$2}/>"
30+
"<FloatingButton visible={this.state.visible$1} button={{label: 'Approve', onPress: () => console.log('approved')}}$2}/>"
3131
]
3232
}

0 commit comments

Comments
 (0)