| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- import {
- useLayoutEffect,
- useState
- } from "react";
- import {
- View
- } from "react-native";
- import stylesheet from "./stylesheet";
- import {
- NCoreUIKitLocalize,
- NCoreUIKitTheme,
- PageContainer,
- YearSelector,
- CodeViewer,
- Header,
- Text
- } from "ncore-ui-kit";
- import {
- useNavigation
- } from "@react-navigation/native";
- import type RootStackParamList from "../../../navigation/type";
- import type {
- NativeStackNavigationProp
- } from "@react-navigation/native-stack";
- const YearSelectorPage = () => {
- const {
- localize
- } = NCoreUIKitLocalize.useContext();
- const {
- spaces
- } = NCoreUIKitTheme.useContext();
- const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
- const [
- ,
- setIsSheetContentReady
- ] = useState<boolean>(false);
- useLayoutEffect(() => {
- navigation.setOptions({
- header: () => <Header
- title={localize("components-yearSelector")}
- isWrapSafeareaContext={false}
- navigation={navigation}
- isGoBackEnable={true}
- />,
- headerShown: true
- });
- }, []);
- return <PageContainer
- scrollViewProps={{
- contentContainerStyle: stylesheet.scrollContent
- }}
- scrollViewStyle={[
- stylesheet.container
- ]}
- isWorkWithHeaderSpace={false}
- isScrollable={true}
- >
- <View
- style={[
- stylesheet.contentContainer
- ]}
- >
- <Text
- variant="bodyMediumSize"
- color="mid"
- style={stylesheet.descText}
- >
- {localize("yearSelector-desc")}
- </Text>
- <Text
- style={stylesheet.title}
- variant="titleMediumSize"
- >
- {localize("components-yearSelector")}
- </Text>
- <YearSelector
- setIsSheetContentReady={setIsSheetContentReady}
- selectMultipleObject={() => {}}
- selectObject={() => {}}
- variant="single"
- />
- <View
- style={{
- marginTop: spaces.spacingMd
- }}
- >
- <Text
- variant="headlineSmallSize"
- style={{
- marginBottom: spaces.spacingSm
- }}
- >
- {localize("usage")}
- </Text>
- <CodeViewer
- code={"import {\n YearSelector\n} from \"ncore-ui-kit\";\n\n<YearSelector\n variant=\"single\"\n selectObject={(item) => console.log(item)}\n/>"}
- language="tsx"
- />
- </View>
- </View>
- </PageContainer>;
- };
- export default YearSelectorPage;
|