@applicaster/zapp-react-native-ui-components
Version:
Applicaster Zapp React Native ui components for the Quick Brick App
35 lines (28 loc) • 1.22 kB
JavaScript
import * as R from "ramda";
import { connectToStore } from "@applicaster/zapp-react-native-redux";
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
import { HorizontalScrollContext, RiverOffsetContext } from "../../Contexts";
import { CellComponent } from "./Cell";
import { TvOSCellComponent } from "./TvOSCellComponent";
import { withConsumer } from "../../Contexts/HeaderOffsetContext";
import { ScreenScrollingContext } from "../../Contexts/ScreenScrollingContext";
import { ScreenLayoutContextConsumer } from "../../Contexts/ScreenLayoutContext";
import { createContext } from "@applicaster/zapp-react-native-utils/reactUtils/createContext";
// 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
)(Component);