more prominent "messaging disabled" note
This commit is contained in:
@@ -1210,6 +1210,12 @@ i.search {
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
#send-message-panel #writing-disabled {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
#sendMessage {
|
||||
overflow: hidden;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -232,6 +232,8 @@ class TinodeWeb extends React.Component {
|
||||
|
||||
const parsedNav = HashNavigation.parseUrlHash(window.location.hash);
|
||||
if (token) {
|
||||
this.setState({autoLogin: true});
|
||||
|
||||
// When reading from storage, date is returned as string.
|
||||
token.expires = new Date(token.expires);
|
||||
this.tinode.setAuthToken(token);
|
||||
|
||||
@@ -150,39 +150,37 @@ class SendMessage extends React.PureComponent {
|
||||
formatMessage(messages.type_new_message));
|
||||
return (
|
||||
<div id="send-message-panel">
|
||||
{this.props.onAttachFile ?
|
||||
(this.props.disabled ?
|
||||
<>
|
||||
<i className="material-icons disabled">photo</i>
|
||||
<i className="material-icons disabled">attach_file</i>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.attachImage.click();}} title="Add image">
|
||||
<i className="material-icons secondary">photo</i>
|
||||
</a>
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.attachFile.click();}} title="Attach file">
|
||||
<i className="material-icons secondary">attach_file</i>
|
||||
</a>
|
||||
</>)
|
||||
{!this.props.disabled ?
|
||||
<>
|
||||
{this.props.onAttachFile ?
|
||||
<>
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.attachImage.click();}} title="Add image">
|
||||
<i className="material-icons secondary">photo</i>
|
||||
</a>
|
||||
<a href="#" onClick={(e) => {e.preventDefault(); this.attachFile.click();}} title="Attach file">
|
||||
<i className="material-icons secondary">attach_file</i>
|
||||
</a>
|
||||
</>
|
||||
:
|
||||
null}
|
||||
{this.props.noInput ?
|
||||
<div className="hr thin" /> :
|
||||
<textarea id="sendMessage" placeholder={prompt}
|
||||
value={this.state.message} onChange={this.handleMessageTyping}
|
||||
onKeyPress={this.handleKeyPress}
|
||||
ref={(ref) => {this.messageEditArea = ref;}}
|
||||
autoFocus />}
|
||||
<a href="#" onClick={this.handleSend} title="Send">
|
||||
<i className="material-icons">send</i>
|
||||
</a>
|
||||
<input type="file" ref={(ref) => {this.attachFile = ref;}}
|
||||
onChange={this.handleAttachFile} style={{display: 'none'}} />
|
||||
<input type="file" ref={(ref) => {this.attachImage = ref;}} accept="image/*"
|
||||
onChange={this.handleAttachImage} style={{display: 'none'}} />
|
||||
</>
|
||||
:
|
||||
null}
|
||||
{this.props.noInput ?
|
||||
<div className="hr thin" /> :
|
||||
<textarea id="sendMessage" placeholder={prompt}
|
||||
disabled={this.props.disabled} value={this.state.message}
|
||||
onChange={this.handleMessageTyping} onKeyPress={this.handleKeyPress}
|
||||
ref={(ref) => {this.messageEditArea = ref;}}
|
||||
autoFocus />}
|
||||
{this.props.disabled ?
|
||||
<i className="material-icons disabled">send</i> :
|
||||
<a href="#" onClick={this.handleSend} title="Send">
|
||||
<i className="material-icons">send</i>
|
||||
</a>}
|
||||
<input type="file" ref={(ref) => {this.attachFile = ref;}}
|
||||
onChange={this.handleAttachFile} style={{display: 'none'}} />
|
||||
<input type="file" ref={(ref) => {this.attachImage = ref;}} accept="image/*"
|
||||
onChange={this.handleAttachImage} style={{display: 'none'}} />
|
||||
<div id="writing-disabled">{prompt}</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
+8
-10
@@ -4825,6 +4825,9 @@ var TinodeWeb = function (_React$Component) {
|
||||
var parsedNav = _lib_navigation_js__WEBPACK_IMPORTED_MODULE_15__["default"].parseUrlHash(window.location.hash);
|
||||
|
||||
if (token) {
|
||||
this.setState({
|
||||
autoLogin: true
|
||||
});
|
||||
token.expires = new Date(token.expires);
|
||||
this.tinode.setAuthToken(token);
|
||||
this.tinode.connect().catch(function (err) {
|
||||
@@ -11103,11 +11106,7 @@ var SendMessage = function (_React$PureComponent) {
|
||||
var prompt = this.props.disabled ? formatMessage(messages.messaging_disabled) : this.props.messagePrompt ? formatMessage(messages[this.props.messagePrompt]) : formatMessage(messages.type_new_message);
|
||||
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||
id: "send-message-panel"
|
||||
}, this.props.onAttachFile ? this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("i", {
|
||||
className: "material-icons disabled"
|
||||
}, "photo"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("i", {
|
||||
className: "material-icons disabled"
|
||||
}, "attach_file")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
}, !this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, this.props.onAttachFile ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
href: "#",
|
||||
onClick: function onClick(e) {
|
||||
e.preventDefault();
|
||||
@@ -11132,7 +11131,6 @@ var SendMessage = function (_React$PureComponent) {
|
||||
}) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("textarea", {
|
||||
id: "sendMessage",
|
||||
placeholder: prompt,
|
||||
disabled: this.props.disabled,
|
||||
value: this.state.message,
|
||||
onChange: this.handleMessageTyping,
|
||||
onKeyPress: this.handleKeyPress,
|
||||
@@ -11140,9 +11138,7 @@ var SendMessage = function (_React$PureComponent) {
|
||||
_this3.messageEditArea = _ref;
|
||||
},
|
||||
autoFocus: true
|
||||
}), this.props.disabled ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("i", {
|
||||
className: "material-icons disabled"
|
||||
}, "send") : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
}), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
|
||||
href: "#",
|
||||
onClick: this.handleSend,
|
||||
title: "Send"
|
||||
@@ -11167,7 +11163,9 @@ var SendMessage = function (_React$PureComponent) {
|
||||
style: {
|
||||
display: 'none'
|
||||
}
|
||||
}));
|
||||
})) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
||||
id: "writing-disabled"
|
||||
}, prompt));
|
||||
}
|
||||
}]);
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user