| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- import {
- useRef
- } from "react";
- import {
- View
- } from "react-native";
- import stylesheet from "./stylesheet";
- import {
- type IBottomSheetRef,
- getNCoreUIKitVersion,
- NCoreUIKitTheme,
- BottomSheet,
- TextInput,
- SelectBox,
- Button,
- Text
- } from "ncore-ui-kit-mobile";
- import {
- useNavigation
- } from "@react-navigation/native";
- const X = [{
- t: "x",
- p: "y",
- n: 90
- }];
- const Home = () => {
- const {
- colors
- } = NCoreUIKitTheme.useContext();
- const bottomSheetRef = useRef<IBottomSheetRef>(null);
- const navigation = useNavigation();
- return <View
- style={[
- stylesheet.container,
- {
- backgroundColor: colors.content.container.default
- }
- ]}
- >
- <SelectBox
- keyExtractor={(data, index) => `${data.t}-${index}`}
- titleExtractor={(data) => data.t}
- subTitle="Deneme Subtitle"
- hintText="Test deneme"
- isShowSubTitle={true}
- initialSelectedItems={[{
- __title: X[0]?.t as string,
- __key: `${X[0]?.t}-0`,
- __originalIndex: 0
- }]}
- title="Deneme Box"
- isRequired={true}
- data={X}
- />
- <TextInput
- variant="hidden"
- />
- <Text>Version: v{getNCoreUIKitVersion()}</Text>
- <Button
- onPress={() => {
- navigation.navigate("TestSubPage");
- }}
- type="success"
- title="Open Test Sub Page"
- variant="filled"
- />
- <Button
- onPress={() => {
- bottomSheetRef.current?.open();
- }}
- type="success"
- title="Open BottomSheet"
- variant="filled"
- />
- <BottomSheet
- isWorkAsFullScreen={true}
- ref={bottomSheetRef}
- renderHeader={() => {
- return <View
- style={[
- {
- backgroundColor: "blue",
- padding: 20
- }
- ]}
- >
- <Text>Burası header.</Text>
- </View>;
- }}
- // snapPoint={300}
- key="ahmet"
- >
- <Button
- onPress={() => {
- navigation.navigate("TestSubPage");
- }}
- title="Git."
- />
- <View
- style={{
- backgroundColor: "red",
- height: 2400
- }}
- />
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- <Text>Deneme 123</Text>
- </BottomSheet>
- </View>;
- };
- export default Home;
|