import {compose, mapProps} from "recompose";
import ManageScreen from "../../ManageGroup/ManageScreen";
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";
const buildProps = props => ({
useLoadGroupTabs: true,
...props
});
/**
* You can use this component to display Groups Manage Screen in your custom screen.
* @component
* @example
* //In custom_code/components/MyCustomScreen.js...
*
* import React from 'react';
* import GroupManageScreen from "@src/containers/Custom/Group/GroupManageScreen";
* const MyCustomScreen = (props) => (
* <GroupManageScreen {...props}
* groupId={9}
* screenTitle="Manage Group"
* // hideNavigationHeader={true}
* hideBackButton={true}
* />
* )
*
*
* 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 GroupManageScreen = compose(
mapProps(buildProps),
withNavigation,
withActiveCallBacks,
withLoadGroup
)(ManageScreen);
export default GroupManageScreen;
GroupManageScreen.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 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 this to display your own loading component while the screen is loading
* {ReactComponent}
*/
LoadingComponent: PropTypes.elementType
};
Source