Source

containers/Custom/Profile/ProfilePhotosScreen.ts

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

/**
 * You can use this component to display the Profile Photos Screen in your custom screen.
 * @component
 * @example <caption> Display own profile photos </caption>
 * //In custom_code/components/MyCustomScreen.js...
 * import React from 'react';
 * import ProfilePhotosScreen from '@src/containers/Custom/Profile/ProfilePhotosScreen';
 * const MyCustomScreen = (props) => {
 *
 *  if (!props.isFocused)
 *    return null;
 *
 *  return <ProfilePhotosScreen
 *
 *    hidePhotoBackButton={true}
 *    hideSelectButton={true}
 *    hideNewPhotoButton={true}
 *    // hidePhotoNavigationHeader={true}
 *    hideAlbumBackButton={true}
 *    hideNewAlbumButton={true}
 *    // hideAlbumNavigationHeader={true}
 *
 *    {...props}
 *  />
 *
 * }
 *
 *
 * 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 ProfilePhotosScreen = compose(
	withNavigation,
	withActiveCallBacks
)(ProfilePhotos);

export default withLoadProfile(ProfilePhotosScreen);

ProfilePhotosScreen.propTypes = {
	/**
	 * You can use this to display a specific user's profile photos by assigning their userId as this props's value
	 * {Number}
	 */
	userId: PropTypes.number,
	/**
	 * List screen title
	 * {String}
	 */
	screenTitle: PropTypes.string,
	/**
	 * If the user is not yet available in the app state, the component will attempt to load a list of users.
	 * You can use this field to search for the specific user you want to load instead of loading a list of users.
	 * {String}
	 */
	searchTerm: PropTypes.string,
	/**
	 * Use `true` to hide the back button in the photos screen.
	 * {Boolean}
	 */
	hidePhotoBackButton: PropTypes.bool,
	/**
	 * Use `true` to hide the select button in the photos screen.
	 * {Boolean}
	 */
	hideSelectButton: PropTypes.bool,
	/**
	 * Use `true` to hide the new photo button in the photos screen.
	 * {Boolean}
	 */
	hideNewPhotoButton: PropTypes.bool,
	/**
	 * Use `true` to hide the screen title container in the photos screen.
	 * {Boolean}
	 */
	hidePhotoNavigationHeader: PropTypes.bool,
	/**
	 * Use `true` to hide the back button in the albums screen.
	 * {Boolean}
	 */
	hideAlbumBackButton: PropTypes.bool,
	/**
	 * Use `true` to hide the new photo button in the albums screen.
	 * {Boolean}
	 */
	hideNewAlbumButton: PropTypes.bool,
	/**
	 * Use `true` to hide the screen title container in the albums screen.
	 * {Boolean}
	 */
	hideAlbumNavigationHeader: PropTypes.bool,
	/**
	 * Use this to display your own loading component while the screen is loading
	 * {ReactComponent}
	 */
	LoadingComponent: PropTypes.elementType
};