mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-21 10:52:36 +01:00
Init Manage group button
This commit is contained in:
parent
01e78e8f38
commit
2ef94ffb02
@ -68,6 +68,8 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
|||||||
SendMessageHook(new GroupInformationComposer(groupInformation.id, false));
|
SendMessageHook(new GroupInformationComposer(groupInformation.id, false));
|
||||||
}, [ groupInformation ]);
|
}, [ groupInformation ]);
|
||||||
|
|
||||||
|
const manageGroup = useCallback(() => {}, []);
|
||||||
|
|
||||||
const getButtonText = useCallback(() =>
|
const getButtonText = useCallback(() =>
|
||||||
{
|
{
|
||||||
if(isRealOwner()) return 'group.manage';
|
if(isRealOwner()) return 'group.manage';
|
||||||
@ -88,12 +90,14 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
|||||||
|
|
||||||
const handleButtonClick = useCallback(() =>
|
const handleButtonClick = useCallback(() =>
|
||||||
{
|
{
|
||||||
|
if(isRealOwner()) return manageGroup();
|
||||||
|
|
||||||
if(groupInformation.type === GroupType.PRIVATE && groupInformation.membershipType === GroupMembershipType.NOT_MEMBER) return;
|
if(groupInformation.type === GroupType.PRIVATE && groupInformation.membershipType === GroupMembershipType.NOT_MEMBER) return;
|
||||||
|
|
||||||
if(groupInformation.membershipType === GroupMembershipType.MEMBER) return tryLeaveGroup();
|
if(groupInformation.membershipType === GroupMembershipType.MEMBER) return tryLeaveGroup();
|
||||||
|
|
||||||
return tryJoinGroup();
|
return tryJoinGroup();
|
||||||
}, [ groupInformation, tryLeaveGroup, tryJoinGroup ]);
|
}, [ groupInformation, tryLeaveGroup, tryJoinGroup, isRealOwner, manageGroup ]);
|
||||||
|
|
||||||
if(!groupInformation) return null;
|
if(!groupInformation) return null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user