From 94bd47fb8cb64d6e31f51cc3fff95f3403472fbf Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 28 Aug 2020 10:08:32 +1000 Subject: [PATCH] add way to add icon to SessionConfirm dialog --- js/background.js | 2 ++ js/views/session_confirm_view.js | 2 ++ stylesheets/_session.scss | 12 ++++++++---- ts/components/session/ActionsPanel.tsx | 2 -- ts/components/session/SessionConfirm.tsx | 12 ++++++++++++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/js/background.js b/js/background.js index b4522661c..d2f5b7e9b 100644 --- a/js/background.js +++ b/js/background.js @@ -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(); diff --git a/js/views/session_confirm_view.js b/js/views/session_confirm_view.js index ae31cec29..a86fd3017 100644 --- a/js/views/session_confirm_view.js +++ b/js/views/session_confirm_view.js @@ -21,6 +21,8 @@ okTheme: options.okTheme, closeTheme: options.closeTheme, hideCancel: options.hideCancel, + sessionIcon: options.sessionIcon, + iconSize: options.iconSize, }; }, diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 879cb4550..1287c75d7 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -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; diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 8b603dabe..661c1b345 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -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 { diff --git a/ts/components/session/SessionConfirm.tsx b/ts/components/session/SessionConfirm.tsx index ed8914c4a..a906a5f3c 100644 --- a/ts/components/session/SessionConfirm.tsx +++ b/ts/components/session/SessionConfirm.tsx @@ -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 { @@ -41,6 +44,8 @@ export class SessionConfirm extends React.Component { 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 { {!showHeader &&
}
+ {sessionIcon && ( +
+ +
+
+ )} +