Reorganize content

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Š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_Toast overrides
padding: 8px !important;
display: unset !important;
display: flex !important;
top: 8px !important;
border-radius: 8px;
flex-direction: row;
gap: 8px;
min-width: 250px;
box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.08);
background-color: $voipcall-plinth-color; // To match mx_Toast
@ -29,20 +31,9 @@ limitations under the License.
pointer-events: initial; // restore pointer events so the user can accept/decline
cursor: pointer;
.mx_IncomingCallToast_CallerInfo {
.mx_IncomingCallToast_content {
display: flex;
direction: row;
img, .mx_BaseAvatar_initial {
margin: 8px;
}
> div {
display: flex;
flex-direction: column;
justify-content: center;
}
flex-direction: column;
h1, p {
margin: 0px;
@ -57,7 +48,7 @@ limitations under the License.
}
.mx_IncomingCallToast_buttons {
padding: 8px;
margin-top: 8px;
display: flex;
flex-direction: row;
gap: 12px;
@ -74,6 +65,7 @@ limitations under the License.
}
.mx_IncomingCallToast_iconButton {
display: flex;
position: absolute;
right: 8px;

View file

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