diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 3fbcf80805..e2f5c24b37 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -900,58 +900,34 @@ module.exports = React.createClass({ break; } - // TODO: Fix duplication here and do conditionals like we do above + var topBar; if (MatrixClientPeg.get().isGuest()) { - return ( -
- -
- -
- {page_element} -
- {right_panel} -
-
- ); - } else if (Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) { - return ( -
- -
- -
- {page_element} -
- {right_panel} -
-
- ); - } else if (this.state.hasNewVersion) { - return ( -
- -
- -
- {page_element} -
- {right_panel} -
-
- ); + topBar = ; } - else { - return ( -
- -
- {page_element} -
- {right_panel} -
- ); + else if (Notifier.supportsDesktopNotifications() && !Notifier.isEnabled() && !Notifier.isToolbarHidden()) { + topBar = ; } + else if (this.state.hasNewVersion) { + topBar = ; + } + + var bodyClasses = "mx_MatrixChat"; + if (topBar) { + bodyClasses += " mx_MatrixChat_toolbarShowing"; + } + + return ( +
+ {topBar} +
+ +
+ {page_element} +
+ {right_panel} +
+
+ ); } else if (this.state.logged_in || (!this.state.logged_in && this._autoRegisterAsGuest)) { var Spinner = sdk.getComponent('elements.Spinner'); var logoutLink;