add way to add icon to SessionConfirm dialog

This commit is contained in:
Audric Ackermann 2020-08-28 10:08:32 +10:00
parent 135cf64b5d
commit 94bd47fb8c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
5 changed files with 24 additions and 6 deletions

View File

@ -681,6 +681,8 @@
closeTheme: params.closeTheme || undefined,
cancelText: params.cancelText || undefined,
hideCancel: params.hideCancel || false,
sessionIcon: params.sessionIcon || undefined,
iconSize: params.iconSize || undefined,
});
confirmDialog.render();

View File

@ -21,6 +21,8 @@
okTheme: options.okTheme,
closeTheme: options.closeTheme,
hideCancel: options.hideCancel,
sessionIcon: options.sessionIcon,
iconSize: options.iconSize,
};
},

View File

@ -100,7 +100,9 @@ textarea {
&.default,
&.square,
&.brand {
color: $session-color-white;
@include themify($themes) {
color: themed('foregroundPrimary');
}
&:not(.disabled):hover {
@include themify($themes) {
@ -207,8 +209,10 @@ textarea {
border-radius: 500px;
&:not(.disabled):hover {
color: $session-color-white;
border-color: $session-color-white;
@include themify($themes) {
color: themed('textColor');
border-color: themed('textColor');
}
}
}
@ -581,7 +585,7 @@ label {
@include themify($themes) {
background-color: themed('modalBackground');
color: themed('textColor');
border: 1px solid themed('borderActionPanel');
border: themed('borderActionPanel');
}
overflow: hidden;
display: flex;

View File

@ -2,8 +2,6 @@ import React from 'react';
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
import { Avatar } from '../Avatar';
import { PropsData as ConversationListItemPropsType } from '../ConversationListItem';
import { MultiDeviceProtocol } from '../../session/protocols';
import { UserUtil } from '../../util';
import { createOrUpdateItem, getItemById } from '../../../js/modules/data';
export enum SectionType {

View File

@ -2,6 +2,7 @@ import React from 'react';
import { SessionModal } from './SessionModal';
import { SessionButton, SessionButtonColor } from './SessionButton';
import { SessionHtmlRenderer } from './SessionHTMLRenderer';
import { SessionIcon, SessionIconSize, SessionIconType } from './icon';
interface Props {
message: string;
@ -16,6 +17,8 @@ interface Props {
hideCancel: boolean;
okTheme: SessionButtonColor;
closeTheme: SessionButtonColor;
sessionIcon?: SessionIconType;
iconSize?: SessionIconSize;
}
export class SessionConfirm extends React.Component<Props> {
@ -41,6 +44,8 @@ export class SessionConfirm extends React.Component<Props> {
onClickOk,
onClickClose,
hideCancel,
sessionIcon,
iconSize,
} = this.props;
const okText = this.props.okText || window.i18n('ok');
@ -62,6 +67,13 @@ export class SessionConfirm extends React.Component<Props> {
{!showHeader && <div className="spacer-lg" />}
<div className="session-modal__centered">
{sessionIcon && (
<div>
<SessionIcon iconType={sessionIcon} iconSize={iconSize} />
<div className="spacer-lg" />
</div>
)}
<SessionHtmlRenderer
tag="span"
className={messageSubText}