diff --git a/web/chat/thread-top-bar.react.js b/web/chat/thread-top-bar.react.js
--- a/web/chat/thread-top-bar.react.js
+++ b/web/chat/thread-top-bar.react.js
@@ -14,7 +14,7 @@
import ThreadAvatar from '../avatars/thread-avatar.react.js';
import Button from '../components/button.react.js';
import { InputStateContext } from '../input/input-state.js';
-import MessageResultsModal from '../modals/chat/message-results-modal.react.js';
+import PinnedMessagesModal from '../modals/chat/pinned-messages-modal.react.js';
import MessageSearchModal from '../modals/search/message-search-modal.react.js';
type ThreadTopBarProps = {
@@ -29,9 +29,6 @@
threadMenu = ;
}
- // To allow the pinned messages modal to be re-used by the message search
- // modal, it will be useful to make the modal accept a prop that defines it's
- // name, instead of setting it directly in the modal.
const bannerText = React.useMemo(() => {
if (!threadInfo.pinnedCount || threadInfo.pinnedCount === 0) {
return '';
@@ -46,7 +43,7 @@
const pushThreadPinsModal = React.useCallback(() => {
pushModal(
-
+
,
);
}, [pushModal, inputState, threadInfo, bannerText]);
diff --git a/web/modals/chat/message-results-modal.css b/web/modals/chat/pinned-messages-modal.css
rename from web/modals/chat/message-results-modal.css
rename to web/modals/chat/pinned-messages-modal.css
diff --git a/web/modals/chat/message-results-modal.react.js b/web/modals/chat/pinned-messages-modal.react.js
rename from web/modals/chat/message-results-modal.react.js
rename to web/modals/chat/pinned-messages-modal.react.js
--- a/web/modals/chat/message-results-modal.react.js
+++ b/web/modals/chat/pinned-messages-modal.react.js
@@ -21,13 +21,13 @@
import { type ThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
-import css from './message-results-modal.css';
+import css from './pinned-messages-modal.css';
import MessageResult from '../../components/message-result.react.js';
import LoadingIndicator from '../../loading-indicator.react.js';
import { useSelector } from '../../redux/redux-utils.js';
import Modal from '../modal.react.js';
-type MessageResultsModalProps = {
+type Props = {
+threadInfo: ThreadInfo,
+modalName: string,
};
@@ -36,7 +36,7 @@
fetchPinnedMessageActionTypes,
);
-function MessageResultsModal(props: MessageResultsModalProps): React.Node {
+function PinnedMessagesModal(props: Props): React.Node {
const { threadInfo, modalName } = props;
const { id: threadID } = threadInfo;
const { popModal } = useModalContext();
@@ -159,4 +159,4 @@
);
}
-export default MessageResultsModal;
+export default PinnedMessagesModal;