From fe63234dbbf6b12f7e6a169da04e9052032991c3 Mon Sep 17 00:00:00 2001 From: Vitor Mateus <vitormateusalmeida@gmail.com> Date: Thu, 20 Dec 2018 17:39:04 -0200 Subject: [PATCH] Fix proptype warnings --- .../actions-bar/actions-dropdown/component.jsx | 2 +- .../imports/ui/components/nav-bar/component.jsx | 17 +++++++++++------ .../imports/ui/components/nav-bar/container.jsx | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx index dc558fc24a..75837b989c 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/actions-dropdown/component.jsx @@ -23,7 +23,7 @@ const propTypes = { isUserModerator: PropTypes.bool.isRequired, allowStartStopRecording: PropTypes.bool.isRequired, isRecording: PropTypes.bool.isRequired, - record: PropTypes.func.isRequired, + record: PropTypes.bool.isRequired, toggleRecording: PropTypes.func.isRequired, meetingIsBreakout: PropTypes.bool.isRequired, hasBreakoutRoom: PropTypes.bool.isRequired, diff --git a/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx b/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx index 8def7900d9..6ce8ba551f 100755 --- a/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/nav-bar/component.jsx @@ -49,14 +49,19 @@ const intlMessages = defineMessages({ const propTypes = { presentationTitle: PropTypes.string, hasUnreadMessages: PropTypes.bool, - beingRecorded: PropTypes.bool, + recordProps: PropTypes.objectOf(PropTypes.bool), shortcuts: PropTypes.string, }; const defaultProps = { presentationTitle: 'Default Room Title', hasUnreadMessages: false, - beingRecorded: false, + recordProps: { + allowStartStopRecording: false, + autoStartRecording: false, + record: false, + recording: false, + }, shortcuts: '', }; @@ -196,13 +201,13 @@ class NavBar extends PureComponent { render() { const { hasUnreadMessages, - beingRecorded, + recordProps, isExpanded, intl, shortcuts: TOGGLE_USERLIST_AK, } = this.props; - const recordingMessage = beingRecorded.recording ? 'recordingIndicatorOn' : 'recordingIndicatorOff'; + const recordingMessage = recordProps.recording ? 'recordingIndicatorOn' : 'recordingIndicatorOff'; const toggleBtnClasses = {}; toggleBtnClasses[styles.btn] = true; @@ -230,11 +235,11 @@ class NavBar extends PureComponent { </div> <div className={styles.center}> {this.renderPresentationTitle()} - {beingRecorded.record + {recordProps.record ? <span className={styles.presentationTitleSeparator}>|</span> : null} <RecordingIndicator - {...beingRecorded} + {...recordProps} title={intl.formatMessage(intlMessages[recordingMessage])} /> </div> diff --git a/bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx b/bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx index 25a03f5159..95d9daebc4 100755 --- a/bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx @@ -64,7 +64,7 @@ export default withTracker(() => { presentationTitle: meetingTitle, hasUnreadMessages: checkUnreadMessages(), isBreakoutRoom: meetingIsBreakout(), - beingRecorded: meetingRecorded, + recordProps: meetingRecorded, toggleUserList: () => { Session.set('isUserListOpen', !isExpanded); }, -- GitLab