repo stringclasses 4
values | file_path stringlengths 6 193 | extension stringclasses 30
values | content stringlengths 0 5.21M | token_count int64 0 3.8M |
|---|---|---|---|---|
hyperswitch-client-core | src/components/common/CustomPicker.res | .res | open ReactNative
open Style
type customPickerType = {
label: string,
value: string,
icon?: string,
}
@react.component
let make = (
~value,
~setValue,
~borderBottomLeftRadius=0.,
~borderBottomRightRadius=0.,
~borderBottomWidth=0.,
~disabled=false,
~placeholderText,
~items: array<customPickerType>... | 1,395 |
hyperswitch-client-core | src/components/common/DynamicFields.res | .res | open ReactNative
open Style
open RequiredFieldsTypes
module RenderField = {
let getStateData = (states, country) => {
states
->Utils.getStateNames(country)
->Array.map((item): CustomPicker.customPickerType => {
{
label: item.label != "" ? item.label ++ " - " ++ item.value : item.value,
... | 4,072 |
hyperswitch-client-core | src/components/common/CustomKeyboardAvoidingView.res | .res | open ReactNative
open Style
@react.component
let make = (~children, ~style, ~keyboardVerticalOffset=48.) => {
let frame = React.useRef(None)
let keyboardEvent = React.useRef(None)
let (bottom, setBottom) = React.useState(() => 0.)
let relativeKeyboardHeight = async (keyboardFrame: Keyboard.screenRect) => {
... | 628 |
hyperswitch-client-core | src/components/common/CustomPressable.res | .res | open ReactNative
@react.component
let make = (
~onPress=?,
~children=?,
~style=?,
~disabled=?,
~accessibilityRole=?,
~accessibilityState=?,
~accessibilityLabel=?,
~testID=?,
~activeOpacity as _=?,
) => {
<Pressable ?onPress children=?{React.useMemo1(_ =>
switch children {
| Some(childre... | 173 |
hyperswitch-client-core | src/components/common/ErrorText.res | .res | @react.component
let make = (~text=None) => {
switch text {
| None => React.null
| Some(val) =>
val == ""
? React.null
: <>
<TextWrapper textType={ErrorText}> {val->React.string} </TextWrapper>
</>
}
}
| 67 |
hyperswitch-client-core | src/components/common/CustomTabView.res | .res | open ReactNative
open Style
@react.component
let make = (
~hocComponentArr: array<PMListModifier.hoc>=[],
~loading=true,
~setConfirmButtonDataRef,
) => {
let (indexInFocus, setIndexInFocus) = React.useState(_ => 0)
let setIndexInFocus = React.useCallback1(ind => setIndexInFocus(_ => ind), [setIndexInFocus])
... | 577 |
hyperswitch-client-core | src/components/common/TopTabScreenWraper.res | .res | open ReactNative
open Style
@react.component
let make = (~children, ~setDynamicHeight, ~isScreenFocus) => {
let (viewHeight, setViewHeight) = React.useState(_ => 100.)
let updateTabHeight = (event: Event.layoutEvent) => {
let {height} = event.nativeEvent.layout
if height > 100. && (viewHeight -. height)->M... | 218 |
hyperswitch-client-core | src/components/common/TabView.res | .res | open ReactNative
open Style
type isRTL = {isRTL: bool}
type i18nManager = {getConstants: unit => isRTL}
@val @scope("ReactNative") external i18nManager: i18nManager = "I18nManager"
type initialLayout = {
height?: float,
width?: float,
}
@live
type state = {navigationState: TabViewType.navigationState}
@react.com... | 867 |
hyperswitch-client-core | src/components/common/TouchableOpacity/TouchableOpacityImpl.native.res | .res | type props = ReactNative.TouchableOpacity.props
let make = ReactNative.TouchableOpacity.make
| 18 |
hyperswitch-client-core | src/components/common/TouchableOpacity/TouchableOpacityImpl.web.res | .res | let make = CustomPressable.make
| 8 |
hyperswitch-client-core | src/components/common/TouchableOpacity/CustomTouchableOpacity.res | .res | @module("./TouchableOpacityImpl")
external make: React.component<ReactNative.TouchableOpacity.props> = "make"
| 22 |
hyperswitch-client-core | src/components/common/Tooltip/TooltipTypes.res | .res | type positionX = Left(float) | Right(float)
type positionY = Top(float) | Bottom(float)
type tooltipPosition = {
x: positionX,
y: positionY,
}
| 40 |
hyperswitch-client-core | src/components/common/Tooltip/Tooltip.res | .res | open ReactNative
open Style
@react.component
let make = (
~children: React.element,
~renderContent: (_ => unit) => React.element,
~maxHeight=200.,
~maxWidth=200.,
~adjustment=2.,
~containerStyle=?,
~backgroundColor=?,
~disabled=false,
~keyboardShouldPersistTaps=false,
) => {
let {
component,
... | 919 |
hyperswitch-client-core | src/components/common/CustomLoader/CustomLoader.res | .res | type props = {
height?: string,
width?: string,
speed?: float,
radius?: float,
style?: ReactNative.Style.t,
}
@module("./CustomLoaderImpl")
external make: React.component<props> = "make"
| 52 |
hyperswitch-client-core | src/components/common/CustomLoader/CustomLoaderImpl.web.res | .res | module ContentLoaderWeb = {
@module("react-content-loader") @react.component
external make: (
~speed: float,
~width: string,
~height: string,
~viewBox: string=?,
~backgroundColor: string=?,
~foregroundColor: string=?,
~style: ReactNative.Style.t=?,
~children: React.element,
) => Re... | 335 |
hyperswitch-client-core | src/components/common/CustomLoader/CustomLoaderImpl.native.res | .res | module ContentLoaderNative = {
@module("react-content-loader/native") @react.component
external make: (
~speed: float,
~width: string,
~height: string,
~viewBox: string=?,
~backgroundColor: string=?,
~foregroundColor: string=?,
~style: ReactNative.Style.t=?,
~children: React.element,... | 406 |
hyperswitch-client-core | src/hooks/LightDarkTheme.res | .res | // let useIsDarkMode = () => {
// let (theme, _) = React.useContext(ThemeContext.themeContext)
// theme->Option.getOr(#dark) == #dark
// }
open ReactNative
let useIsDarkMode = () => {
switch Appearance.useColorScheme()->Option.getOr(#light) {
| #dark => true
| #light => false
}
}
| 87 |
hyperswitch-client-core | src/hooks/GetLocale.res | .res | let useGetLocalObj = () => {
let (localeStrings, _) = React.useContext(LocaleStringDataContext.localeDataContext)
switch localeStrings {
| Some(data) => data
| _ => LocaleDataType.defaultLocale
}
}
| 51 |
hyperswitch-client-core | src/hooks/SDKLoadCheckHook.res | .res | let useSDKLoadCheck = (~enablePartialLoading=true) => {
let samsungPayValidity = SamsungPay.useSamsungPayValidityHook()
let (localeStrings, _) = React.useContext(LocaleStringDataContext.localeDataContext)
let (canLoad, setCanLoad) = React.useState(_ => false)
let checkIsSDKAbleToLoad = () => {
if enablePar... | 175 |
hyperswitch-client-core | src/hooks/ThemebasedStyle.res | .res | open ReactNative
open Style
type statusColorConfig = {
textColor: ReactNative.Color.t,
backgroundColor: ReactNative.Color.t,
}
type buttonColorConfig = (string, string)
type componentConfig = {
background: ReactNative.Color.t,
borderColor: ReactNative.Color.t,
dividerColor: ReactNative.Color.t,
color: Rea... | 8,945 |
hyperswitch-client-core | src/hooks/BrowserHook.res | .res | type animations = {
startEnter: string,
startExit: string,
endEnter: string,
endExit: string,
}
type properties = {
dismissButtonStyle: string,
preferredBarTintColor: string,
preferredControlTintColor: string,
readerMode: bool,
animated: bool,
modalPresentationStyle: string,
modalTransitionStyle:... | 1,377 |
hyperswitch-client-core | src/hooks/WebButtonHook.res | .res | let usePayButton = () => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
let {
applePayButtonColor,
googlePayButtonColor,
buttonBorderRadius,
} = ThemebasedStyle.useThemeBasedStyle()
let {launchApplePay, launchGPay} = WebKit.useWebKit()
let addApplePay = (~sessionObj... | 849 |
hyperswitch-client-core | src/hooks/CountryStateDataHookTypes.res | .res | type country = {
isoAlpha2: string,
timeZones: array<string>,
value: string,
label: string,
}
type state = {
label: string,
value: string,
code: string,
}
type states = Dict.t<array<state>>
type countries = array<country>
type countryStateData = {
countries: countries,
states: states,
}
let defaultTim... | 111 |
hyperswitch-client-core | src/hooks/NetceteraThreeDsHooks.res | .res | open ExternalThreeDsTypes
open ThreeDsUtils
open SdkStatusMessages
let isInitialisedPromiseRef = ref(None)
let initialisedNetceteraOnce = (~netceteraSDKApiKey, ~sdkEnvironment) => {
switch isInitialisedPromiseRef.contents {
| Some(promiseVal) => promiseVal
| None => {
let promiseVal = Promise.make((resolve... | 3,293 |
hyperswitch-client-core | src/hooks/CommonHooks.res | .res | let fetchApi = (
~uri,
~bodyStr: string="",
~headers,
~method_: Fetch.requestMethod,
~mode: option<Fetch.requestMode>=?,
~dontUseDefaultHeader=false,
(),
) => {
if !dontUseDefaultHeader {
Dict.set(headers, "Content-Type", "application/json")
Dict.set(headers, "X-Client-Platform", WebKit.platform... | 242 |
hyperswitch-client-core | src/hooks/S3ApiHook.res | .res | open CountryStateDataHookTypes
let decodeCountryArray: array<Js.Json.t> => array<country> = data => {
data->Array.map(item => {
switch item->Js.Json.decodeObject {
| Some(res) => {
isoAlpha2: Utils.getString(res, "isoAlpha2", ""),
timeZones: Utils.getStrArray(res, "timeZones"),
value:... | 2,552 |
hyperswitch-client-core | src/hooks/LoggerHook.res | .res | open LoggerTypes
open LoggerUtils
let useCalculateLatency = () => {
let (events, _setEvents) = React.useContext(LoggerContext.loggingContext)
eventName => {
let currentTimestamp = Date.now()
let isRequest = eventName->String.includes("_INIT")
let latency = switch eventName {
| "PAYMENT_ATTEMPT" => ... | 1,512 |
hyperswitch-client-core | src/hooks/FontFamily.res | .res | let convertFontToGoogleFontURL = fontName => {
let normalizedFontName =
fontName
->String.splitByRegExp("/[_\s]+/"->RegExp.fromString)
->Array.map(word =>
switch word {
| Some(word) =>
word->String.charAt(0)->String.toUpperCase ++
word->String.slice(~start=1, ~end=word->Strin... | 270 |
hyperswitch-client-core | src/hooks/SamsungPay.res | .res | open SamsungPayType
type samsungPayWalletValidity = Checking | Valid | Invalid | Not_Started
let val = ref(Not_Started)
let isSamsungPayValid = state => {
state != Checking && state != Not_Started
}
let useSamsungPayValidityHook = () => {
let (state, setState) = React.useState(_ => val.contents)
let isSamsungP... | 737 |
hyperswitch-client-core | src/hooks/WindowDimension.res | .res | type mediaView = Mobile | Tablet | Desktop
let useMediaView = () => {
let {width} = ReactNative.Dimensions.useWindowDimensions()
() => {
if width < 441.0 {
Mobile
} else if width < 830.0 {
Tablet
} else {
Desktop
}
}
}
let useIsMobileView = () => {
useMediaView()() == Mobile
... | 98 |
hyperswitch-client-core | src/hooks/PMListModifier.res | .res | type hoc = {
name: string,
componentHoc: (
~isScreenFocus: bool,
~setConfirmButtonDataRef: React.element => unit,
) => React.element,
}
type walletProp = {
walletType: PaymentMethodListType.payment_method_types_wallet,
sessionObject: SessionsType.sessions,
}
type paymentList = {
tabArr: array<hoc>... | 3,043 |
hyperswitch-client-core | src/hooks/AlertHook.res | .res | open ReactNative
@val external alert: string => unit = "alert"
let useAlerts = () => {
let handleSuccessFailure = AllPaymentHooks.useHandleSuccessFailure()
(
// let exitRN = HyperModule.useExitRN()
~errorType: string,
~message,
) => {
let apiResStatus: PaymentConfirmTypes.error = {
type_: ... | 188 |
hyperswitch-client-core | src/hooks/WebKit.res | .res | type platformType = [#ios | #iosWebView | #android | #androidWebView | #web | #next]
let (platform, platformString) = if Next.getNextEnv == "next" {
(#next, "next")
} else if ReactNative.Platform.os === #android {
(#android, "android")
} else if ReactNative.Platform.os === #ios {
(#ios, "ios")
} else if Window.w... | 630 |
hyperswitch-client-core | src/hooks/AllPaymentHooks.res | .res | open PaymentConfirmTypes
type apiLogType = Request | Response | NoResponse | Err
let useApiLogWrapper = () => {
let logger = LoggerHook.useLoggerHook()
(
~logType,
~eventName,
~url,
~statusCode,
~apiLogType,
~data,
~paymentMethod=?,
~paymentExperience=?,
(),
) => {
let (_... | 6,268 |
hyperswitch-client-core | src/hooks/PlaidHelperHook.res | .res | open PaymentConfirmTypes
open LoadingContext
let usePlaidProps = () => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
let getOpenProps = (
retrievePayment: (Types.retrieve, string, string, ~isForceSync: bool=?) => promise<Js.Json.t>,
responseCallback: (~paymentStatus: sdkPay... | 516 |
hyperswitch-client-core | src/hooks/AnimatedValue.res | .res | open ReactNative
let useAnimatedValue = (initialValue: float) => {
let lazyRef = React.useRef(None)
if lazyRef.current === None {
lazyRef.current = Some(Animated.Value.create(initialValue))
}
switch lazyRef.current {
| Some(val) => val
| None => Animated.Value.create(initialValue)
}
}
| 77 |
hyperswitch-client-core | src/hooks/ShadowHook/ShadowHookImpl.web.res | .res | let useGetShadowStyle = (~shadowIntensity, ~shadowColor="black", ()) => {
let shadowOffsetHeight = shadowIntensity->Float.toString
let shadowOpacity = 0.2->Float.toString
let shadowOffsetWidth = 0.->Float.toString
let processedColor = ReactNative.Color.processColor(shadowColor)->Int.fromString->Option.getOr(0)... | 189 |
hyperswitch-client-core | src/hooks/ShadowHook/ShadowHookImpl.ios.res | .res | let useGetShadowStyle = (~shadowIntensity, ~shadowColor="black", ()) => {
let shadowOffsetHeight = shadowIntensity
let shadowRadius = shadowIntensity
let shadowOpacity = 0.2
let shadowOffsetWidth = 0.
ReactNative.Style.viewStyle(
~shadowRadius,
~shadowOpacity,
~shadowOffset={
ReactNative.Sty... | 111 |
hyperswitch-client-core | src/hooks/ShadowHook/ShadowHookImpl.android.res | .res | let useGetShadowStyle = (~shadowIntensity, ()) => {
ReactNative.Style.viewStyle(~elevation=shadowIntensity, ())
}
| 28 |
hyperswitch-client-core | src/hooks/ShadowHook/ShadowHook.res | .res | @module("./ShadowHookImpl")
external useGetShadowStyle: (
~shadowIntensity: float,
~shadowColor: ReactNative.Color.t=?,
unit,
) => ReactNative.Style.t = "useGetShadowStyle"
| 48 |
hyperswitch-client-core | src/hooks/BackHandlerHook/BackHandlerHookImpl.web.res | .res | let useBackHandler = () => ()
| 8 |
hyperswitch-client-core | src/hooks/BackHandlerHook/BackHandlerHookImpl.native.res | .res | let useBackHandler = (~loading: LoadingContext.sdkPaymentState, ~sdkState: SdkTypes.sdkState) => {
let handleSuccessFailure = AllPaymentHooks.useHandleSuccessFailure()
React.useEffect2(() => {
let backHandler = ReactNative.BackHandler.addEventListener(#hardwareBackPress, () => {
switch loading {
| ... | 164 |
hyperswitch-client-core | src/hooks/BackHandlerHook/BackHandlerHook.res | .res | @module("./BackHandlerHookImpl")
external useBackHandler: (
~loading: LoadingContext.sdkPaymentState,
~sdkState: SdkTypes.sdkState,
) => unit = "useBackHandler"
| 44 |
hyperswitch-client-core | src/pages/hostedCheckout/HostedCheckoutSdk.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let (confirmButtonDataRef, setConfirmButtonDataRef) = React.useState(_ => React.null)
let setConfirmButtonDataRef = React.useCallback1(confirmButtonDataRef => {
setConfirmButtonDataRef(_ => confirmButtonDataRef)
}, [setConfirmButtonDataRef])
l... | 215 |
hyperswitch-client-core | src/pages/hostedCheckout/HostedCheckout.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let {bgColor} = ThemebasedStyle.useThemeBasedStyle()
let useMediaView = WindowDimension.useMediaView()
let isMobileView = WindowDimension.useIsMobileView()
let parentViewStyle = switch useMediaView() {
| Mobile => viewStyle()
| _ => viewStyle(... | 448 |
hyperswitch-client-core | src/pages/hostedCheckout/CheckoutView.res | .res | open ReactNative
open Style
module TermsView = {
@react.component
let make = () => {
<View style={viewStyle(~flexDirection=#row, ~width=100.->pct, ())}>
<TextWrapper text="Powerd by Hyperswitch" textType={ModalText} />
<Space />
<TextWrapper text="|" textType={ModalText} />
<Space />
... | 1,912 |
hyperswitch-client-core | src/pages/hostedCheckout/CheckoutDetails.res | .res | open ReactNative
open Style
@react.component
let make = (~toggleModal) => {
let isMobileView = WindowDimension.useIsMobileView()
<View style={viewStyle(~alignItems={isMobileView ? #center : #"flex-start"}, ())}>
{isMobileView
? <ReImage
style={viewStyle(~width=120.->dp, ~height=120.->dp, ~borde... | 325 |
hyperswitch-client-core | src/pages/paymentMethodsManagement/PaymentMethodListItem.res | .res | open ReactNative
open Style
module AddPaymentMethodButton = {
@react.component
let make = () => {
let {component} = ThemebasedStyle.useThemeBasedStyle()
let localeObject = GetLocale.useGetLocalObj()
<CustomTouchableOpacity
onPress={_ => (
HyperModule.hyperModule.onAddPaymentMethod("")
... | 943 |
hyperswitch-client-core | src/pages/paymentMethodsManagement/PaymentMethodsManagement.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let {component} = ThemebasedStyle.useThemeBasedStyle()
let deletePaymentMethod = AllPaymentHooks.useDeleteSavedPaymentMethod()
let showAlert = AlertHook.useAlerts()
let logger = LoggerHook.useLoggerHook()
let (allApiData, setAllApiData) = React.... | 978 |
hyperswitch-client-core | src/pages/payment/SavedPaymentScreenChild.res | .res | open ReactNative
open ReactNative.Style
@react.component
let make = (
~savedPaymentMethodsData,
~isSaveCardCheckboxSelected,
~setSaveCardChecboxSelected,
~showSavePMCheckbox,
~merchantName,
~savedCardCvv,
~setSavedCardCvv,
~setIsCvcValid,
) => {
let {borderRadius, component, shadowColor, shadowIntens... | 454 |
hyperswitch-client-core | src/pages/payment/WalletView.res | .res | open ReactNative
open Style
module WalletDisclaimer = {
@react.component
let make = () => {
let localeObject = GetLocale.useGetLocalObj()
<>
<Space height=10. />
<View
style={viewStyle(
~display=#flex,
~justifyContent=#center,
~alignContent=#center,
... | 309 |
hyperswitch-client-core | src/pages/payment/CardParent.res | .res | @react.component
let make = (
~cardVal: PaymentMethodListType.payment_method_types_card,
~isScreenFocus,
~setConfirmButtonDataRef,
) => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
<ErrorBoundary level={FallBackScreen.Screen} rootTag=nativeProp.rootTag>
<Card cardVal isSc... | 97 |
hyperswitch-client-core | src/pages/payment/Card.res | .res | open ReactNative
open PaymentMethodListType
@react.component
let make = (
~cardVal: PaymentMethodListType.payment_method_types_card,
~isScreenFocus,
~setConfirmButtonDataRef: React.element => unit,
) => {
// Custom Hooks
let localeObject = GetLocale.useGetLocalObj()
let handleSuccessFailure = AllPaymentHoo... | 1,663 |
hyperswitch-client-core | src/pages/payment/ClickableTextElement.res | .res | open ReactNative
open Style
@react.component
let make = (
~initialIconName,
~updateIconName=None,
~text,
~isSelected,
~setIsSelected,
~textType,
~fillIcon=true,
~disabled=false,
~disableScreenSwitch=false,
) => {
let (isSavedCardScreen, setSaveCardScreen) = React.useContext(
PaymentScreenContex... | 264 |
hyperswitch-client-core | src/pages/payment/ConfirmButtonAnimation.res | .res | open ReactNative
open Style
@react.component
let make = (
~isAllValuesValid,
~handlePress,
~hasSomeFields=true,
~paymentMethod,
~paymentExperience=?,
~displayText="Pay Now",
(),
) => {
let localeObject = GetLocale.useGetLocalObj()
let (loading, _) = React.useContext(LoadingContext.loadingContext)
l... | 501 |
hyperswitch-client-core | src/pages/payment/NickNameElement.res | .res | @react.component
let make = (~nickname, ~setNickname, ~setIsNicknameValid) => {
let {component, borderWidth, borderRadius, dangerColor} = ThemebasedStyle.useThemeBasedStyle()
let localeObject = GetLocale.useGetLocalObj()
let (isFocus, setisFocus) = React.useState(_ => false)
let (errorMessage, setErrorMesage) =... | 487 |
hyperswitch-client-core | src/pages/payment/PaymentSheet.res | .res | @react.component
let make = (~setConfirmButtonDataRef) => {
let (nativeProp, _) = React.useContext(NativePropContext.nativePropContext)
let (_, setPaymentScreenType) = React.useContext(PaymentScreenContext.paymentScreenTypeContext)
//getting payment list data here
let {tabArr, elementArr} = PMListModifier.useL... | 452 |
hyperswitch-client-core | src/pages/payment/SavedPMListWithLoader.res | .res | open ReactNative
open Style
module LoadingListItem = {
@react.component
let make = () => {
<View style={viewStyle(~display=#flex, ~flexDirection=#row, ~alignItems=#center, ())}>
<View style={viewStyle(~marginRight=10.->dp, ())}>
<CustomLoader width="30" height="25" />
</View>
// <View... | 876 |
hyperswitch-client-core | src/pages/payment/SaveCardsList.res | .res | open ReactNative
open Style
module CVVComponent = {
@react.component
let make = (~savedCardCvv, ~setSavedCardCvv, ~isPaymentMethodSelected, ~cardScheme) => {
let {component, dangerColor} = ThemebasedStyle.useThemeBasedStyle()
React.useEffect1(() => {
setSavedCardCvv(_ => None)
None
}, [isP... | 2,276 |
hyperswitch-client-core | src/pages/payment/SavedPaymentScreen.res | .res | open ReactNative
@react.component
let make = (
~setConfirmButtonDataRef,
~savedPaymentMethordContextObj: AllApiDataContext.savedPaymentMethodDataObj,
) => {
let (_, setPaymentScreenType) = React.useContext(PaymentScreenContext.paymentScreenTypeContext)
let (nativeProp, _) = React.useContext(NativePropContext.n... | 4,170 |
hyperswitch-client-core | src/pages/payment/Redirect.res | .res | open ReactNative
open PaymentMethodListType
open CustomPicker
open RequiredFieldsTypes
type klarnaSessionCheck = {
isKlarna: bool,
session_token: string,
}
@react.component
let make = (
~redirectProp: payment_method,
~fields: Types.redirectTypeJson,
~isScreenFocus,
~isDynamicFields: bool=false,
~dynamic... | 8,171 |
hyperswitch-client-core | src/pages/widgets/ExpressCheckoutWidget.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let handleSuccessFailure = AllPaymentHooks.useHandleSuccessFailure()
React.useEffect0(() => {
let nee = NativeEventEmitter.make(
Dict.get(ReactNative.NativeModules.nativeModules, "HyperModule"),
)
let event = NativeEventEmitter.addL... | 382 |
hyperswitch-client-core | src/pages/widgets/CustomWidget.res | .res | open ReactNative
open Style
module WidgetError = {
@react.component
let make = () => {
Exn.raiseError("Payment Method not available")->ignore
React.null
}
}
@react.component
let make = (~walletType) => {
let (nativeProp, setNativeProp) = React.useContext(NativePropContext.nativePropContext)
let (_, ... | 594 |
hyperswitch-client-core | src/pages/widgets/CardWidget.res | .res | open ReactNative
open Style
@react.component
let make = () => {
let (cardData, _) = React.useContext(CardDataContext.cardDataContext)
let {cardNumber, expireDate, cvv, zip} = cardData
let (_, setLoading) = React.useContext(LoadingContext.loadingContext)
let (reset, setReset) = React.useState(_ => false)
let... | 1,158 |
hyperswitch-client-core | reactNativeWeb/tsconfig.json | .json | {
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"module": "esnext",
"esModuleInterop": true,
"moduleResolution": "node",
"resolveJsonModule": tr... | 150 |
hyperswitch-client-core | reactNativeWeb/version.json | .json | {
"version": "1.0.7"
} | 13 |
hyperswitch-client-core | reactNativeWeb/WebApp.res | .res | @react.component
let app = (~props) => {
let (propFromEvent, setPropFromEvent) = React.useState(() => None)
let {sdkInitialised} = WebKit.useWebKit()
Window.useEventListener()
React.useEffect0(() => {
let handleMessage = jsonData => {
try {
switch jsonData->Dict.get("props") {
| Some(... | 229 |
hyperswitch-client-core | reactNativeWeb/webpack.config.js | .js | const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
require('dotenv').config({path: './.env'});
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const appDir... | 958 |
hyperswitch-client-core | reactNativeWeb/index.web.js | .js | import {AppRegistry} from 'react-native';
import {name as appName} from '../app.json';
import {app} from './WebApp.bs.js';
AppRegistry.registerComponent(appName, () => app);
const initReactNativeWeb = async () => {
AppRegistry.runApplication(appName, {
initialProps: {},
rootTag: document.getElementById('app... | 85 |
hyperswitch-client-core | reactNativeWeb/next.config.js | .js | /** @type {import('next').NextConfig} */
const bsconfig = require('../rescript.json');
let transpileModules = [
// Add every react-native package that needs compiling
// 'react-native-linear-gradient',
'react-native-klarna-inapp-sdk',
'react-native-inappbrowser-reborn',
// 'react-native-hyperswitc... | 642 |
hyperswitch-client-core | reactNativeWeb/index.html | .html | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>HyperSwitch Web</title>
<style>
#app-root {
... | 162 |
hyperswitch-client-core | reactNativeWeb/babel.config.js | .js | module.exports = {
presets: [
[
'module:@react-native/babel-preset',
{ useTransformReactJSXExperimental: true },
],
"next/babel"
],
plugins: [
['react-native-web'],
['@babel/plugin-transform-flow-strip-types'],
['module:react-native-dotenv'],
['@babel/plugin-transform-react... | 191 |
hyperswitch-client-core | reactNativeWeb/DemoApp/DemoAppIndex.html | .html | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>HyperSwitch Web</title>
<style>
body {
margi... | 218 |
hyperswitch-client-core | reactNativeWeb/DemoApp/webpack.config.js | .js | const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const appDirectory = path.resolve(__dirname);
module.exports = {
entry: {
app: path.join(__dirname, 'DemoAppIndex.js'),
},
output: {
path: path.resolve(appDirectory, 'dist'),
pu... | 199 |
hyperswitch-client-core | reactNativeWeb/DemoApp/DemoAppIndex.js | .js | let defaultProps = {
local: false,
configuration: {
paymentSheetHeaderLabel: 'Add a payment method',
savedPaymentSheetHeaderLabel: 'Saved payment method',
allowsDelayedPaymentMethods: true,
merchantDisplayName: 'Example, Inc.',
// disableSavedCardScreen: true,
// paymentSheetHeaderText: 'Hel... | 839 |
hyperswitch-client-core | reactNativeWeb/pages/index.tsx | .tsx | import { useEffect, useState } from 'react';
import Head from 'next/head'
import App from '../../App'
export default function Home() {
const [initialProps, setProps] = useState({
clientSecret: ''
});
let fetchProps = async () => {
let props = {
local: true,
configuration: {
allowsDe... | 344 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.