Source

containers/Custom/ProductsScreen.ts

import {compose} from "recompose";
import withActiveCallBacks from "../../navigators/react-navigation-addons/withActiveCallBacks";
import {withNavigation} from "../../components/hocs/withNavigation";
import PropTypes from "prop-types";
import Products from "../ProductsScreen";

/**
 * You can use this component to showcase your Products screen in your custom screen.
 *
 * @component
 * @example
 *
 * //In custom_code/MyCustomScreen.js...
 * import React from 'react';
 * import { View } from 'react-native';
 * import ProductsScreen from "@src/containers/Custom/ProductsScreen";
 * const MyCustomScreen = (props) => {
 *
 *  return (
 *    <View style={{ flex: 1 }}>
 *      <ProductsScreen {...props} screenTitle="Available products" productIds={[3,8,6,7]}/>
 *    </View>)
 * }
 *
 *
 * export default MyCustomScreen;
 *
 * //In custom_code/index.js...
 *
 * import MyCustomScreen from "./components/MyCustomScreen";
 * export const applyCustomCode = externalCodeSetup => {
 *
 *  externalCodeSetup.navigationApi.addNavigationRoute(
 *    "book",
 *    "BookScreen",
 *    MyCustomScreen,
 *    "All"
 *  );
 *  externalCodeSetup.navigationApi.addNavigationRoute(
 *    "book",
 *    "BookScreen",
 *    MyCustomScreen,
 *    "Main"
 *  );
 * }
 */

export const ProductsScreen = compose(
	withNavigation,
	withActiveCallBacks
)(Products);

ProductsScreen.propTypes = {
	/**
	 * Define which in-app products will be shown.
	 * {Array}
	 */
	productIds: PropTypes.array,
	/**
	 * List screen title. Default comes from translation files in BuddyBoss site
	 * {String}
	 */
	screenTitle: PropTypes.string,
	/**
	 * Use `true` to hide the screen title container
	 * {Boolean}
	 */
	hideNavigationHeader: PropTypes.bool
};

export default ProductsScreen;