add way to add icon to SessionConfirm dialog

pull/1317/head
Audric Ackermann 5 years ago
parent 135cf64b5d
commit 94bd47fb8c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

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

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

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

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

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

Loading…
Cancel
Save