mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 23:10:28 +03:00
open profile view on left side in member drawer
This commit is contained in:
parent
2f77b3fd85
commit
a44cefedcf
4 changed files with 10 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { useCallback } from 'react';
|
||||
import { useAtomValue, useSetAtom } from 'jotai';
|
||||
import { RectCords } from 'folds';
|
||||
import { Position, RectCords } from 'folds';
|
||||
import { userRoomProfileAtom, UserRoomProfileState } from '../userRoomProfile';
|
||||
|
||||
export const useUserRoomProfileState = (): UserRoomProfileState | undefined => {
|
||||
|
|
@ -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]
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue