import { useLayoutEffect, useState } from "react"; import { View } from "react-native"; import stylesheet from "./stylesheet"; import { NCoreUIKitLocalize, NCoreUIKitTheme, PageContainer, CodeViewer, SelectBox, TextInput, Button, Header, Switch, 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 { IButtonProps } from "ncore-ui-kit"; import { Home as HomeIcon } from "lucide-react-native"; const BUTTON_TYPES: Array = [ "primary", "danger", "warning", "success", "info" ]; const BUTTON_VARIANTS: Array = [ "filled", "outline", "ghost" ]; const BUTTON_SIZES: Array = [ "small", "medium", "large" ]; const BUTTON_TYPES_DATA = BUTTON_TYPES.map(item => ({ __title: item as string, __key: item as string })); const BUTTON_SPREAD_BEHAVIOURS: Array = [ "baseline", "stretch", "free" ]; const BUTTON_VARIANTS_DATA = BUTTON_VARIANTS.map(item => ({ __title: item as string, __key: item as string })); const BUTTON_SIZES_DATA = BUTTON_SIZES.map(item => ({ __title: item as string, __key: item as string })); const ButtonPage = () => { const { radiuses, borders, spaces, colors } = NCoreUIKitTheme.useContext(); const { localize } = NCoreUIKitLocalize.useContext(); const navigation = useNavigation>(); const [ typeIndex, setTypeIndex ] = useState(0); const [ spreadIndex, setSpreadIndex ] = useState(0); const [ variantIndex, setVariantIndex ] = useState(0); const [ sizeIndex, setSizeIndex ] = useState(1); const [ title, setTitle ] = useState(""); const [ isLoading, setIsLoading ] = useState(false); const [ isDisabled, setIsDisabled ] = useState(false); const [ isCustomPadding, setIsCustomPadding ] = useState(false); const [ showIcon, setShowIcon ] = useState(false); const [ iconDirection, setIconDirection ] = useState<"left" | "right">("left"); useLayoutEffect(() => { navigation.setOptions({ header: () =>
, headerShown: true }); }, []); return {localize("button-desc")}