Skip to content

Commit f84ee76

Browse files
committed
feat: add working and testable example
1 parent 89355fb commit f84ee76

3 files changed

Lines changed: 46 additions & 17 deletions

File tree

FabricExample/src/screens/Examples/Toolbar/index.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet";
12
import React, { useCallback, useEffect, useState } from "react";
23
import { Modal, Platform, StyleSheet, Text, View } from "react-native";
34
import {
@@ -214,6 +215,24 @@ export default function ToolbarExample({ navigation }: Props) {
214215
<Form />
215216
</View>
216217
</Modal>
218+
<BottomSheet index={-1}>
219+
<BottomSheetView style={styles.bottomSheetContent}>
220+
<KeyboardToolbar.Group>
221+
<TextInput
222+
keyboardType="default"
223+
placeholder="Group input 1"
224+
testID="TextInput#14"
225+
title="Group Input 1"
226+
/>
227+
<TextInput
228+
keyboardType="default"
229+
placeholder="Group input 2"
230+
testID="TextInput#15"
231+
title="Group Input 2"
232+
/>
233+
</KeyboardToolbar.Group>
234+
</BottomSheetView>
235+
</BottomSheet>
217236
</>
218237
);
219238
}
@@ -245,4 +264,7 @@ const styles = StyleSheet.create({
245264
modal: {
246265
marginTop: 32,
247266
},
267+
bottomSheetContent: {
268+
flex: 1,
269+
},
248270
});

example/src/screens/Examples/Toolbar/index.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import BottomSheet, { BottomSheetView } from "@gorhom/bottom-sheet";
12
import React, { useCallback, useEffect, useState } from "react";
23
import { Modal, Platform, StyleSheet, Text, View } from "react-native";
34
import {
@@ -154,22 +155,6 @@ function Form() {
154155
title="Flat"
155156
onFocus={onHideAutoFill}
156157
/>
157-
<KeyboardToolbar.Group>
158-
<TextInput
159-
keyboardType="default"
160-
placeholder="Group input 1"
161-
testID="TextInput#14"
162-
title="Group Input 1"
163-
onFocus={onHideAutoFill}
164-
/>
165-
<TextInput
166-
keyboardType="default"
167-
placeholder="Group input 2"
168-
testID="TextInput#15"
169-
title="Group Input 2"
170-
onFocus={onHideAutoFill}
171-
/>
172-
</KeyboardToolbar.Group>
173158
</KeyboardAwareScrollView>
174159
<KeyboardToolbar
175160
insets={insets}
@@ -230,6 +215,24 @@ export default function ToolbarExample({ navigation }: Props) {
230215
<Form />
231216
</View>
232217
</Modal>
218+
<BottomSheet index={-1}>
219+
<BottomSheetView style={styles.bottomSheetContent}>
220+
<KeyboardToolbar.Group>
221+
<TextInput
222+
keyboardType="default"
223+
placeholder="Group input 1"
224+
testID="TextInput#14"
225+
title="Group Input 1"
226+
/>
227+
<TextInput
228+
keyboardType="default"
229+
placeholder="Group input 2"
230+
testID="TextInput#15"
231+
title="Group Input 2"
232+
/>
233+
</KeyboardToolbar.Group>
234+
</BottomSheetView>
235+
</BottomSheet>
233236
</>
234237
);
235238
}
@@ -261,4 +264,7 @@ const styles = StyleSheet.create({
261264
modal: {
262265
marginTop: 32,
263266
},
267+
bottomSheetContent: {
268+
flex: 1,
269+
},
264270
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@
194194
"OverKeyboardView": "OverKeyboardView",
195195
"KeyboardBackgroundView": "KeyboardBackgroundView",
196196
"KeyboardExtender": "KeyboardExtender",
197-
"ClippingScrollViewDecoratorView": "ClippingScrollViewDecoratorView"
197+
"ClippingScrollViewDecoratorView": "ClippingScrollViewDecoratorView",
198+
"KeyboardToolbarGroupView": "KeyboardToolbarGroupView"
198199
}
199200
}
200201
},

0 commit comments

Comments
 (0)