From 0ff916dc50d7d668c2ab1f56e8cf530dcdb2633b Mon Sep 17 00:00:00 2001 From: Gung Wah <41157464+kresnaputra@users.noreply.github.com> Date: Thu, 1 Apr 2021 21:54:39 +0800 Subject: [PATCH] [IMPROVEMENT] Add "Message" option to Room Info (#3029) * [CHORE] Go to room from hashtag * Layout tweaks Co-authored-by: Diego Mello --- app/views/RoomInfoView/index.js | 10 ++++++---- app/views/RoomInfoView/styles.js | 9 +++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/views/RoomInfoView/index.js b/app/views/RoomInfoView/index.js index 30187fdb3..5966f312d 100644 --- a/app/views/RoomInfoView/index.js +++ b/app/views/RoomInfoView/index.js @@ -306,7 +306,9 @@ class RoomInfoView extends React.Component { const onActionPress = async() => { try { - await this.createDirect(); + if (this.isDirect) { + await this.createDirect(); + } onPress(); } catch { EventEmitter.emit(LISTENER, { message: I18n.t('error-action-not-allowed', { action: I18n.t('Create_Direct_Messages') }) }); @@ -333,7 +335,7 @@ class RoomInfoView extends React.Component { return ( {this.renderButton(this.goRoom, 'message', I18n.t('Message'))} - {jitsiEnabled ? this.renderButton(this.videoCall, 'camera', I18n.t('Video_call')) : null} + {jitsiEnabled && this.isDirect ? this.renderButton(this.videoCall, 'camera', I18n.t('Video_call')) : null} ); } @@ -360,10 +362,10 @@ class RoomInfoView extends React.Component { style={{ backgroundColor: themes[theme].backgroundColor }} testID='room-info-view' > - + {this.renderAvatar(room, roomUser)} { getRoomTitle(room, this.t, roomUser?.name, roomUser?.username, roomUser?.statusText, theme) } - {this.isDirect ? this.renderButtons() : null} + {this.renderButtons()} {this.renderContent()} diff --git a/app/views/RoomInfoView/styles.js b/app/views/RoomInfoView/styles.js index 5ba307b65..4c626a81c 100644 --- a/app/views/RoomInfoView/styles.js +++ b/app/views/RoomInfoView/styles.js @@ -16,15 +16,12 @@ export default StyleSheet.create({ justifyContent: 'center' }, avatarContainer: { - minHeight: 240, + minHeight: 320, flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - marginBottom: 20 - }, - avatarContainerDirectRoom: { - paddingVertical: 16, - minHeight: 320 + marginBottom: 20, + paddingVertical: 8 }, avatar: { marginHorizontal: 10