Source

containers/Custom/Group/GroupPhotosScreen.ts

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

/**
 * You can use this component to display Groups Photos Screen in your custom screen.
 * @component
 * @example
 * //In custom_code/components/MyCustomScreen.js...
 *
 * import React from 'react';
 * import { View, Text } from 'react-native';
 * import GroupPhotosScreen from "@src/containers/Custom/Group/GroupPhotosScreen";
 * const MyCustomScreen = (props) => {
 *
 *     const groupId = 6;
 *
 *     return <>
 *         <GroupPhotosScreen {...props}
 *             groupId={groupId}
 *             screenTitle="Group Photos"
 *             hidePhotoBackButton={true}
 *             hideSelectButton={true}
 *             hideNewPhotoButton={false}
 *             hideAlbumBackButton={true}
 *             hideNewAlbumButton={true}
 *             // hideAlbumNavigationHeader={true}
 *             // hidePhotoNavigationHeader={true}
 *             LoadingComponent={<View style={{ flex: 1, alignSelf: "center", justifyContent: "center" }}>
 *                 <Text>Loading, please wait...</Text>
 *             </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 GroupPhotosScreen = compose(
	withNavigation,
	withActiveCallBacks
)(GroupPhotos);

export default withLoadGroup(GroupPhotosScreen);

GroupPhotosScreen.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,
	/**
	 * Use `true` to hide the new photo button in the photos screen.
	 * {Boolean}
	 */
	hideNewPhotoButton: PropTypes.bool,
	/**
	 * Use `true` to hide the back button in the photos screen.
	 * {Boolean}
	 */
	hidePhotoBackButton: PropTypes.bool,
	/**
	 * Use `true` to hide the screen title container in the photos screen.
	 * {Boolean}
	 */
	hidePhotoNavigationHeader: PropTypes.bool,
	/**
	 * Use `true` to hide the select button in the photos screen.
	 * {Boolean}
	 */
	hideSelectButton: PropTypes.bool,
	/**
	 * Use `true` to hide the back button in the albums screen.
	 * {Boolean}
	 */
	hideAlbumBackButton: PropTypes.bool,
	/**
	 * Use `true` to hide the screen title container in the albums screen.
	 * {Boolean}
	 */
	hideAlbumNavigationHeader: PropTypes.bool,
	/**
	 * Use `true` to hide the new photo button in the albums screen.
	 * {Boolean}
	 */
	hideNewAlbumButton: PropTypes.bool,
	/**
	 * List screen title
	 * {String}
	 */
	screenTitle: PropTypes.string,
	/**
	 * Use this to display your own loading component while the screen is loading
	 * {ReactComponent}
	 */
	LoadingComponent: PropTypes.elementType
};