types APIs
- SimpleOptions
- RootState
- User
- ChainType
- FeedbackCategoryAPI
- FeedbackStatusAPI
- FeedbackUserProfileAPI
- NavItems
- SingleNavItem
- NonNullableChildrenDeep
- SingleArticle
- ColumnType
- DataType
- Hub
- PluginConfig
- RawEventMessage
- DualStakingInfo
- StakingInfo
- SyrupInfo
- CommonStakingInfo
- LairInfo
- StakingBasic
- DualStakingBasic
- SyrupBasic
- Questionnaire
- TaskStatuses
- LoginPayload
- SignupPayload
- MutationType
- ProteinSize
- Config
- Themes
- defaults
- CoordinateSpaceInitial
- Background
- Metric
- Metadata
- TManageValue
- Domain
- Organization
- OrganizationTag
- Scan
- ScanSchema
- Query
- SavedSearch
- Role
- ScanTask
- Vulnerability
- GenericObject
- Annotation
- AnnotationList
- VideoAnnotation
- IconName
- IllustrationName
- INotification
- BottomTabScreens
- KYCScreens
- CCVPScreens
- LoginScreens
- PreAuthScreens
- SignUpScreens
- TFAScreens
- PNVScreens
- ProfileScreens
- SecurityScreens
- SMTYFScreens
- WalletScreens
- WithdrawalScreens
- StackNavigationProps
- Coin
- Country
- TransactionStatus
- SetApiActionPayloadInterface
- LoadingStateInterface
- MessageStateInterface
- UiOptionType
- ApiDiffInterface
- ApiStateInterface
- Account
- NFT
- NFTDetails
- AlertType
- DefaultTemplateOptions
- ProviderProps
- AlertTimer
- AlertInstance
- AlertOptions
- TemplateAlertOptions
- AlertContainerFactory
- ChainBase
- ChainNetwork
- WalletId
- ProposalType
- ChainEventNotification
- WebsocketMessageNames
- WebsocketNamespaces
- NotificationCategories
- InviteCodeAttributes
- IPostNotificationData
- ChainCategoryType
- Screens
- NavigationProperty
- IP
- Maybe
- Tuple
- ChainProperties
- ApiPromise
- ApiAction
- BlueprintOptions
- ContractQuery
- ContractOptions
- ContractTx
- KeyringPair
- ContractDryRunParams
- InstantiateData
- SubmittableExtrinsic
- DbState
- OnInstantiateSuccess$Code
- OnInstantiateSuccess$Hash
- InstantiateState
- ApiState
- OrFalsy
- Bytes
- AbiParam
- Registry
- Weight
- SubmittableResult
- Hash
- CodeBundleDocument
- MyCodeBundles
- ContractDocument
- MyContracts
- Database
- DbStatistics
- UserDocument
- QueuedTxOptions
- TransactionsState
- DropdownOption
- DropdownProps
- ValidFormField
- SetState
- BN
- CallResult
- ContractPromise
- RegistryError
- Abi
- TypeDef
- Validation
- FileState
- UseWeight
- ArgComponentProps
- TypeDefInfo
- UseMetadata
- AbiMessage
- AbiConstructor
- InstantiateProps
- CodeSubmittableResult
- BlueprintSubmittableResult
- BlueprintPromise
- Step2FormData
- TxOptions
- TransactionsQueue
- Keyring
- DbQuery
- UseBalance
- CodeBundle
- ValidateFn
- MetadataState
- UseStepper
- UseToggle
- Party
- Restaurant
- BoardMember
- Id
- Label
- Priority
- Avatar
- PriorityValue
- AuthSetup
- IColumn
- Board
- ITask
- TaskComment
- NewTaskComment
- WithTheme
- UserDetail
- TasksByColumn
- NewTask
- ValueOf
- APIResponse
- Nullable
- Currency
- Route
- Author
- Post
- Category
- Watch
- ComputeCallback
Other Related APIs
types#CCVPScreens TypeScript Examples
The following examples show how to use
types#CCVPScreens.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CCVPNavigator.tsx From react-native-crypto-wallet-app with MIT License | 5 votes |
CCVPStack = createStackNavigator<CCVPScreens>()
Example #2
Source File: CreateConfirmVerifyPin.tsx From react-native-crypto-wallet-app with MIT License | 4 votes |
CreateConfirmVerifyPin = ({
navigation,
}: StackNavigationProps<CCVPScreens, 'CreateConfirmVerifyPin'>) => {
const [pin, setPin] = useState<string | null>(null);
const [pinEntry, setPinEntry] = useState<string>('');
const [createdPin, setCreatedPin] = useState<string>('');
const [loading, setLoading] = useState<boolean>(false);
const alert = useAlert();
const isLogin = pin !== null;
const isConfirm = createdPin.length === 4;
const checkIfPinExists = useCallback(async () => {
setLoading(true);
try {
const savedPin = await AsyncStorage.getItem('pin');
setPin(savedPin);
} catch (error) {
alert('Error', error);
} finally {
setLoading(false);
}
}, [alert]);
const handleNavigateHome = useCallback(() => {
navigation.replace('Home');
}, [navigation]);
const savePin = useCallback(async () => {
await AsyncStorage.setItem('pin', pinEntry, () => {
handleNavigateHome();
});
setLoading(false);
}, [handleNavigateHome, pinEntry]);
const handleInvalidPin = useCallback(() => {
setLoading(false);
setPinEntry('');
alert('Invalid PIN', 'Please try again.');
}, [alert]);
const handlePinEntry = (v: string) => {
if (!isLogin && !isConfirm) {
setCreatedPin(p => p.concat(v));
} else {
setPinEntry(p => p.concat(v));
}
};
const handlePinEntryFinish = useCallback(() => {
if (pinEntry.length === 4) {
setLoading(true);
if (isLogin) {
if (pinEntry === pin) {
handleNavigateHome();
} else {
handleInvalidPin();
}
} else if (isConfirm) {
if (pinEntry === createdPin) {
savePin();
} else {
handleInvalidPin();
}
} else {
setLoading(false);
}
}
}, [
createdPin,
handleInvalidPin,
handleNavigateHome,
isConfirm,
isLogin,
pin,
pinEntry,
savePin,
]);
return (
<PinLayout
{...{ pinEntry, loading, isLogin, isConfirm }}
onPinChange={handlePinEntry}
onCheckIfPinExists={checkIfPinExists}
onPinEntryFinished={handlePinEntryFinish}
onPinDelete={() => setPinEntry(p => p.slice(1, p.length))}
/>
);
}