-
-
-
+ <>
+ { modal ? modal : null}
+
+
-
-
+
+ >
);
};
diff --git a/ts/components/session/LeftPaneSettingSection.tsx b/ts/components/session/LeftPaneSettingSection.tsx
index dd69604a2..1b1a2865f 100644
--- a/ts/components/session/LeftPaneSettingSection.tsx
+++ b/ts/components/session/LeftPaneSettingSection.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useState } from 'react';
import classNames from 'classnames';
import { SessionButton, SessionButtonColor, SessionButtonType } from './SessionButton';
@@ -12,6 +12,7 @@ import { useDispatch, useSelector } from 'react-redux';
import { showSettingsSection } from '../../state/ducks/section';
import { getFocusedSettingsSection } from '../../state/selectors/section';
import { getTheme } from '../../state/selectors/theme';
+import { SessionConfirm } from './SessionConfirm';
type Props = {
settingsCategory: SessionSettingCategory;
@@ -102,21 +103,35 @@ const LeftPaneSettingsCategories = () => {
);
};
-const onDeleteAccount = () => {
+const onDeleteAccount = ( setModal: any) => {
const title = window.i18n('clearAllData');
const message = window.i18n('deleteAccountWarning');
- window.confirmationDialog({
- title,
- message,
- resolve: deleteAccount,
- okTheme: 'danger',
- });
+ // window.confirmationDialog({
+ // title,
+ // message,
+ // resolve: deleteAccount,
+ // okTheme: 'danger',
+ // });
+
+ const clearModal = () => {
+ setModal(null);
+ }
+
+ setModal(
+
)
};
-const LeftPaneBottomButtons = () => {
+const LeftPaneBottomButtons = (props: { setModal: any}) => {
const dangerButtonText = window.i18n('clearAllData');
const showRecoveryPhrase = window.i18n('showRecoveryPhrase');
+ const { setModal } = props;
return (
@@ -124,7 +139,7 @@ const LeftPaneBottomButtons = () => {
text={dangerButtonText}
buttonType={SessionButtonType.SquareOutline}
buttonColor={SessionButtonColor.Danger}
- onClick={onDeleteAccount}
+ onClick={onDeleteAccount(setModal)}
/>
{
);
};
-export const LeftPaneSettingSection = () => {
+export const LeftPaneSettingSection = (props: { setModal: any}) => {
const theme = useSelector(getTheme);
+ const { setModal } = props;
return (
);
diff --git a/ts/components/session/SessionConfirm.tsx b/ts/components/session/SessionConfirm.tsx
index 8c567bdc4..192387d0f 100644
--- a/ts/components/session/SessionConfirm.tsx
+++ b/ts/components/session/SessionConfirm.tsx
@@ -3,24 +3,25 @@ import { SessionModal } from './SessionModal';
import { SessionButton, SessionButtonColor } from './SessionButton';
import { SessionHtmlRenderer } from './SessionHTMLRenderer';
import { SessionIcon, SessionIconSize, SessionIconType } from './icon';
-import { DefaultTheme, withTheme } from 'styled-components';
+import { DefaultTheme, useTheme, withTheme } from 'styled-components';
+import { SessionWrapperModal } from './SessionWrapperModal';
type Props = {
message: string;
- messageSub: string;
+ messageSub?: string;
title: string;
onOk?: any;
onClose?: any;
onClickOk: any;
- onClickClose: any;
+ onClickClose?: any;
okText?: string;
cancelText?: string;
- hideCancel: boolean;
+ hideCancel?: boolean;
okTheme: SessionButtonColor;
- closeTheme: SessionButtonColor;
+ closeTheme?: SessionButtonColor;
sessionIcon?: SessionIconType;
iconSize?: SessionIconSize;
- theme: DefaultTheme;
+ theme?: DefaultTheme;
};
const SessionConfirmInner = (props: Props) => {
@@ -41,6 +42,8 @@ const SessionConfirmInner = (props: Props) => {
const cancelText = props.cancelText || window.i18n('cancel');
const showHeader = !!props.title;
+ const theme = useTheme();
+
const messageSubText = messageSub ? 'session-confirm-main-message' : 'subtle';
return (
@@ -49,14 +52,23 @@ const SessionConfirmInner = (props: Props) => {
onClose={onClickClose}
showExitIcon={false}
showHeader={showHeader}
- theme={props.theme}
+ theme={theme}
>
+
+ {/* */}
+
{!showHeader && }
{sessionIcon && iconSize && (
<>
-
+
>
)}
diff --git a/ts/components/session/menu/ConversationListItemContextMenu.tsx b/ts/components/session/menu/ConversationListItemContextMenu.tsx
index baa098893..e5db0080b 100644
--- a/ts/components/session/menu/ConversationListItemContextMenu.tsx
+++ b/ts/components/session/menu/ConversationListItemContextMenu.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useState } from 'react';
import { animation, Menu } from 'react-contexify';
import { ConversationTypeEnum } from '../../../models/conversation';
@@ -15,6 +15,7 @@ import {
} from './Menu';
export type PropsContextConversationItem = {
+ id: string;
triggerId: string;
type: ConversationTypeEnum;
isMe: boolean;
@@ -38,6 +39,7 @@ export type PropsContextConversationItem = {
export const ConversationListItemContextMenu = (props: PropsContextConversationItem) => {
const {
+ id,
triggerId,
isBlocked,
isMe,
@@ -60,7 +62,12 @@ export const ConversationListItemContextMenu = (props: PropsContextConversationI
const isGroup = type === 'group';
+ const [ modal, setModal ] = useState
(null);
+
return (
+ <>
+ { modal ? modal : null}
+
+ >
);
};
diff --git a/ts/state/ducks/onion.tsx b/ts/state/ducks/onion.tsx
index 0c3a99a3b..5245c4907 100644
--- a/ts/state/ducks/onion.tsx
+++ b/ts/state/ducks/onion.tsx
@@ -29,8 +29,9 @@ const onionSlice = createSlice({
reducers: {
updateOnionPaths(state, action: PayloadAction) {
let newPayload = { snodePath: action.payload };
- let isEqual = JSON.stringify(state, null, 2) == JSON.stringify(newPayload, null, 2);
- return isEqual ? state : newPayload;
+ // let isEqual = JSON.stringify(state, null, 2) == JSON.stringify(newPayload, null, 2);
+ // return isEqual ? state : newPayload;
+ return newPayload;
},
},
});