import { useLayoutEffect, useState } from "react"; import { View } from "react-native"; import stylesheet from "./stylesheet"; import { NCoreUIKitLocalize, NCoreUIKitTheme, PageContainer, SelectBox, Loading, 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"; import type { ILoadingProps } from "ncore-ui-kit"; const SIZES: Array = [ 16, 24, 32 ]; const SIZES_DATA = SIZES.map((item) => ({ __title: String(item), __key: String(item) })); const LoadingPage = () => { const { radiuses, borders, spaces, colors } = NCoreUIKitTheme.useContext(); const { localize } = NCoreUIKitLocalize.useContext(); const navigation = useNavigation>(); const [ sizeIndex, setSizeIndex ] = useState(1); useLayoutEffect(() => { navigation.setOptions({ header: () =>
, headerShown: true }); }, []); return {localize("loading-desc")} { if (selectedItems.length > 0) { const index = SIZES.indexOf( Number( selectedItems[0]!.__key, ) as ILoadingProps["size"], ); if (index !== -1) setSizeIndex(index); } }} initialSelectedItems={ SIZES_DATA[sizeIndex] ? [ SIZES_DATA[sizeIndex]! ] : [] } title={localize("loading-changeSize")} titleExtractor={(item) => item.__title} keyExtractor={(item) => item.__key} spreadBehaviour="free" data={SIZES_DATA} /> ; }; export default LoadingPage;