@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
22 lines (19 loc) • 815 B
text/typescript
import { Platform } from "react-native";
import { containerStyleResolver as tvResolver } from "./tv";
import { containerStyleResolver as mobileResolver } from "./mobile";
/**
* Returns the matching import according to the device type.
* Currently available types: tv and mobile only.
* IMPORTANT: web OS is treated as tv, since so far the web platform is used
* for HTML5 apps in Samsung & LG.
* ---
* The drill-down into OS separation is done deeper inside the matching imports.
* @param {String} component_type
* @return {Object} resolver for the matching platform
*/
export function containerStyleResolver({ component_type }) {
if (Platform.isTV || ["web", "samsung_tv", "lg_tv"].includes(Platform.OS)) {
return tvResolver({ component_type });
}
return mobileResolver({ component_type });
}