UNPKG

react-native-unit-components

Version:

Unit React Native components

19 lines (14 loc) 823 B
import type { UNComponentsWebVersioningStrategy } from '../types/shared'; import { UNComponentsEnvironment } from '../types/shared/env.types'; import { getWebSdkVersionString } from '../utils/webVersioningStrategy.utils'; export const getUnitScriptUrl = (env: UNComponentsEnvironment, webVersioningStrategy: UNComponentsWebVersioningStrategy) => { const webSdkVersionString = getWebSdkVersionString(webVersioningStrategy); switch (env) { case UNComponentsEnvironment.sandbox: return `https://ui.s.unit.sh/release/${webSdkVersionString}/components.js`; case UNComponentsEnvironment.production: return `https://ui.unit.co/release/${webSdkVersionString}/components.js`; case UNComponentsEnvironment.mock: return 'https://unit-white-label-ui.netlify.app/assets/components-mock.js'; } };