diff --git a/src/app/components/UserRoomProfileRenderer.tsx b/src/app/components/UserRoomProfileRenderer.tsx index c12a4bfc..ca7aa837 100644 --- a/src/app/components/UserRoomProfileRenderer.tsx +++ b/src/app/components/UserRoomProfileRenderer.tsx @@ -10,7 +10,7 @@ import { SpaceProvider } from '../hooks/useSpace'; import { RoomProvider } from '../hooks/useRoom'; function UserRoomProfileContextMenu({ state }: { state: UserRoomProfileState }) { - const { roomId, spaceId, userId, cords } = state; + const { roomId, spaceId, userId, cords, position } = state; const allJoinedRooms = useAllJoinedRoomsSet(); const getRoom = useGetRoom(allJoinedRooms); const room = getRoom(roomId); @@ -23,7 +23,7 @@ function UserRoomProfileContextMenu({ state }: { state: UserRoomProfileState }) return ( { @@ -24,14 +24,15 @@ type OpenCallback = ( roomId: string, spaceId: string | undefined, userId: string, - cords: RectCords + cords: RectCords, + position?: Position ) => void; export const useOpenUserRoomProfile = (): OpenCallback => { const setUserRoomProfile = useSetAtom(userRoomProfileAtom); const open: OpenCallback = useCallback( - (roomId, spaceId, userId, cords) => { - setUserRoomProfile({ roomId, spaceId, userId, cords }); + (roomId, spaceId, userId, cords, position) => { + setUserRoomProfile({ roomId, spaceId, userId, cords, position }); }, [setUserRoomProfile] ); diff --git a/src/app/state/userRoomProfile.ts b/src/app/state/userRoomProfile.ts index bbad8f02..cf4e403a 100644 --- a/src/app/state/userRoomProfile.ts +++ b/src/app/state/userRoomProfile.ts @@ -1,4 +1,4 @@ -import { RectCords } from 'folds'; +import { Position, RectCords } from 'folds'; import { atom } from 'jotai'; export type UserRoomProfileState = { @@ -6,6 +6,7 @@ export type UserRoomProfileState = { roomId: string; spaceId?: string; cords: RectCords; + position?: Position; }; export const userRoomProfileAtom = atom(undefined);