import {compose} from "recompose";
import MessagesCreatePostScreen from "../MessagesCreatePostScreen";
import PropTypes from "prop-types";
import withActiveCallBacks from "../../navigators/react-navigation-addons/withActiveCallBacks";
import {withNavigation} from "../../components/hocs/withNavigation";
import withLoadMessageThread from "../../components/hocs/withLoadMessageThread";
/**
* You can use this component to display your Groups Single Screen in your custom screen.
* @component
* @example
* //In custom_code/components/MyCustomScreen.js...
*
* import React from 'react';
* import { View } from 'react-native';
* import MessagesSingleScreen from "@src/containers/Custom/MessagesSingleScreen";
*
* const MyCustomScreen = (props) => {
* return <View style={{flex: 1, paddingBottom: 80}}>
* <MessagesSingleScreen {...props} messageThreadId={4} />
* </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 MessagesSingleScreen = compose(
withNavigation,
withActiveCallBacks
)(MessagesCreatePostScreen);
export default withLoadMessageThread(MessagesSingleScreen);
MessagesSingleScreen.propTypes = {
/**
* Id of message thread to display
* {Number}
*/
messageThreadId: PropTypes.number,
/**
* List screen title
* {String}
*/
screenTitle: PropTypes.string,
/**
* If the message thead is not yet available in the app state, the component will attempt to load a list of messages.
* You can use this field to search for the specific message you want to load instead of loading a list of messages.
* {String}
*/
searchTerm: PropTypes.string,
/**
* Use `true` to hide the action button in the right part of the header
* {Boolean}
*/
hideActionButton: PropTypes.bool,
/**
* Use `true` to hide back button
* {Boolean}
*/
hideBackButton: PropTypes.bool,
/**
* Use `true` to hide cancel button when creating a new message
* {Boolean}
*/
hideCancelButton: PropTypes.bool,
/**
* Use `true` to hide the screen title container
*/
hideNavigationHeader: PropTypes.bool,
/**
* Use this to display your own loading component while the screen is loading
* {ReactComponent}
*/
LoadingComponent: PropTypes.elementType
};
Source