diff --git a/src/pages/ReportSettingsPage.js b/src/pages/ReportSettingsPage.js index 4f2b9db34cf8..98e51742c0db 100644 --- a/src/pages/ReportSettingsPage.js +++ b/src/pages/ReportSettingsPage.js @@ -150,8 +150,8 @@ class ReportSettingsPage extends Component { } render() { - const shouldShowRename = !ReportUtils.isPolicyExpenseChat(this.props.report); - const isDefaultOrArchivedRoom = ReportUtils.isDefaultRoom(this.props.report) + const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(this.props.report); + const shouldDisableRename = ReportUtils.isDefaultRoom(this.props.report) || ReportUtils.isArchivedRoom(this.props.report); const linkedWorkspace = _.find(this.props.policies, policy => policy.id === this.props.report.policyID); @@ -179,41 +179,41 @@ class ReportSettingsPage extends Component { /> - {shouldShowRename && ( + {shouldShowRoomName && ( - {!isDefaultOrArchivedRoom ? ( - this.clearErrorAndSetValue('newRoomName', newRoomName)} - disabled={isDefaultOrArchivedRoom} - /> + {shouldDisableRename ? ( + + + {this.props.translate('newRoomPage.roomName')} + + + {this.state.newRoomName} + + ) : ( - - - {this.props.translate('newRoomPage.roomName')} - - - {this.state.newRoomName} - - + this.clearErrorAndSetValue('newRoomName', newRoomName)} + disabled={shouldDisableRename} + /> )} - {!isDefaultOrArchivedRoom && ( + {!shouldDisableRename && (