Better handling of call types

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-08 14:19:02 +02:00
parent 6f1fc3fc7e
commit 9ec3d93402
No known key found for this signature in database
GPG key ID: 9760693FDD98A790
2 changed files with 18 additions and 14 deletions

View file

@ -27,6 +27,18 @@ limitations under the License.
box-sizing: border-box; box-sizing: border-box;
height: 60px; height: 60px;
&.mx_CallEvent_voice {
.mx_CallEvent_type_icon::before {
mask-image: url('$(res)/img/element-icons/call/voice-call.svg');
}
}
&.mx_CallEvent_video {
.mx_CallEvent_type_icon::before {
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
}
}
.mx_CallEvent_info { .mx_CallEvent_info {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -68,14 +80,6 @@ limitations under the License.
mask-size: contain; mask-size: contain;
} }
} }
.mx_CallEvent_type_icon_voice::before {
mask-image: url('$(res)/img/element-icons/call/voice-call.svg');
}
.mx_CallEvent_type_icon_video::before {
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
}
} }
} }
} }

View file

@ -187,14 +187,14 @@ export default class CallEvent extends React.Component<IProps, IState> {
const isVoice = this.props.callEventGrouper.isVoice; const isVoice = this.props.callEventGrouper.isVoice;
const callType = isVoice ? _t("Voice call") : _t("Video call"); const callType = isVoice ? _t("Voice call") : _t("Video call");
const content = this.renderContent(this.state.callState); const content = this.renderContent(this.state.callState);
const callTypeIconClass = classNames({ const className = classNames({
mx_CallEvent_type_icon: true, mx_CallEvent: true,
mx_CallEvent_type_icon_voice: isVoice, mx_CallEvent_voice: isVoice,
mx_CallEvent_type_icon_video: !isVoice, mx_CallEvent_video: !isVoice,
}); });
return ( return (
<div className="mx_CallEvent"> <div className={className}>
<div className="mx_CallEvent_info"> <div className="mx_CallEvent_info">
<MemberAvatar <MemberAvatar
member={event.sender} member={event.sender}
@ -206,7 +206,7 @@ export default class CallEvent extends React.Component<IProps, IState> {
{ sender } { sender }
</div> </div>
<div className="mx_CallEvent_type"> <div className="mx_CallEvent_type">
<div className={callTypeIconClass}></div> <div className="mx_CallEvent_type_icon"></div>
{ callType } { callType }
</div> </div>
</div> </div>