UNPKG

@applicaster/zapp-react-native-ui-components

Version:

Applicaster Zapp React Native ui components for the Quick Brick App

41 lines (33 loc) 1.33 kB
import * as R from "ramda"; import { connectToStore } from "@applicaster/zapp-react-native-redux/utils/connectToStore"; import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils"; import { HorizontalScrollContext, RiverOffsetContext, ScreenScrollingContext, } from "../../Contexts"; import { CellComponent } from "./Cell"; import { TvOSCellComponent } from "./TvOSCellComponent"; import { withConsumer } from "../../Contexts/HeaderOffsetContext"; import { ScreenLayoutContextConsumer } from "../../Contexts/ScreenLayoutContext"; import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext"; import { withComponentsMapOffsetContextConsumer } from "../../Contexts/ComponentsMapOffsetContext"; // TODO | Gallery QB | Extract this export const ScrollInterceptorContext = createContext( { shouldUpdate: true }, (_) => _ ); const Component = platformSelect({ tvos: TvOSCellComponent, default: CellComponent, }); export const Cell = R.compose( connectToStore(R.pick(["remoteConfigurations", "appData"])), ScrollInterceptorContext.withConsumer, ScreenScrollingContext.withConsumer, RiverOffsetContext.withConsumer, HorizontalScrollContext.withConsumer, withConsumer, ScreenLayoutContextConsumer, withComponentsMapOffsetContextConsumer )(Component);