Source

containers/Custom/CourseSingleScreen.ts

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

/**
 * You can use this component to display your Course single screen in your custom screen.
 * @component
 * @example <caption> Use CourseSingleScreen in custom navigation route "book" </caption>
 * //In custom_code/components/MyCustomScreen.js
 *
 * import React from 'react';
 * import { View } from 'react-native';
 * import CourseSingleScreen from "@src/containers/Custom/CourseSingleScreen";
 *
 * const MyCustomScreen = (props) => {
 *    return <View style={{flex: 1, marginBottom: 80}}>
 *        <CourseSingleScreen id={162} />
 *    </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"
 *  );
 * }
 *
 */

const CourseSingleScreen = compose(
	withNavigation,
	withActiveCallBacks
)(CoursesSingleScreen);

export default CourseSingleScreen;

CourseSingleScreen.propTypes = {
	/**
	 * The id of the course to display
	 * {Number}
	 */
	id: PropTypes.number.isRequired
};