mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Add button icons
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
a6f10a4aaa
commit
25d62983de
2 changed files with 47 additions and 9 deletions
|
@ -46,13 +46,25 @@ limitations under the License.
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
&.mx_IncomingCallToast_content_voice {
|
||||
.mx_IncomingCallToast_buttons .mx_IncomingCallToast_button_accept span::before {
|
||||
mask-image: url('$(res)/img/element-icons/call/voice-call.svg');
|
||||
}
|
||||
}
|
||||
|
||||
&.mx_IncomingCallToast_content_video {
|
||||
.mx_IncomingCallToast_buttons .mx_IncomingCallToast_button_accept span::before {
|
||||
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
|
||||
}
|
||||
}
|
||||
|
||||
.mx_IncomingCallToast_buttons {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 12px;
|
||||
|
||||
> * {
|
||||
.mx_IncomingCallToast_button {
|
||||
height: 24px;
|
||||
padding: 0px 12px;
|
||||
flex-shrink: 0;
|
||||
|
@ -60,6 +72,28 @@ limitations under the License.
|
|||
margin-right: 0;
|
||||
font-size: $font-15px;
|
||||
line-height: $font-24px;
|
||||
|
||||
span {
|
||||
padding: 8px 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
background-color: $button-fg-color;
|
||||
mask-position: center;
|
||||
mask-repeat: no-repeat;
|
||||
mask-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
&.mx_IncomingCallToast_button_decline span::before {
|
||||
mask-image: url('$(res)/img/element-icons/call/hangup.svg');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,9 +88,13 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
|
|||
public render() {
|
||||
const call = this.props.call;
|
||||
const room = MatrixClientPeg.get().getRoom(CallHandler.sharedInstance().roomIdForCall(call));
|
||||
const isVoice = call.type === CallType.Voice;
|
||||
|
||||
const silenceClass = classNames({
|
||||
"mx_IncomingCallToast_iconButton": true,
|
||||
const contentClass = classNames("mx_IncomingCallToast_content", {
|
||||
"mx_IncomingCallToast_content_voice": isVoice,
|
||||
"mx_IncomingCallToast_content_video": !isVoice,
|
||||
});
|
||||
const silenceClass = classNames("mx_IncomingCallToast_iconButton", {
|
||||
"mx_IncomingCallToast_unSilence": this.state.silenced,
|
||||
"mx_IncomingCallToast_silence": !this.state.silenced,
|
||||
});
|
||||
|
@ -101,12 +105,12 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
|
|||
height={32}
|
||||
width={32}
|
||||
/>
|
||||
<div className="mx_IncomingCallToast_content">
|
||||
<div className={contentClass}>
|
||||
<h1>
|
||||
{ room ? room.name : _t("Unknown caller") }
|
||||
</h1>
|
||||
<p>
|
||||
{ call.type === CallType.Voice ? _t("Incoming voice call") : _t("Incoming video call") }
|
||||
{ isVoice ? _t("Incoming voice call") : _t("Incoming video call") }
|
||||
</p>
|
||||
<AccessibleTooltipButton
|
||||
className={silenceClass}
|
||||
|
@ -115,18 +119,18 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
|
|||
/>
|
||||
<div className="mx_IncomingCallToast_buttons">
|
||||
<AccessibleButton
|
||||
className="mx_IncomingCallToast_decline"
|
||||
className="mx_IncomingCallToast_button mx_IncomingCallToast_button_decline"
|
||||
onClick={this.onRejectClick}
|
||||
kind="danger"
|
||||
>
|
||||
{ _t("Decline") }
|
||||
<span> { _t("Decline") } </span>
|
||||
</AccessibleButton>
|
||||
<AccessibleButton
|
||||
className="mx_IncomingCallToast_accept"
|
||||
className="mx_IncomingCallToast_button mx_IncomingCallToast_button_accept"
|
||||
onClick={this.onAnswerClick}
|
||||
kind="primary"
|
||||
>
|
||||
{ _t("Accept") }
|
||||
<span> { _t("Accept") } </span>
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue