UNPKG

react-native-unit-components

Version:

Unit React Native components

31 lines (29 loc) 1.2 kB
import { BottomSheetNativeComponentType, BottomSheetNativePlaceType, BottomSheetRenderingType, NativeComponentRendering, } from '../../types/internal/bottomSheet.types'; import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage'; import { setEvent } from '../../slices/SharedEventsSlice'; import { store } from '../../store/store'; import { UNAddToWalletComponentProps, } from '../../nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent'; export class UNCardFlows { public static startPushProvisioning = async (cardId: string, customerToken: string) => { try { const data: NativeComponentRendering = { type: BottomSheetRenderingType.NativeComponent, data: { nativePlace: BottomSheetNativePlaceType.overFullScreen, component: { type: BottomSheetNativeComponentType.AddToWalletComponent, props: { cardId: cardId, customerToken: customerToken } as UNAddToWalletComponentProps, }, }, }; store.dispatch(setEvent({ key: BottomSheetNativeMessage.REQUEST_RENDERING, data })); } catch (error) { console.error(error); } }; }