react-native-unit-components
Version:
Unit React Native components
30 lines (28 loc) • 1.12 kB
text/typescript
import {
BottomSheetNativeComponentType, BottomSheetNativePlaceType,
BottomSheetRenderingType, NativeComponentRendering,
} from '../../types/internal/bottomSheet.types';
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
import { eventBus } from '../../utils/eventBus';
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,
},
},
};
eventBus.emit(BottomSheetNativeMessage.REQUEST_RENDERING, data);
} catch (error) {
console.error(error);
}
};
}