diff --git a/res/css/_common.scss b/res/css/_common.scss index 38f576a532..bf67edc1c3 100644 --- a/res/css/_common.scss +++ b/res/css/_common.scss @@ -222,6 +222,11 @@ textarea { word-wrap: break-word; } +.mx_Dialog_buttons { + padding-right: 58px; + text-align: right; +} + .mx_Dialog button, .mx_Dialog input[type="submit"] { @mixin mx_DialogButton; margin-left: 0px; diff --git a/res/css/_components.scss b/res/css/_components.scss index 0e40b40a29..a09f895d5f 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -38,7 +38,6 @@ @import "./views/dialogs/_DevtoolsDialog.scss"; @import "./views/dialogs/_EncryptedEventDialog.scss"; @import "./views/dialogs/_GroupAddressPicker.scss"; -@import "./views/dialogs/_QuestionDialog.scss"; @import "./views/dialogs/_RoomUpgradeDialog.scss"; @import "./views/dialogs/_SetEmailDialog.scss"; @import "./views/dialogs/_SetMxIdDialog.scss"; diff --git a/res/css/structures/_LoginBox.scss b/res/css/structures/_LoginBox.scss index 7f6199c451..0a3e21a980 100644 --- a/res/css/structures/_LoginBox.scss +++ b/res/css/structures/_LoginBox.scss @@ -19,6 +19,7 @@ limitations under the License. height: unset !important; padding-top: 13px !important; padding-bottom: 14px !important; + order: 4; } .mx_LoginBox_loginButton_wrapper { diff --git a/res/css/views/dialogs/_ChatInviteDialog.scss b/res/css/views/dialogs/_ChatInviteDialog.scss index 6fc211743d..dcc0f5921a 100644 --- a/res/css/views/dialogs/_ChatInviteDialog.scss +++ b/res/css/views/dialogs/_ChatInviteDialog.scss @@ -14,14 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ChatInviteDialog { - /* XXX: padding-left is on mx_Dialog but padding-right has subsequently - * been added on other dialogs. Surely all our dialogs should have consistent - * right hand padding? - */ - padding-right: 58px; -} - /* Using a textarea for this element, to circumvent autofill */ .mx_ChatInviteDialog_input, .mx_ChatInviteDialog_input:focus diff --git a/res/css/views/dialogs/_DevtoolsDialog.scss b/res/css/views/dialogs/_DevtoolsDialog.scss index a4a868bd11..3764bb13b3 100644 --- a/res/css/views/dialogs/_DevtoolsDialog.scss +++ b/res/css/views/dialogs/_DevtoolsDialog.scss @@ -14,6 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ +.mx_DevTools_dialog { + padding-right: 58px; +} + .mx_DevTools_content { margin: 10px 0; } diff --git a/res/css/views/dialogs/_QuestionDialog.scss b/res/css/views/dialogs/_QuestionDialog.scss deleted file mode 100644 index 3d47f17592..0000000000 --- a/res/css/views/dialogs/_QuestionDialog.scss +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2017 New Vector Ltd. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -.mx_QuestionDialog { - padding-right: 58px; -} diff --git a/res/css/views/rooms/_RoomPreviewBar.scss b/res/css/views/rooms/_RoomPreviewBar.scss index 331eb582ea..8196740499 100644 --- a/res/css/views/rooms/_RoomPreviewBar.scss +++ b/res/css/views/rooms/_RoomPreviewBar.scss @@ -56,3 +56,7 @@ limitations under the License. .mx_RoomPreviewBar_warningIcon { padding: 12px; } + +.mx_RoomPreviewBar_spinnerIntro { + margin-top: 50px; +} \ No newline at end of file diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index ebe5d7f507..72d640bcac 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -181,14 +181,8 @@ var LeftPanel = React.createClass({ const BottomLeftMenu = sdk.getComponent('structures.BottomLeftMenu'); const CallPreview = sdk.getComponent('voip.CallPreview'); - let topBox; - if (this.context.matrixClient.isGuest()) { - const LoginBox = sdk.getComponent('structures.LoginBox'); - topBox = ; - } else { - const SearchBox = sdk.getComponent('structures.SearchBox'); - topBox = ; - } + const SearchBox = sdk.getComponent('structures.SearchBox'); + const topBox = ; const classes = classNames( "mx_LeftPanel", diff --git a/src/components/structures/LoginBox.js b/src/components/structures/LoginBox.js index a9ea1f95c6..a2269706ee 100644 --- a/src/components/structures/LoginBox.js +++ b/src/components/structures/LoginBox.js @@ -1,5 +1,6 @@ /* Copyright 2017 Vector Creations Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,31 +17,15 @@ limitations under the License. 'use strict'; -var React = require('react'); +const React = require('react'); import { _t } from '../../languageHandler'; -var sdk = require('../../index') -var dis = require('../../dispatcher'); -var rate_limited_func = require('../../ratelimitedfunc'); -var AccessibleButton = require('../../components/views/elements/AccessibleButton'); +const dis = require('../../dispatcher'); +const AccessibleButton = require('../../components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'LoginBox', propTypes: { - collapsed: React.PropTypes.bool, - }, - - onToggleCollapse: function(show) { - if (show) { - dis.dispatch({ - action: 'show_left_panel', - }); - } - else { - dis.dispatch({ - action: 'hide_left_panel', - }); - } }, onLoginClick: function() { @@ -52,41 +37,20 @@ module.exports = React.createClass({ }, render: function() { - var TintableSvg = sdk.getComponent('elements.TintableSvg'); - - var toggleCollapse; - if (this.props.collapsed) { - toggleCollapse = - - + const loginButton = ( +
+ + { _t("Login") } - } - else { - toggleCollapse = - - + + { _t("Register") } - } +
+ ); - var loginButton; - if (!this.props.collapsed) { - loginButton = ( -
- - { _t("Login") } - - - { _t("Register") } - -
- ); - } - - var self = this; return ( -
+
{ loginButton } - { toggleCollapse }
); } diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 8e226bdfcf..54f51c7a71 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1514,6 +1514,7 @@ module.exports = React.createClass({ canPreview={false} error={this.state.roomLoadError} roomAlias={roomAlias} spinner={this.state.joining} + spinnerState="joining" inviterName={inviterName} invitedEmail={invitedEmail} room={this.state.room} @@ -1558,6 +1559,7 @@ module.exports = React.createClass({ inviterName={inviterName} canPreview={false} spinner={this.state.joining} + spinnerState="joining" room={this.state.room} />
@@ -1645,6 +1647,7 @@ module.exports = React.createClass({ onForgetClick={this.onForgetClick} onRejectClick={this.onRejectThreepidInviteButtonClicked} spinner={this.state.joining} + spinnerState="joining" inviterName={inviterName} invitedEmail={invitedEmail} canPreview={this.state.canPeek} @@ -1670,7 +1673,7 @@ module.exports = React.createClass({ let messageComposer, searchInfo; const canSpeak = ( // joined and not showing search results - myMembership == 'join' && !this.state.searchResults + myMembership === 'join' && !this.state.searchResults ); if (canSpeak) { messageComposer = @@ -1684,6 +1687,11 @@ module.exports = React.createClass({ />; } + if (MatrixClientPeg.get().isGuest()) { + const LoginBox = sdk.getComponent('structures.LoginBox'); + messageComposer = ; + } + // TODO: Why aren't we storing the term/scope/count in this format // in this.state if this is what RoomHeader desires? if (this.state.searchResults) { diff --git a/src/components/views/dialogs/DevtoolsDialog.js b/src/components/views/dialogs/DevtoolsDialog.js index ea198461c5..22ee44f81a 100644 --- a/src/components/views/dialogs/DevtoolsDialog.js +++ b/src/components/views/dialogs/DevtoolsDialog.js @@ -625,7 +625,7 @@ export default class DevtoolsDialog extends React.Component { let body; if (this.state.mode) { - body =
+ body =
{ this.state.mode.getLabel() }
Room ID: { this.props.roomId }
@@ -634,7 +634,7 @@ export default class DevtoolsDialog extends React.Component { } else { const classes = "mx_DevTools_RoomStateExplorer_button"; body =
-
+
{ _t('Toolbox') }
Room ID: { this.props.roomId }
diff --git a/src/components/views/elements/DialogButtons.js b/src/components/views/elements/DialogButtons.js index baf831415f..f314588caa 100644 --- a/src/components/views/elements/DialogButtons.js +++ b/src/components/views/elements/DialogButtons.js @@ -70,15 +70,15 @@ module.exports = React.createClass({ } return (
+ { cancelButton } + { this.props.children } - { this.props.children } - { cancelButton }
); }, diff --git a/src/components/views/rooms/RoomPreviewBar.js b/src/components/views/rooms/RoomPreviewBar.js index 5ec19d185e..9d3dbe5217 100644 --- a/src/components/views/rooms/RoomPreviewBar.js +++ b/src/components/views/rooms/RoomPreviewBar.js @@ -44,9 +44,13 @@ module.exports = React.createClass({ error: PropTypes.object, canPreview: PropTypes.bool, - spinner: PropTypes.bool, room: PropTypes.object, + // When a spinner is present, a spinnerState can be specified to indicate the + // purpose of the spinner. + spinner: PropTypes.bool, + spinnerState: PropTypes.oneOf(["joining"]), + // The alias that was used to access this room, if appropriate // If given, this will be how the room is referred to (eg. // in error messages). @@ -93,7 +97,12 @@ module.exports = React.createClass({ if (this.props.spinner || this.state.busy) { const Spinner = sdk.getComponent("elements.Spinner"); + let spinnerIntro = ""; + if (this.props.spinnerState === "joining") { + spinnerIntro = _t("Joining room..."); + } return (
+

{ spinnerIntro }

); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index e42d3ce434..e0f4663532 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -512,6 +512,7 @@ "You have no historical rooms": "You have no historical rooms", "Historical": "Historical", "System Alerts": "System Alerts", + "Joining room...": "Joining room...", "Unable to ascertain that the address this invite was sent to matches one associated with your account.": "Unable to ascertain that the address this invite was sent to matches one associated with your account.", "This invitation was sent to an email address which is not associated with this account:": "This invitation was sent to an email address which is not associated with this account:", "You may wish to login with a different account, or add this email to this account.": "You may wish to login with a different account, or add this email to this account.",