feat: add thread functionality to room features
- Enhance RoomInput to support sending messages as replies in threads by adding `threadRootId` prop. - Update RoomTimeline to manage active thread state and handle opening threads. - Implement ThreadView component to display thread messages and input. - Create HomeThreadsCategory to list threads user has participated in. - Introduce activeThreadIdAtomFamily to manage active thread state across rooms.
This commit is contained in:
11
src/app/state/activeThread.ts
Normal file
11
src/app/state/activeThread.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomFamily } from 'jotai/utils';
|
||||
|
||||
/** Stores the active thread root event ID for a given room. `undefined` means no thread is open. */
|
||||
const createActiveThreadAtom = () => atom<string | undefined>(undefined);
|
||||
|
||||
export type TActiveThreadAtom = ReturnType<typeof createActiveThreadAtom>;
|
||||
|
||||
export const activeThreadIdAtomFamily = atomFamily<string, TActiveThreadAtom>(
|
||||
createActiveThreadAtom
|
||||
);
|
||||
Reference in New Issue
Block a user