diff --git a/background.d.ts b/background.d.ts deleted file mode 100644 index 186854e5c..000000000 --- a/background.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface ConfirmationDialogParams { - title?: string; - message: string; - messageSub?: string; - resolve?: any; - reject?: any; - okText?: string; - okTheme?: string; - closeTheme?: string; - cancelText?: string; - hideCancel?: boolean; - sessionIcon?: SessionIconType; - iconSize?: SessionIconSize; -} diff --git a/ts/components/ConversationListItem.tsx b/ts/components/ConversationListItem.tsx index 349fa036e..6046da11d 100644 --- a/ts/components/ConversationListItem.tsx +++ b/ts/components/ConversationListItem.tsx @@ -22,7 +22,7 @@ import { } from '../state/ducks/conversations'; import _ from 'underscore'; import { useMembersAvatars } from '../hooks/useMembersAvatar'; -import { SessionIcon, SessionIconSize, SessionIconType } from './session/icon'; +import { SessionIcon, SessionIconType } from './session/icon'; import { useSelector } from 'react-redux'; import { SectionType } from '../state/ducks/section'; import { getFocusedSection } from '../state/selectors/section'; @@ -88,7 +88,7 @@ const HeaderItem = (props: { ) : null; @@ -105,7 +105,7 @@ const HeaderItem = (props: { ); case 'mentions_only': @@ -113,7 +113,7 @@ const HeaderItem = (props: { ); default: diff --git a/ts/components/Lightbox.tsx b/ts/components/Lightbox.tsx index 241a11402..72a1a01bc 100644 --- a/ts/components/Lightbox.tsx +++ b/ts/components/Lightbox.tsx @@ -6,7 +6,7 @@ import is from '@sindresorhus/is'; import * as GoogleChrome from '../util/GoogleChrome'; import * as MIME from '../types/MIME'; -import { SessionIconButton, SessionIconSize, SessionIconType } from './session/icon'; +import { SessionIconButton, SessionIconType } from './session/icon'; import { Flex } from './basic/Flex'; import { DefaultTheme } from 'styled-components'; // useCss has some issues on our setup. so import it directly @@ -166,7 +166,7 @@ const IconButton = ({ onClick, type, theme }: IconButtonProps) => { return ( @@ -118,7 +118,7 @@ const TripleDotsMenu = (props: { triggerId: string; showBackButton: boolean }) = }); }} > - + ); }; @@ -178,7 +178,7 @@ const BackButton = (props: { onGoBack: () => void; showBackButton: boolean }) => return ( diff --git a/ts/components/conversation/DataExtractionNotification.tsx b/ts/components/conversation/DataExtractionNotification.tsx index 9e39722b4..f4a5282ea 100644 --- a/ts/components/conversation/DataExtractionNotification.tsx +++ b/ts/components/conversation/DataExtractionNotification.tsx @@ -3,7 +3,7 @@ import { useTheme } from 'styled-components'; import { PropsForDataExtractionNotification } from '../../models/messageType'; import { SignalService } from '../../protobuf'; import { Flex } from '../basic/Flex'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIcon, SessionIconType } from '../session/icon'; import { SpacerXS, Text } from '../basic/Text'; import { ReadableMessage } from './ReadableMessage'; @@ -35,7 +35,7 @@ export const DataExtractionNotification = (props: PropsForDataExtractionNotifica diff --git a/ts/components/conversation/ExpireTimer.tsx b/ts/components/conversation/ExpireTimer.tsx index 6262f4909..a3fb21357 100644 --- a/ts/components/conversation/ExpireTimer.tsx +++ b/ts/components/conversation/ExpireTimer.tsx @@ -3,7 +3,7 @@ import React, { useCallback, useState } from 'react'; import { getTimerBucketIcon } from '../../util/timer'; import { useInterval } from '../../hooks/useInterval'; import styled, { useTheme } from 'styled-components'; -import { SessionIcon, SessionIconSize } from '../session/icon'; +import { SessionIcon } from '../session/icon'; type Props = { expirationLength: number; @@ -66,12 +66,7 @@ export const ExpireTimer = (props: Props) => { return ( - + ); }; diff --git a/ts/components/conversation/GroupInvitation.tsx b/ts/components/conversation/GroupInvitation.tsx index 85a34c509..8c889d672 100644 --- a/ts/components/conversation/GroupInvitation.tsx +++ b/ts/components/conversation/GroupInvitation.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import { SessionIconButton, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIconButton, SessionIconType } from '../session/icon'; import { useTheme } from 'styled-components'; import { PropsForGroupInvitation } from '../../state/ducks/conversations'; import { acceptOpenGroupInvitation } from '../../interactions/messageInteractions'; @@ -30,7 +30,7 @@ export const GroupInvitation = (props: PropsForGroupInvitation) => { iconType={SessionIconType.Plus} iconColor={theme.colors.accent} theme={theme} - iconSize={SessionIconSize.Large} + iconSize={'large'} onClick={() => { acceptOpenGroupInvitation(props.acceptUrl, props.serverName); }} diff --git a/ts/components/conversation/H5AudioPlayer.tsx b/ts/components/conversation/H5AudioPlayer.tsx index 463bd801c..d4c0b55fa 100644 --- a/ts/components/conversation/H5AudioPlayer.tsx +++ b/ts/components/conversation/H5AudioPlayer.tsx @@ -10,7 +10,7 @@ import { getSortedMessagesOfSelectedConversation, } from '../../state/selectors/conversations'; import { getAudioAutoplay } from '../../state/selectors/userConfig'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIcon, SessionIconType } from '../session/icon'; import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton'; export const AudioPlayerWithEncryptedFile = (props: { @@ -110,7 +110,7 @@ export const AudioPlayerWithEncryptedFile = (props: { play: ( @@ -118,7 +118,7 @@ export const AudioPlayerWithEncryptedFile = (props: { pause: ( diff --git a/ts/components/conversation/TimerNotification.tsx b/ts/components/conversation/TimerNotification.tsx index db5458f09..fbb2c10f5 100644 --- a/ts/components/conversation/TimerNotification.tsx +++ b/ts/components/conversation/TimerNotification.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { Intl } from '../Intl'; import { missingCaseError } from '../../util/missingCaseError'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIcon, SessionIconType } from '../session/icon'; import { PropsForExpirationTimer } from '../../state/ducks/conversations'; import { ReadableMessage } from './ReadableMessage'; @@ -48,7 +48,7 @@ export const TimerNotification = (props: PropsForExpirationTimer) => {
diff --git a/ts/components/conversation/message/ClickToTrustSender.tsx b/ts/components/conversation/message/ClickToTrustSender.tsx index 0f7262331..27d72ce0e 100644 --- a/ts/components/conversation/message/ClickToTrustSender.tsx +++ b/ts/components/conversation/message/ClickToTrustSender.tsx @@ -4,7 +4,7 @@ import { getMessageById, getMessagesByConversation } from '../../../data/data'; import { getConversationController } from '../../../session/conversations'; import { AttachmentDownloads } from '../../../session/utils'; import { updateConfirmModal } from '../../../state/ducks/modalDialog'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../../session/icon'; +import { SessionIcon, SessionIconType } from '../../session/icon'; import { SessionButtonColor } from '../../session/SessionButton'; const StyledTrustSenderUI = styled.div` @@ -83,7 +83,7 @@ export const ClickToTrustSender = (props: { messageId: string }) => { return ( - + {window.i18n('clickToTrustContact')} ); diff --git a/ts/components/conversation/message/MessagePreview.tsx b/ts/components/conversation/message/MessagePreview.tsx index 085340275..f189a847e 100644 --- a/ts/components/conversation/message/MessagePreview.tsx +++ b/ts/components/conversation/message/MessagePreview.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React from 'react'; import { isImageAttachment } from '../../../types/Attachment'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../../session/icon'; +import { SessionIcon, SessionIconType } from '../../session/icon'; import { ImageGrid } from '../ImageGrid'; import { Image } from '../Image'; import { MINIMUM_LINK_PREVIEW_IMAGE_WIDTH } from '../Message'; @@ -63,7 +63,7 @@ export const MessagePreview = (props: Props) => {
- +
diff --git a/ts/components/conversation/message/OutgoingMessageStatus.tsx b/ts/components/conversation/message/OutgoingMessageStatus.tsx index 8285d834c..8c9ea38bd 100644 --- a/ts/components/conversation/message/OutgoingMessageStatus.tsx +++ b/ts/components/conversation/message/OutgoingMessageStatus.tsx @@ -1,7 +1,7 @@ import React from 'react'; import styled, { useTheme } from 'styled-components'; import { MessageDeliveryStatus } from '../../../models/messageType'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../../session/icon'; +import { SessionIcon, SessionIconType } from '../../session/icon'; const MessageStatusSendingContainer = styled.div` display: inline-block; @@ -17,7 +17,7 @@ const MessageStatusSending = () => { rotateDuration={2} iconColor={iconColor} iconType={SessionIconType.Sending} - iconSize={SessionIconSize.Tiny} + iconSize={'tiny'} /> ); @@ -28,11 +28,7 @@ const MessageStatusSent = () => { return ( - + ); }; @@ -45,7 +41,7 @@ const MessageStatusRead = () => { ); @@ -58,7 +54,7 @@ const MessageStatusError = () => { ); diff --git a/ts/components/dialog/EditProfileDialog.tsx b/ts/components/dialog/EditProfileDialog.tsx index 5b9c63cce..b9047b26e 100644 --- a/ts/components/dialog/EditProfileDialog.tsx +++ b/ts/components/dialog/EditProfileDialog.tsx @@ -6,7 +6,7 @@ import { Avatar, AvatarSize } from '../Avatar'; import { SessionButton, SessionButtonColor, SessionButtonType } from '../session/SessionButton'; -import { SessionIconButton, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIconButton, SessionIconType } from '../session/icon'; import { PillDivider } from '../session/PillDivider'; import { SyncUtils, ToastUtils, UserUtils } from '../../session/utils'; import { MAX_USERNAME_LENGTH } from '../session/registration/RegistrationStages'; @@ -150,7 +150,7 @@ export class EditProfileDialog extends React.Component<{}, State> {
{ this.setState(state => ({ ...state, mode: 'qr' })); @@ -185,7 +185,7 @@ export class EditProfileDialog extends React.Component<{}, State> {

{name}

{ this.setState({ mode: 'edit' }); }} diff --git a/ts/components/dialog/OnionStatusPathDialog.tsx b/ts/components/dialog/OnionStatusPathDialog.tsx index 3804736a2..0775d083a 100644 --- a/ts/components/dialog/OnionStatusPathDialog.tsx +++ b/ts/components/dialog/OnionStatusPathDialog.tsx @@ -18,7 +18,7 @@ import { } from '../../state/selectors/onions'; import { getTheme } from '../../state/selectors/theme'; import { Flex } from '../basic/Flex'; -import { SessionIcon, SessionIconButton, SessionIconSize, SessionIconType } from '../session/icon'; +import { SessionIcon, SessionIconButton, SessionIconType } from '../session/icon'; import { SessionSpinner } from '../session/SessionSpinner'; import { SessionWrapperModal } from '../session/SessionWrapperModal'; @@ -119,12 +119,12 @@ export const ModalStatusLight = (props: StatusLightType) => { return (
@@ -159,7 +159,7 @@ export const ActionPanelOnionStatusLight = (props: { return ( { {showExitIcon ? ( @@ -97,7 +97,7 @@ export class SessionModal extends React.PureComponent { { ) : ( { {label && } {buttonIcon && ( - + )}
diff --git a/ts/components/session/LeftPaneSettingSection.tsx b/ts/components/session/LeftPaneSettingSection.tsx index 7c8b79e6f..f06ed37f0 100644 --- a/ts/components/session/LeftPaneSettingSection.tsx +++ b/ts/components/session/LeftPaneSettingSection.tsx @@ -1,7 +1,7 @@ import React from 'react'; import classNames from 'classnames'; import { SessionButton, SessionButtonColor, SessionButtonType } from './SessionButton'; -import { SessionIcon, SessionIconSize, SessionIconType } from './icon'; +import { SessionIcon, SessionIconType } from './icon'; import { SessionSettingCategory } from './settings/SessionSettings'; import { LeftPaneSectionHeader } from './LeftPaneSectionHeader'; import { useDispatch, useSelector } from 'react-redux'; @@ -61,7 +61,7 @@ const LeftPaneSettingsCategoryRow = (props: { item: any }) => {
{item.id === focusedSettingsSection && ( {
diff --git a/ts/components/session/SessionDropdown.tsx b/ts/components/session/SessionDropdown.tsx index 4c6e0a93f..71f325b0a 100644 --- a/ts/components/session/SessionDropdown.tsx +++ b/ts/components/session/SessionDropdown.tsx @@ -1,7 +1,7 @@ import React, { useContext, useState } from 'react'; import { ThemeContext } from 'styled-components'; -import { SessionIcon, SessionIconSize, SessionIconType } from './icon/'; +import { SessionIcon, SessionIconType } from './icon/'; import { SessionDropdownItem, SessionDropDownItemType } from './SessionDropdownItem'; // THIS IS DROPDOWN ACCORDIAN STYLE OPTIONS SELECTOR ELEMENT, NOT A CONTEXTMENU @@ -38,7 +38,7 @@ export const SessionDropdown = (props: Props) => { {label} diff --git a/ts/components/session/SessionDropdownItem.tsx b/ts/components/session/SessionDropdownItem.tsx index c9c72ba59..209050f7f 100644 --- a/ts/components/session/SessionDropdownItem.tsx +++ b/ts/components/session/SessionDropdownItem.tsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import classNames from 'classnames'; -import { SessionIcon, SessionIconSize, SessionIconType } from './icon/'; +import { SessionIcon, SessionIconType } from './icon/'; import { ThemeContext } from 'styled-components'; export enum SessionDropDownItemType { @@ -38,7 +38,7 @@ export const SessionDropdownItem = (props: Props) => { role="button" onClick={clickHandler} > - {icon ? : ''} + {icon ? : ''}
{content}
); diff --git a/ts/components/session/SessionInput.tsx b/ts/components/session/SessionInput.tsx index 9a9a35196..72d27cf31 100644 --- a/ts/components/session/SessionInput.tsx +++ b/ts/components/session/SessionInput.tsx @@ -1,7 +1,7 @@ import React from 'react'; import classNames from 'classnames'; -import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; +import { SessionIconButton, SessionIconType } from './icon'; import { DefaultTheme } from 'styled-components'; interface Props { @@ -110,7 +110,7 @@ export class SessionInput extends React.PureComponent { return ( { this.setState({ forceShow: !this.state.forceShow, diff --git a/ts/components/session/SessionMemberListItem.tsx b/ts/components/session/SessionMemberListItem.tsx index 64195f174..0c4fb43c9 100644 --- a/ts/components/session/SessionMemberListItem.tsx +++ b/ts/components/session/SessionMemberListItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import classNames from 'classnames'; import { Avatar, AvatarSize } from '../Avatar'; -import { SessionIcon, SessionIconSize, SessionIconType } from './icon'; +import { SessionIcon, SessionIconType } from './icon'; import { Constants } from '../../session'; import { useTheme } from 'styled-components'; import { PubKey } from '../../session/types'; @@ -76,7 +76,7 @@ export const SessionMemberListItem = (props: Props) => { diff --git a/ts/components/session/SessionRegistrationView.tsx b/ts/components/session/SessionRegistrationView.tsx index e78e3bb54..2f2c0e63c 100644 --- a/ts/components/session/SessionRegistrationView.tsx +++ b/ts/components/session/SessionRegistrationView.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { AccentText } from './AccentText'; import { RegistrationStages } from './registration/RegistrationStages'; -import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; +import { SessionIconButton, SessionIconType } from './icon'; import { SessionToastContainer } from './SessionToastContainer'; import { lightTheme, SessionTheme } from '../../state/ducks/SessionTheme'; import { setSignInByLinking } from '../../session/utils/User'; @@ -19,7 +19,7 @@ export const SessionRegistrationView = () => {
{ window.close(); diff --git a/ts/components/session/SessionScrollButton.tsx b/ts/components/session/SessionScrollButton.tsx index 17d1cb6b0..74650363a 100644 --- a/ts/components/session/SessionScrollButton.tsx +++ b/ts/components/session/SessionScrollButton.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'; import styled, { ThemeContext } from 'styled-components'; import { getShowScrollButton } from '../../state/selectors/conversations'; -import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; +import { SessionIconButton, SessionIconType } from './icon'; type Props = { onClick?: () => any; @@ -25,7 +25,7 @@ export const SessionScrollButton = (props: Props) => { { return (
- + onChange(e.target.value)} diff --git a/ts/components/session/SessionToast.tsx b/ts/components/session/SessionToast.tsx index f5a9594ac..314f73383 100644 --- a/ts/components/session/SessionToast.tsx +++ b/ts/components/session/SessionToast.tsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; -import { SessionIcon, SessionIconSize, SessionIconType } from './icon/'; +import { SessionIcon, SessionIconType } from './icon/'; import { Flex } from '../basic/Flex'; import styled, { ThemeContext } from 'styled-components'; import { noop } from 'lodash'; @@ -50,7 +50,7 @@ export const SessionToast = (props: Props) => { const theme = useContext(ThemeContext); const toastDesc = description ? description : ''; - const toastIconSize = toastDesc ? SessionIconSize.Huge : SessionIconSize.Medium; + const toastIconSize = toastDesc ? 'huge' : 'medium'; // Set a custom icon or allow the theme to define the icon let toastIcon = icon || undefined; diff --git a/ts/components/session/SessionWrapperModal.tsx b/ts/components/session/SessionWrapperModal.tsx index 611867f18..29527f3c4 100644 --- a/ts/components/session/SessionWrapperModal.tsx +++ b/ts/components/session/SessionWrapperModal.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useRef } from 'react'; import classNames from 'classnames'; -import { SessionIconButton, SessionIconSize, SessionIconType } from './icon/'; +import { SessionIconButton, SessionIconType } from './icon/'; import { SessionButton } from './SessionButton'; import { useTheme } from 'styled-components'; @@ -86,7 +86,7 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => { {showExitIcon ? ( @@ -100,7 +100,7 @@ export const SessionWrapperModal = (props: SessionWrapperModalType) => { { {typingEnabled && ( )}
diff --git a/ts/components/session/conversation/SessionFileDropzone.tsx b/ts/components/session/conversation/SessionFileDropzone.tsx index fb7c97e44..0cc51bbed 100644 --- a/ts/components/session/conversation/SessionFileDropzone.tsx +++ b/ts/components/session/conversation/SessionFileDropzone.tsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import styled, { ThemeContext } from 'styled-components'; import { Flex } from '../../basic/Flex'; -import { SessionIcon, SessionIconSize, SessionIconType } from '../icon'; +import { SessionIcon, SessionIconType } from '../icon'; const DropZoneContainer = styled.div` display: inline-block; @@ -32,7 +32,7 @@ export const SessionFileDropzone = () => { diff --git a/ts/components/session/conversation/SessionQuotedMessageComposition.tsx b/ts/components/session/conversation/SessionQuotedMessageComposition.tsx index 2b8b93354..5c7dcc81d 100644 --- a/ts/components/session/conversation/SessionQuotedMessageComposition.tsx +++ b/ts/components/session/conversation/SessionQuotedMessageComposition.tsx @@ -1,6 +1,6 @@ import React, { useCallback } from 'react'; import { Flex } from '../../basic/Flex'; -import { SessionIcon, SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; +import { SessionIcon, SessionIconButton, SessionIconType } from '../icon'; import styled, { useTheme } from 'styled-components'; import { getAlt, isAudio } from '../../../types/Attachment'; import { Image } from '../../conversation/Image'; @@ -78,7 +78,7 @@ export const SessionQuotedMessageComposition = () => { {window.i18n('replyingToMessage')} @@ -98,11 +98,7 @@ export const SessionQuotedMessageComposition = () => { )} {hasAudioAttachment && ( - + )} diff --git a/ts/components/session/conversation/SessionRecording.tsx b/ts/components/session/conversation/SessionRecording.tsx index 6f2f77909..5402e03ba 100644 --- a/ts/components/session/conversation/SessionRecording.tsx +++ b/ts/components/session/conversation/SessionRecording.tsx @@ -2,7 +2,7 @@ import React from 'react'; import classNames from 'classnames'; import moment from 'moment'; -import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; +import { SessionIconButton, SessionIconType } from '../icon'; import { Constants } from '../../../session'; import { ToastUtils } from '../../../session/utils'; import autoBind from 'auto-bind'; @@ -130,7 +130,7 @@ class SessionRecordingInner extends React.Component { {isRecording && ( @@ -138,31 +138,28 @@ class SessionRecordingInner extends React.Component { {actionPauseAudio && ( )} {hasRecordingAndPaused && ( )} {hasRecording && ( )} {actionDefault && ( - + )}
@@ -188,7 +185,7 @@ class SessionRecordingInner extends React.Component { > diff --git a/ts/components/session/conversation/SessionRightPanel.tsx b/ts/components/session/conversation/SessionRightPanel.tsx index ec857e717..a40539749 100644 --- a/ts/components/session/conversation/SessionRightPanel.tsx +++ b/ts/components/session/conversation/SessionRightPanel.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; +import { SessionIconButton, SessionIconType } from '../icon'; import { Avatar, AvatarSize } from '../../Avatar'; import { SessionButton, SessionButtonColor, SessionButtonType } from '../SessionButton'; import { SessionDropdown } from '../SessionDropdown'; @@ -136,7 +136,7 @@ const HeaderItem = () => {
{ dispatch(closeRightPanel()); @@ -154,7 +154,7 @@ const HeaderItem = () => { {showInviteContacts && ( { if (selectedConversation) { showInviteContactByConvoId(selectedConversation.id); diff --git a/ts/components/session/icon/Icons.tsx b/ts/components/session/icon/Icons.tsx index 4e0aa2c0e..d97f37747 100644 --- a/ts/components/session/icon/Icons.tsx +++ b/ts/components/session/icon/Icons.tsx @@ -62,14 +62,7 @@ export enum SessionIconType { Timer60 = 'timer60', } -export enum SessionIconSize { - Tiny = 'tiny', - Small = 'small', - Medium = 'medium', - Large = 'large', - Huge = 'huge', - Max = 'max', -} +export type SessionIconSize = 'tiny' | 'small' | 'medium' | 'large' | 'huge' | 'huge2' | 'max'; export const icons = { [SessionIconType.AddUser]: { diff --git a/ts/components/session/icon/SessionIcon.tsx b/ts/components/session/icon/SessionIcon.tsx index 8ab21c4aa..c4055a384 100644 --- a/ts/components/session/icon/SessionIcon.tsx +++ b/ts/components/session/icon/SessionIcon.tsx @@ -21,17 +21,19 @@ const getIconDimensionFromIconSize = (iconSize: SessionIconSize | number) => { return iconSize; } else { switch (iconSize) { - case SessionIconSize.Tiny: + case 'tiny': return 12; - case SessionIconSize.Small: + case 'small': return 15; - case SessionIconSize.Medium: + case 'medium': return 20; - case SessionIconSize.Large: + case 'large': return 25; - case SessionIconSize.Huge: + case 'huge': return 30; - case SessionIconSize.Max: + case 'huge2': + return 40; + case 'max': return 80; default: return 20; @@ -174,9 +176,11 @@ export const SessionIcon = (props: SessionIconProps) => { borderRadius, glowStartDelay, noScale, + backgroundColor, + iconPadding, } = props; let { iconSize, iconRotation } = props; - iconSize = iconSize || SessionIconSize.Medium; + iconSize = iconSize || 'medium'; iconRotation = iconRotation || 0; const themeToUse = theme || useTheme() || lightTheme; @@ -201,6 +205,8 @@ export const SessionIcon = (props: SessionIconProps) => { borderRadius={borderRadius} iconRotation={iconRotation} iconColor={iconColor} + backgroundColor={backgroundColor} + iconPadding={iconPadding} theme={themeToUse} /> ); diff --git a/ts/components/session/icon/SessionIconButton.tsx b/ts/components/session/icon/SessionIconButton.tsx index 3d8638965..b96c88ec2 100644 --- a/ts/components/session/icon/SessionIconButton.tsx +++ b/ts/components/session/icon/SessionIconButton.tsx @@ -26,6 +26,9 @@ const SessionIconButtonInner = (props: SProps) => { glowStartDelay, noScale, isHidden, + backgroundColor, + borderRadius, + iconPadding, } = props; const clickHandler = (e: any) => { if (props.onClick) { @@ -52,6 +55,9 @@ const SessionIconButtonInner = (props: SProps) => { glowDuration={glowDuration} glowStartDelay={glowStartDelay} noScale={noScale} + backgroundColor={backgroundColor} + borderRadius={borderRadius} + iconPadding={iconPadding} /> {Boolean(notificationCount) && }
diff --git a/ts/components/session/settings/SessionSettings.tsx b/ts/components/session/settings/SessionSettings.tsx index 5d37087e8..3986e5942 100644 --- a/ts/components/session/settings/SessionSettings.tsx +++ b/ts/components/session/settings/SessionSettings.tsx @@ -15,13 +15,12 @@ import { hasLinkPreviewPopupBeenDisplayed, } from '../../../../ts/data/data'; import { shell } from 'electron'; -import { SessionConfirmDialogProps } from '../../dialog/SessionConfirm'; import { mapDispatchToProps } from '../../../state/actions'; import { unblockConvoById } from '../../../interactions/conversationInteractions'; import { toggleAudioAutoplay } from '../../../state/ducks/userConfig'; import { sessionPassword, updateConfirmModal } from '../../../state/ducks/modalDialog'; import { PasswordAction } from '../../dialog/SessionPasswordDialog'; -import { SessionIconButton, SessionIconSize, SessionIconType } from '../icon'; +import { SessionIconButton, SessionIconType } from '../icon'; import { ToastUtils } from '../../../session/utils'; export enum SessionSettingCategory { @@ -54,10 +53,6 @@ interface State { shouldLockSettings: boolean | null; } -interface ConfirmationDialogParams extends SessionConfirmDialogProps { - shouldShowConfirm: boolean | undefined; -} - interface LocalSettingType { category: SessionSettingCategory; description: string | undefined; @@ -70,7 +65,6 @@ interface LocalSettingType { type: SessionSettingType | undefined; setFn: any; onClick: any; - confirmationDialogParams: ConfirmationDialogParams | undefined; } class SettingsViewInner extends React.Component { @@ -162,7 +156,6 @@ class SettingsViewInner extends React.Component { onClick={onClickFn} onSliderChange={sliderFn} content={content} - confirmationDialogParams={setting.confirmationDialogParams} /> )}
@@ -258,7 +251,7 @@ class SettingsViewInner extends React.Component { v{window.versionInfo.version} @@ -335,7 +328,6 @@ class SettingsViewInner extends React.Component { content: { defaultValue: true }, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { id: 'spell-check', @@ -348,7 +340,6 @@ class SettingsViewInner extends React.Component { content: { defaultValue: true }, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { id: 'link-preview-setting', @@ -376,7 +367,6 @@ class SettingsViewInner extends React.Component { content: undefined, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { @@ -403,7 +393,6 @@ class SettingsViewInner extends React.Component { content: undefined, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { id: 'audio-message-autoplay-setting', @@ -420,7 +409,6 @@ class SettingsViewInner extends React.Component { }, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { @@ -459,7 +447,6 @@ class SettingsViewInner extends React.Component { ], }, }, - confirmationDialogParams: undefined, }, { id: 'zoom-factor-setting', @@ -479,7 +466,6 @@ class SettingsViewInner extends React.Component { defaultValue: 100, info: (value: number) => `${value}%`, }, - confirmationDialogParams: undefined, }, { id: 'help-translation', @@ -497,7 +483,6 @@ class SettingsViewInner extends React.Component { buttonText: window.i18n('helpUsTranslateSession'), buttonColor: SessionButtonColor.Primary, }, - confirmationDialogParams: undefined, }, { id: 'media-permissions', @@ -510,7 +495,6 @@ class SettingsViewInner extends React.Component { content: undefined, comparisonValue: undefined, onClick: undefined, - confirmationDialogParams: undefined, }, { id: 'read-receipt-setting', @@ -523,7 +507,6 @@ class SettingsViewInner extends React.Component { comparisonValue: undefined, onClick: undefined, content: {}, - confirmationDialogParams: undefined, }, { id: 'typing-indicators-setting', @@ -536,7 +519,6 @@ class SettingsViewInner extends React.Component { comparisonValue: undefined, onClick: undefined, content: {}, - confirmationDialogParams: undefined, }, { id: 'auto-update', @@ -549,7 +531,6 @@ class SettingsViewInner extends React.Component { comparisonValue: undefined, onClick: undefined, content: {}, - confirmationDialogParams: undefined, }, { id: 'set-password', @@ -567,7 +548,6 @@ class SettingsViewInner extends React.Component { onClick: () => { this.displayPasswordModal('set'); }, - confirmationDialogParams: undefined, }, { id: 'change-password', @@ -585,7 +565,6 @@ class SettingsViewInner extends React.Component { onClick: () => { this.displayPasswordModal('change'); }, - confirmationDialogParams: undefined, }, { id: 'remove-password', @@ -603,7 +582,6 @@ class SettingsViewInner extends React.Component { onClick: () => { this.displayPasswordModal('remove'); }, - confirmationDialogParams: undefined, }, ]; } @@ -651,7 +629,6 @@ class SettingsViewInner extends React.Component { }, hidden: false, onClick: undefined, - confirmationDialogParams: undefined, }); } @@ -668,7 +645,6 @@ class SettingsViewInner extends React.Component { setFn: undefined, hidden: false, onClick: undefined, - confirmationDialogParams: undefined, }, ]; } diff --git a/ts/window.d.ts b/ts/window.d.ts index 7b7e58120..183ddee1e 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -5,7 +5,6 @@ import { LibsignalProtocol } from '../../libtextsecure/libsignal-protocol'; import { SignalInterface } from '../../js/modules/signal'; import { LibTextsecure } from '../libtextsecure'; -import { ConfirmationDialogParams } from '../background'; import { Store } from 'redux'; import { DefaultTheme } from 'styled-components';