index.tsx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import {
  2. useLayoutEffect,
  3. useState
  4. } from "react";
  5. import {
  6. View
  7. } from "react-native";
  8. import stylesheet from "./stylesheet";
  9. import {
  10. NCoreUIKitLocalize,
  11. PageContainer,
  12. TimeSelector,
  13. Header,
  14. Text
  15. } from "ncore-ui-kit";
  16. import {
  17. useNavigation
  18. } from "@react-navigation/native";
  19. import type RootStackParamList from "../../../navigation/type";
  20. import type {
  21. NativeStackNavigationProp
  22. } from "@react-navigation/native-stack";
  23. const TimeSelectorPage = () => {
  24. const {
  25. localize
  26. } = NCoreUIKitLocalize.useContext();
  27. const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
  28. const [
  29. ,
  30. setIsSheetContentReady
  31. ] = useState<boolean>(false);
  32. useLayoutEffect(() => {
  33. navigation.setOptions({
  34. header: () => <Header
  35. title={localize("components-timeSelector")}
  36. isWrapSafeareaContext={false}
  37. navigation={navigation}
  38. isGoBackEnable={true}
  39. />,
  40. headerShown: true
  41. });
  42. }, []);
  43. return <PageContainer
  44. scrollViewProps={{
  45. contentContainerStyle: stylesheet.scrollContent
  46. }}
  47. scrollViewStyle={[
  48. stylesheet.container
  49. ]}
  50. isWorkWithHeaderSpace={false}
  51. isScrollable={true}
  52. >
  53. <View
  54. style={[
  55. stylesheet.contentContainer
  56. ]}
  57. >
  58. <Text
  59. variant="bodyMediumSize"
  60. color="mid"
  61. style={stylesheet.descText}
  62. >
  63. {localize("timeSelector-desc")}
  64. </Text>
  65. <Text
  66. style={stylesheet.title}
  67. variant="titleMediumSize"
  68. >
  69. {localize("components-timeSelector")}
  70. </Text>
  71. <TimeSelector
  72. setIsSheetContentReady={setIsSheetContentReady}
  73. selectMultipleObject={() => {}}
  74. selectObject={() => {}}
  75. pickerType="time"
  76. variant="single"
  77. />
  78. </View>
  79. </PageContainer>;
  80. };
  81. export default TimeSelectorPage;