Source

containers/Custom/PageScreen.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 {EnhancedPageScreen} from "../../containers/PageScreen";

/**
 * You can use this component to show the PageScreen screen in your custom screen.
 * @component
 * @example <caption> Replace native screens with the in-app browser using the PageScreen component </caption>
 *
 * //In custom_code/components/MyCustomScreen.js...
 *
 * import React from "react";
 * import {View} from "react-native";
 *
 * import PageScreen from "@src/containers/Custom/PageScreen";
 *
 * const MyCustomScreen = props => {
 *
 *     const link = "https://www.buddyboss.com";
 *     const label = "BuddyBoss"
 *
 *     return (
 *         <View style={{flex: 1}}>
 *             <PageScreen url={link} openExternal={false} label={label}/>
 *         </View>
 *     );
 * };
 *
 * export default MyCustomScreen;
 *
 * //In custom_code/index.js...
 *
 * ...
 *
 * import MyCustomScreen from "./components/MyCustomScreen";
 *
 * export const applyCustomCode = externalCodeSetup => {
 *   externalCodeSetup.navigationApi.replaceScreenComponent("GroupsSingleScreen", MyCustomScreen);
 * }
 */
const PageScreen = compose(
	withNavigation,
	withActiveCallBacks
)(EnhancedPageScreen);

PageScreen.propTypes = {
	/**
	 * Url to open
	 * {String}
	 */
	url: PropTypes.string,
	/**
	 * Title of PageScreen
	 * {String}
	 */
	label: PropTypes.string
};

export default PageScreen;