diff --git a/src/pages/home/report/ReportFooter.js b/src/pages/home/report/ReportFooter.js index f0541be88ea4..92838ecf9451 100644 --- a/src/pages/home/report/ReportFooter.js +++ b/src/pages/home/report/ReportFooter.js @@ -57,53 +57,46 @@ const defaultProps = { shouldDisableCompose: false, }; -class ReportFooter extends React.Component { - /** - * @returns {Object} - */ - getChatFooterStyles() { - return {...styles.chatFooter, minHeight: !this.props.isOffline ? CONST.CHAT_FOOTER_MIN_HEIGHT : 0}; - } +function ReportFooter(props) { + const chatFooterStyles = {...styles.chatFooter, minHeight: !props.isOffline ? CONST.CHAT_FOOTER_MIN_HEIGHT : 0}; + const isArchivedRoom = ReportUtils.isArchivedRoom(props.report); + const isAllowedToComment = ReportUtils.isAllowedToComment(props.report); + const hideComposer = isArchivedRoom || !_.isEmpty(props.errors) || !isAllowedToComment; - render() { - const isArchivedRoom = ReportUtils.isArchivedRoom(this.props.report); - const isAllowedToComment = ReportUtils.isAllowedToComment(this.props.report); - const hideComposer = isArchivedRoom || !_.isEmpty(this.props.errors) || !isAllowedToComment; - - return ( - <> - {(isArchivedRoom || hideComposer) && ( - - {isArchivedRoom && } - {!this.props.isSmallScreenWidth && ( - {hideComposer && } + return ( + <> + {(isArchivedRoom || hideComposer) && ( + + {isArchivedRoom && } + {!props.isSmallScreenWidth && ( + {hideComposer && } + )} + + )} + {!hideComposer && (props.shouldShowComposeInput || !props.isSmallScreenWidth) && ( + + + {Session.isAnonymousUser() ? ( + + ) : ( + )} - - )} - {!hideComposer && (this.props.shouldShowComposeInput || !this.props.isSmallScreenWidth) && ( - - - {Session.isAnonymousUser() ? ( - - ) : ( - - )} - - - )} - - ); - } + + + )} + + ); } +ReportFooter.displayName = 'ReportFooter'; ReportFooter.propTypes = propTypes; ReportFooter.defaultProps = defaultProps; export default compose(