Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33170660
D3252.1768524804.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D3252.1768524804.diff
View Options
diff --git a/web/chat/chat-thread-list-see-more-sidebars.react.js b/web/chat/chat-thread-list-see-more-sidebars.react.js
--- a/web/chat/chat-thread-list-see-more-sidebars.react.js
+++ b/web/chat/chat-thread-list-see-more-sidebars.react.js
@@ -17,10 +17,7 @@
function ChatThreadListSeeMoreSidebars(props: Props): React.Node {
const { unread, showingSidebarsInline, setModal, threadInfo } = props;
const onClick = React.useCallback(
- () =>
- setModal(
- <SidebarListModal setModal={setModal} threadInfo={threadInfo} />,
- ),
+ () => setModal(<SidebarListModal threadInfo={threadInfo} />),
[setModal, threadInfo],
);
const buttonText = showingSidebarsInline ? 'See more...' : 'See sidebars...';
diff --git a/web/modals/chat/sidebar-list-modal.react.js b/web/modals/chat/sidebar-list-modal.react.js
--- a/web/modals/chat/sidebar-list-modal.react.js
+++ b/web/modals/chat/sidebar-list-modal.react.js
@@ -3,6 +3,7 @@
import { faTimesCircle } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
+import invariant from 'invariant';
import * as React from 'react';
import { sidebarInfoSelector } from 'lib/selectors/thread-selectors';
@@ -15,8 +16,13 @@
import { useSelector } from '../../redux/redux-utils';
import globalCSS from '../../style.css';
import { MagnifyingGlass } from '../../vectors.react';
+import { ModalContext } from '../modal-provider.react';
import Modal from '../modal.react';
+type BaseProps = {
+ +threadInfo: ThreadInfo,
+};
+
type Props = {
+setModal: (modal: ?React.Node) => void,
+threadInfo: ThreadInfo,
@@ -141,5 +147,16 @@
</Modal>
);
}
+function ConnectedSidebarListModal(props: BaseProps): React.Node {
+ const { threadInfo } = props;
+ const modalContext = React.useContext(ModalContext);
+ invariant(modalContext, 'modalContext should be set');
-export default SidebarListModal;
+ return (
+ <SidebarListModal
+ setModal={modalContext.setModal}
+ threadInfo={threadInfo}
+ />
+ );
+}
+export default ConnectedSidebarListModal;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 12:53 AM (3 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5941028
Default Alt Text
D3252.1768524804.diff (2 KB)
Attached To
Mode
D3252: [web] [refactor] remove/replace setModal in sidebar list modal
Attached
Detach File
Event Timeline
Log In to Comment