|
|
@ -1,6 +1,6 @@
|
|
|
|
import { useGroupIdContext } from '@/context/GroupIdContext';
|
|
|
|
import { useGroupIdContext } from '@/context/GroupIdContext';
|
|
|
|
import React from 'react';
|
|
|
|
import React from 'react';
|
|
|
|
import { useGroupInfo, UserBaseInfo } from 'tailchat-shared';
|
|
|
|
import { useCachedUserInfo, useGroupInfo, UserBaseInfo } from 'tailchat-shared';
|
|
|
|
import { GroupUserPopover } from './GroupUserPopover';
|
|
|
|
import { GroupUserPopover } from './GroupUserPopover';
|
|
|
|
import { PersonalUserPopover } from './PersonalUserPopover';
|
|
|
|
import { PersonalUserPopover } from './PersonalUserPopover';
|
|
|
|
|
|
|
|
|
|
|
@ -13,11 +13,13 @@ export const UserPopover: React.FC<{
|
|
|
|
const groupId = useGroupIdContext();
|
|
|
|
const groupId = useGroupIdContext();
|
|
|
|
const groupInfo = useGroupInfo(groupId);
|
|
|
|
const groupInfo = useGroupInfo(groupId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// refetch user cache
|
|
|
|
|
|
|
|
useCachedUserInfo(props.userInfo._id, true);
|
|
|
|
|
|
|
|
|
|
|
|
if (groupInfo) {
|
|
|
|
if (groupInfo) {
|
|
|
|
return <GroupUserPopover userInfo={props.userInfo} groupInfo={groupInfo} />;
|
|
|
|
return <GroupUserPopover userInfo={props.userInfo} groupInfo={groupInfo} />;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
return <PersonalUserPopover userInfo={props.userInfo} />;
|
|
|
|
return <PersonalUserPopover userInfo={props.userInfo} />;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
UserPopover.displayName = 'UserPopover';
|
|
|
|
UserPopover.displayName = 'UserPopover';
|
|
|
|