@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
36 lines (32 loc) • 817 B
text/typescript
const defaultContainerStyle = {
flex: 1,
width: 429,
};
const heroContainerStyle = {
flex: 1,
width: 1154,
contentInset: { top: 0, left: 0, bottom: 0, right: 0 },
contentOffset: { x: -0, y: 0 },
};
const screenPickerStyle = {
flex: 1,
};
/**
* Returns the matching container style for the component.
* @param {String} component_type
* @return {Object} Style of the component's rendering function container.
*/
export function containerStyleResolver({ component_type }) {
switch (component_type) {
case "label":
throw new Error("Should not resolve container style for label");
case "hero":
return heroContainerStyle;
case "screen_picker":
return screenPickerStyle;
case "grid":
case "horizontal_list":
default:
return defaultContainerStyle;
}
}