From f5e6cbafb2682a779660e77bfaf924a793f3d104 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 24 Mar 2022 15:54:44 -0600 Subject: [PATCH] Step 8.5: Move pinned events custom event type --- .../views/context_menus/MessageContextMenu.tsx | 2 +- .../views/right_panel/PinnedMessagesCard.tsx | 3 +-- src/components/views/right_panel/types.ts | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/components/views/right_panel/types.ts diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index 5adbcb9a9d..cffd83a4e0 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -32,7 +32,7 @@ import SettingsStore from '../../../settings/SettingsStore'; import { isUrlPermitted } from '../../../HtmlUtils'; import { isContentActionable } from '../../../utils/EventUtils'; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from './IconizedContextMenu'; -import { ReadPinsEventId } from "../right_panel/PinnedMessagesCard"; +import { ReadPinsEventId } from "../right_panel/types"; import ForwardDialog from "../dialogs/ForwardDialog"; import { Action } from "../../../dispatcher/actions"; import ReportEventDialog from '../dialogs/ReportEventDialog'; diff --git a/src/components/views/right_panel/PinnedMessagesCard.tsx b/src/components/views/right_panel/PinnedMessagesCard.tsx index 1b110a76c3..def0985863 100644 --- a/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -31,6 +31,7 @@ import { useAsyncMemo } from "../../../hooks/useAsyncMemo"; import PinnedEventTile from "../rooms/PinnedEventTile"; import { useRoomState } from "../../../hooks/useRoomState"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; +import { ReadPinsEventId } from "./types"; interface IProps { room: Room; @@ -56,8 +57,6 @@ export const usePinnedEvents = (room: Room): string[] => { return pinnedEvents; }; -export const ReadPinsEventId = "im.vector.room.read_pins"; - export const useReadPinnedEvents = (room: Room): Set => { const [readPinnedEvents, setReadPinnedEvents] = useState>(new Set()); diff --git a/src/components/views/right_panel/types.ts b/src/components/views/right_panel/types.ts new file mode 100644 index 0000000000..f7a6d60f55 --- /dev/null +++ b/src/components/views/right_panel/types.ts @@ -0,0 +1,17 @@ +/* +Copyright 2022 The Matrix.org Foundation C.I.C. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +export const ReadPinsEventId = "im.vector.room.read_pins";