nicer message bubbles for calls

This commit is contained in:
or-else
2022-05-27 16:59:23 -07:00
parent 97f3699e97
commit 91eacd23ef
17 changed files with 171 additions and 69 deletions
+12
View File
@@ -1727,6 +1727,15 @@ video {
text-align: center;
}
.call-message {
display: flex;
flex-direction: row;
}
.call-message .duration {
font-weight: lighter;
}
/* Talk bubbles */
.chat-box {
list-style: none;
@@ -2419,6 +2428,9 @@ ul.tabbar li.active > a {
.material-icons.small {
font-size: 1rem;
}
.material-icons.medium {
font-size: 1.2rem;
}
.material-icons.big {
font-size: 2.4rem;
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+11 -5
View File
@@ -1377,21 +1377,21 @@
},
"calls_incoming": {
"translation": "Incoming Call",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": false,
"obsolete": false
},
"calls_incoming_title": {
"translation": "Incoming Call",
"defaultMessage": "Incoming Call",
"translation": "Incoming call",
"defaultMessage": "Incoming call",
"description": "Incoming call title (Incoming call view)",
"missing": false,
"obsolete": true
},
"calls_outgoing": {
"translation": "Outgoing Call",
"defaultMessage": "Outgoing Call",
"translation": "Outgoing call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": false,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": false,
"obsolete": false
},
"call_cancelled": {
"translation": "cancelled",
"defaultMessage": "cancelled",
"missing": false,
"obsolete": false
}
}
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+5 -2
View File
@@ -123,12 +123,15 @@
"defaultMessage": "Update",
"description": "Button [Update]"
},
"call_cancelled": {
"defaultMessage": "cancelled"
},
"calls_incoming": {
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label"
},
"calls_outgoing": {
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label"
},
"calls_you_label": {
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+8 -2
View File
@@ -1377,7 +1377,7 @@
},
"calls_incoming": {
"translation": "",
"defaultMessage": "Incoming Call",
"defaultMessage": "Incoming call",
"description": "Incoming call label",
"missing": true,
"obsolete": false
@@ -1391,7 +1391,7 @@
},
"calls_outgoing": {
"translation": "",
"defaultMessage": "Outgoing Call",
"defaultMessage": "Outgoing call",
"description": "Outgoing call label",
"missing": true,
"obsolete": false
@@ -1416,5 +1416,11 @@
"description": "Error message when the user tried to accept a new call without finishing pervious one",
"missing": true,
"obsolete": false
},
"call_cancelled": {
"translation": "",
"defaultMessage": "cancelled",
"missing": true,
"obsolete": false
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -12
View File
@@ -5,12 +5,12 @@ import { FormattedMessage, injectIntl } from 'react-intl';
import { Drafty, Tinode } from 'tinode-sdk';
import Attachment from './attachment.jsx';
import CallMessage from './call-message.jsx';
import LetterTile from './letter-tile.jsx';
import ReceivedMarker from './received-marker.jsx'
import { fullFormatter } from '../lib/formatters.js';
import { isVideoCall, sanitizeUrl } from '../lib/utils.js';
import { secondsToTime } from '../lib/strformat.js';
class BaseChatMessage extends React.PureComponent {
constructor(props) {
@@ -148,17 +148,11 @@ class BaseChatMessage extends React.PureComponent {
defaultMessage="content deleted" description="Shown when messages are deleted" />
</i></>
} else if (isVideoCall(this.props.mimeType)) {
// Video calls.
const direction = this.props.response ? 'call_received' : 'call_made';
const text = this.props.response ?
<FormattedMessage id="calls_incoming"
defaultMessage="Incoming Call" description="Incoming call label" /> :
<FormattedMessage id="calls_outgoing"
defaultMessage="Outgoing Call" description="Outgoing call label" />;
const isCallDropped = this.props.content == 'disconnected';
content = <><i className="material-icons" style={{color: isCallDropped ? 'red' : 'green'}}>{direction}</i>{text}
{ !isCallDropped && this.props.duration ? [' (', secondsToTime(this.props.duration / 1000), ')'] : null}
</>
// Video call message.
content = <CallMessage
content={this.props.content}
response={this.props.response}
duration={this.props.duration} />
} else if (typeof content != 'string') {
content = <><i className="material-icons gray">warning_amber</i> <i className="gray">
<FormattedMessage id="invalid_content"
+76 -31
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long