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;
|
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 {
|
.mx_IncomingCallToast_buttons {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
|
|
||||||
> * {
|
.mx_IncomingCallToast_button {
|
||||||
height: 24px;
|
height: 24px;
|
||||||
padding: 0px 12px;
|
padding: 0px 12px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
@ -60,6 +72,28 @@ limitations under the License.
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
font-size: $font-15px;
|
font-size: $font-15px;
|
||||||
line-height: $font-24px;
|
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() {
|
public render() {
|
||||||
const call = this.props.call;
|
const call = this.props.call;
|
||||||
const room = MatrixClientPeg.get().getRoom(CallHandler.sharedInstance().roomIdForCall(call));
|
const room = MatrixClientPeg.get().getRoom(CallHandler.sharedInstance().roomIdForCall(call));
|
||||||
|
const isVoice = call.type === CallType.Voice;
|
||||||
|
|
||||||
const silenceClass = classNames({
|
const contentClass = classNames("mx_IncomingCallToast_content", {
|
||||||
"mx_IncomingCallToast_iconButton": true,
|
"mx_IncomingCallToast_content_voice": isVoice,
|
||||||
|
"mx_IncomingCallToast_content_video": !isVoice,
|
||||||
|
});
|
||||||
|
const silenceClass = classNames("mx_IncomingCallToast_iconButton", {
|
||||||
"mx_IncomingCallToast_unSilence": this.state.silenced,
|
"mx_IncomingCallToast_unSilence": this.state.silenced,
|
||||||
"mx_IncomingCallToast_silence": !this.state.silenced,
|
"mx_IncomingCallToast_silence": !this.state.silenced,
|
||||||
});
|
});
|
||||||
|
@ -101,12 +105,12 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
|
||||||
height={32}
|
height={32}
|
||||||
width={32}
|
width={32}
|
||||||
/>
|
/>
|
||||||
<div className="mx_IncomingCallToast_content">
|
<div className={contentClass}>
|
||||||
<h1>
|
<h1>
|
||||||
{ room ? room.name : _t("Unknown caller") }
|
{ room ? room.name : _t("Unknown caller") }
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
{ call.type === CallType.Voice ? _t("Incoming voice call") : _t("Incoming video call") }
|
{ isVoice ? _t("Incoming voice call") : _t("Incoming video call") }
|
||||||
</p>
|
</p>
|
||||||
<AccessibleTooltipButton
|
<AccessibleTooltipButton
|
||||||
className={silenceClass}
|
className={silenceClass}
|
||||||
|
@ -115,18 +119,18 @@ export default class IncomingCallToast extends React.Component<IProps, IState> {
|
||||||
/>
|
/>
|
||||||
<div className="mx_IncomingCallToast_buttons">
|
<div className="mx_IncomingCallToast_buttons">
|
||||||
<AccessibleButton
|
<AccessibleButton
|
||||||
className="mx_IncomingCallToast_decline"
|
className="mx_IncomingCallToast_button mx_IncomingCallToast_button_decline"
|
||||||
onClick={this.onRejectClick}
|
onClick={this.onRejectClick}
|
||||||
kind="danger"
|
kind="danger"
|
||||||
>
|
>
|
||||||
{ _t("Decline") }
|
<span> { _t("Decline") } </span>
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
<AccessibleButton
|
<AccessibleButton
|
||||||
className="mx_IncomingCallToast_accept"
|
className="mx_IncomingCallToast_button mx_IncomingCallToast_button_accept"
|
||||||
onClick={this.onAnswerClick}
|
onClick={this.onAnswerClick}
|
||||||
kind="primary"
|
kind="primary"
|
||||||
>
|
>
|
||||||
{ _t("Accept") }
|
<span> { _t("Accept") } </span>
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue