import React, { ReactNode, ComponentPropsWithoutRef } from 'react'; import { ScrollView, TextStyle as TextStyleType, ViewStyle } from 'react-native'; import { CommonScreenProps } from './types'; import type { InputProps } from 'react-native-elements'; declare type Props = CommonScreenProps & { code: string; /** * Required prop: Function called every time the code is changed. It is recommended to use this with the `useConfirmPhone` hook. * * To have this logic fully handled for you, see the `AuthFlow.ConfirmScreen` component. Or, for an even simpler experience, see the `AuthFlow` stack. * * @example * ```jsx * import * as React from 'react' * import { useConfirmPhone, ConfirmScreen } from 'react-native-doorman' * * export default function ConfirmScreen(props) { * const { code, onChangeCode, reset, loading } = useConfirmPhone({ phoneNumber: props.phoneNumber }) * * return ( * * ) * } * ``` * */ onChangeCode: (code: string) => void; /** * (Optional) Boolean to show if it's loading. If true, shows a loading indicator. It is recommended to use this with the `useConfirmPhone` hook. * * To have this logic fully handled for you, see the `AuthFlow.ConfirmScreen` component. Or, for an even simpler experience, see the `AuthFlow` stack. * * * @example * ```jsx * import * as React from 'react' * import { useConfirmPhone, ConfirmScreen } from 'react-native-doorman' import Input from '../components/Input' * export default function ConfirmScreen(props) { * const { code, onChangeCode, reset, loading } = useConfirmPhone({ phoneNumber: props.phoneNumber }) * * return ( * * ) * } * ``` * */ loading?: boolean; /** * **Required** `phoneNumber` that the 6-digit code was sent to. You should have this value from the previous screen, `PhoneAuth`. To have this logic between screens all handled for you, see the `AuthFlow` component. * */ phoneNumber: string; /** * (Optional prop) Message that will show up above the code input. This should tell your user that they just received a code to their phone, and that it should show up below. * * Can either be a string, or a function. * * If you pass a function, it receives one argument: a dictionary with a `phoneNumber` value. The function should return a string or React Native node. * * @default * ```es6 * const defaultMessage = ({phoneNumber}) => `We just sent a 6-digit code to ${phoneNumber}. Enter it below to continue.` * ``` * * @example * ```jsx * * export default () => { * return `Check ${phoneNumber} for a text!`} /> * } * ``` */ message?: string | ((info: { phoneNumber: string; }) => ReactNode); /** * Callback function called when user presses "Resent Code" button */ onPressResendCode?: (info: { phoneNumber: string; }) => void; /** * Override text for button that lets users to resend code. * * Default: `Resend Code` */ resendText?: string; /** * Boolean to indicate if resending the code is loading. * * Used with the `useConfirmPhone` hook. */ resending?: boolean; /** * Text style prop for the resend text. If you just want to change the color, see the `tintColor` prop. */ resendStyle?: TextStyleType; /** */ /** * Header text that appears at the top. * * Default: Enter code */ title?: string; /** * If there is a network error message */ error?: string | null; /** * Text style for the `error` message prop. */ errorStyle?: TextStyleType; /** * Props for the scroll view containing the whole screen. For styles, see `containerStyle` */ containerProps?: Omit, 'style'>; /** * Style the outer screen. */ containerStyle?: ViewStyle; /** * Default: `Confirm Code`. Set empty string to remove. * * You can also see these props: `renderHeaderTitle`, or `renderHeader`, or `headerProps`. */ headerText?: string; /** * Optionally render your own custom loader when a code verification is loading. */ renderLoader?: () => ReactNode; /** * Function that gets called when the back arrow is pressed. */ onGoBack?: () => void; /** * Optional color for the activity indicator when a message is sending. See also: `renderLoader` prop. */ loaderColor?: string; /** * Optional styles for the TextInput component. */ inputStyle?: TextStyleType; /** * Custom TextInput props. Note that there are many other props to customize the input. Do a page find for `input` to find them. */ inputProps?: InputProps; }; declare function Confirm(props: Props): JSX.Element; export declare const ConfirmScreen: React.MemoExoticComponent; export {};