Skip to content

Commit 2c561a6

Browse files
committed
Update some components code snippets
1 parent 96b4977 commit 2c561a6

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

src/components/hint/hint.api.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
{"name": "style", "type": "ViewStyle", "description": "Additional styling"}
5151
],
5252
"snippet": [
53-
"<Hint visible={this.state.visible$1} message={'Message goes here'$2} color={Colors.red30$3}/>"
53+
"<Hint visible={visible$1} message={'Message goes here'$2} color={Colors.red30$3} onBackgroundPress={() => setVisible(false)$4}>",
54+
" <Text>Text to hint</Text>",
55+
"</Hint>"
5456
]
5557
}

src/components/tabController/apis/tabController.api.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@
2323
{"name": "carouselPageWidth;", "type": "number", "description": "Pass for custom carousel page width"}
2424
],
2525
"snippet": [
26-
"<TabController items={$1}>",
27-
" $2",
26+
"<TabController items={[{label: 'First'}, {label: 'Second'}, {label: 'Third'}]$1}>",
27+
" <TabController.TabBar enableShadows/>",
28+
" <View flex>",
29+
" <TabController.TabPage index={0}>{renderFirstPage()}</TabController.TabPage>",
30+
" <TabController.TabPage index={1} lazy>{renderSecondPage()}</TabController.TabPage>",
31+
" <TabController.TabPage index={2} lazy>{renderThirdPage()}</TabController.TabPage>",
32+
" </View>",
2833
"</TabController>"
2934
]
3035
}

src/incubator/Dialog/dialog.api.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
],
2121
"snippet": [
2222
"<Dialog",
23-
" visible={this.state.visible$1}",
24-
" onDismiss={() => console.log('dismissed')$2}",
25-
" panDirection={PanningProvider.Directions.DOWN$3}",
23+
" visible={this.state.visible$1}",
24+
" onDismiss={() => console.log('dismissed')$2}",
25+
" panDirection={PanningProvider.Directions.DOWN$3}",
2626
">",
27-
" {<Text text60>Content</Text>}$4",
27+
" <Text text60>Content</Text>$4",
2828
"</Dialog>"
2929
]
3030
}

src/incubator/TextField/textField.api.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@
9090
}
9191
],
9292
"snippet": [
93-
"<TextField placeholder={'Placeholder$1} onChangeText={() => console.log('changed)$2}/>"
93+
"<TextField",
94+
" placeholder={'Placeholder$1}",
95+
" floatingPlaceholder",
96+
" onChangeText={() => console.log('changed)$2}",
97+
" enableErrors",
98+
" validate={['required', 'email', (value) => value.length > 6]$3}",
99+
" validationMessage={['Field is required', 'Email is invalid', 'Password is too short']$4}",
100+
" showCharCounter",
101+
" maxLength={30}",
102+
"/>"
94103
]
95104
}

src/incubator/WheelPicker/wheelPicker.api.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
],
3737
"snippet": [
3838
"<WheelPicker",
39-
" items={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}, {label: 'Maybe', value: 'maybe'}]$1}",
40-
" initialValue={'Yes'$2}",
41-
" onChange={() => console.log('changed’)$3}",
39+
" items={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}, {label: 'Maybe', value: 'maybe'}]$1}",
40+
" initialValue={'yes'$2}",
41+
" onChange={() => console.log('changed’)$3}",
4242
"/>"
4343
]
4444
}

src/incubator/toast/toast.api.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@
6262
],
6363
"snippet": [
6464
"<Toast",
65-
" visible={this.state.visible$1}",
66-
" position={'top'$2}",
67-
" onDismiss={() => console.log('dismissed)$3}",
65+
" visible={this.state.visible$1}",
66+
" position={'top'$2}",
67+
" autoDismiss={5000$2}",
68+
" onDismiss={() => console.log('dismissed)$3}",
6869
">"
6970
]
7071
}

0 commit comments

Comments
 (0)