@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
20 lines (14 loc) • 486 B
text/typescript
import * as R from "ramda";
import { cellStyles } from "./index";
type Props = {
cellStyle: string | null | undefined;
componentType: string | null | undefined;
};
export function cellStylesResolver({ cellStyle, componentType }: Props) {
const componentCellStyles =
R.prop(componentType, cellStyles) || cellStyles.default;
const result =
R.prop(cellStyle || "fallbackCellStyle", componentCellStyles) ||
componentCellStyles.fallbackCellStyle;
return result;
}