Source

containers/Custom/Group/GroupMembersScreen.ts

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

/**
 * You can use this component to display Groups Members Screen in your custom screen.
 * @component
 * @example
 * //In custom_code/components/MyCustomScreen.js...
 *
 *
 * import React from 'react';
 * import { View, Text } from 'react-native';
 * import GroupMembersScreen from "@src/containers/Custom/Group/GroupMembersScreen";
 *
 * const MyCustomScreen = (props) => (
 *    <GroupMembersScreen {...props}
 *        groupId={7}
 *        screenTitle="Hello World"
 *        hideNavigationHeader={true}
 *        headerHeight={0}
 *        hideBackButton={true}
 *        LoadingComponent={
 *            <View style={{ flex: 1, alignSelf: "center", justifyContent: "center" }}>
 *                <Text>Loading, please wait...</Text>
 *            </View>
 *        } />
 * )
 *
 * MyCustomScreen.navigationOptions = {
 *    header: null
 * }
 *
 * 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 GroupMembersScreen = compose(
	withNavigation,
	withActiveCallBacks
)(GroupMembers);

export default withLoadGroup(GroupMembersScreen);

GroupMembersScreen.propTypes = {
	/**
	 * Id of group to display
	 * {Number}
	 */
	groupId: PropTypes.number,
	/**
	 * If the group is not yet available in the app state, the component will attempt to load a list of groups.
	 * You can use this field to search for the specific group you want to load instead of loading a list of groups.
	 * {String}
	 */
	searchTerm: PropTypes.string,
	/**
	 * Define header height
	 * {Number}
	 */
	headerHeight: PropTypes.number,
	/**
	 * Use `true` to hide the back button
	 * {Boolean}
	 */
	hideBackButton: PropTypes.bool,
	/**
	 * Use `true` to hide the screen title container
	 * {Boolean}
	 */
	hideNavigationHeader: PropTypes.bool,
	/**
	 * List screen title
	 * {String}
	 */
	screenTitle: PropTypes.string,
	/**
	 * Use `false` to hide search box
	 * {Boolean}
	 */
	showSearch: PropTypes.bool,
	/**
	 * Use this to display your own loading component while the screen is loading
	 * {ReactComponent}
	 */
	LoadingComponent: PropTypes.elementType
};