Reorganize content

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-24 14:04:22 +02:00
parent c00174aacc
commit 24e6fc96f6
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
2 changed files with 36 additions and 47 deletions

View File

@ -18,10 +18,12 @@ limitations under the License.
.mx_IncomingCallToast { .mx_IncomingCallToast {
// mx_Toast overrides // mx_Toast overrides
padding: 8px !important; padding: 8px !important;
display: unset !important; display: flex !important;
top: 8px !important; top: 8px !important;
border-radius: 8px; border-radius: 8px;
flex-direction: row;
gap: 8px;
min-width: 250px; min-width: 250px;
box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08); box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08);
background-color: $voipcall-plinth-color; // To match mx_Toast background-color: $voipcall-plinth-color; // To match mx_Toast
@ -29,21 +31,10 @@ limitations under the License.
pointer-events: initial; // restore pointer events so the user can accept/decline pointer-events: initial; // restore pointer events so the user can accept/decline
cursor: pointer; cursor: pointer;
.mx_IncomingCallToast_CallerInfo { .mx_IncomingCallToast_content {
display: flex;
direction: row;
img, .mx_BaseAvatar_initial {
margin: 8px;
}
> div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center;
}
h1, p { h1, p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
@ -57,7 +48,7 @@ limitations under the License.
} }
.mx_IncomingCallToast_buttons { .mx_IncomingCallToast_buttons {
padding: 8px; margin-top: 8px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
gap: 12px; gap: 12px;
@ -74,6 +65,7 @@ limitations under the License.
} }
.mx_IncomingCallToast_iconButton { .mx_IncomingCallToast_iconButton {
display: flex;
position: absolute; position: absolute;
right: 8px; right: 8px;

View File

@ -87,12 +87,7 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
public render() { public render() {
const call = this.props.call; const call = this.props.call;
let room = null; const room = MatrixClientPeg.get().getRoom(CallHandler.sharedInstance().roomIdForCall(call));
room = MatrixClientPeg.get().getRoom(CallHandler.sharedInstance().roomIdForCall(call));
const caller = room ? room.name : _t("Unknown caller");
const incomingCallText = call.type === CallType.Voice ? _t("Incoming voice call") : _t("Incoming video call");
const silenceClass = classNames({ const silenceClass = classNames({
"mx_IncomingCallToast_iconButton": true, "mx_IncomingCallToast_iconButton": true,
@ -101,22 +96,23 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
}); });
return <React.Fragment> return <React.Fragment>
<div className="mx_IncomingCallToast_CallerInfo">
<RoomAvatar <RoomAvatar
room={room} room={room}
height={32} height={32}
width={32} width={32}
/> />
<div> <div className="mx_IncomingCallToast_content">
<h1>{ caller }</h1> <h1>
<p>{ incomingCallText }</p> { room ? room.name : _t("Unknown caller") }
</div> </h1>
<p>
{ call.type === CallType.Voice ? _t("Incoming voice call") : _t("Incoming video call") }
</p>
<AccessibleTooltipButton <AccessibleTooltipButton
className={silenceClass} className={silenceClass}
onClick={this.onSilenceClick} onClick={this.onSilenceClick}
title={this.state.silenced ? _t("Sound on") : _t("Silence call")} title={this.state.silenced ? _t("Sound on") : _t("Silence call")}
/> />
</div>
<div className="mx_IncomingCallToast_buttons"> <div className="mx_IncomingCallToast_buttons">
<AccessibleButton <AccessibleButton
className="mx_IncomingCallToast_decline" className="mx_IncomingCallToast_decline"
@ -133,6 +129,7 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
{ _t("Accept") } { _t("Accept") }
</AccessibleButton> </AccessibleButton>
</div> </div>
</div>
</React.Fragment>; </React.Fragment>;
} }
} }