mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-31 10:22:36 +01:00
Adds an action for showing the most popular groups
This commit is contained in:
parent
3b806e70d5
commit
674b346de6
@ -17,10 +17,10 @@ interface GroupInformationViewProps extends GridProps
|
|||||||
|
|
||||||
export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
||||||
{
|
{
|
||||||
const { groupInformation = null, onClose = null, overflow = 'hidden', ...rest } = props;
|
const { groupInformation = null, onClose = null, overflow = 'hidden', ...rest } = props;
|
||||||
|
|
||||||
const isRealOwner = (groupInformation && (groupInformation.ownerName === GetSessionDataManager().userName));
|
const isRealOwner = (groupInformation && (groupInformation.ownerName === GetSessionDataManager().userName));
|
||||||
|
|
||||||
const joinGroup = () => (groupInformation && TryJoinGroup(groupInformation.id));
|
const joinGroup = () => (groupInformation && TryJoinGroup(groupInformation.id));
|
||||||
|
|
||||||
const leaveGroup = () =>
|
const leaveGroup = () =>
|
||||||
@ -69,7 +69,7 @@ export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
joinGroup();
|
joinGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,9 +92,12 @@ export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
|||||||
case 'furniture':
|
case 'furniture':
|
||||||
CreateLinkEvent('catalog/open/' + CatalogPageName.GUILD_CUSTOM_FURNI);
|
CreateLinkEvent('catalog/open/' + CatalogPageName.GUILD_CUSTOM_FURNI);
|
||||||
break;
|
break;
|
||||||
|
case 'popular_groups':
|
||||||
|
CreateLinkEvent('navigator/search/groups');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}, [ groupInformation ]);
|
}, [ groupInformation ]);
|
||||||
|
|
||||||
if(!groupInformation) return null;
|
if(!groupInformation) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -131,9 +134,9 @@ export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
|||||||
<Column gap={ 1 }>
|
<Column gap={ 1 }>
|
||||||
<Text small underline pointer onClick={ () => handleAction('homeroom') }>{ LocalizeText('group.linktobase') }</Text>
|
<Text small underline pointer onClick={ () => handleAction('homeroom') }>{ LocalizeText('group.linktobase') }</Text>
|
||||||
<Text small underline pointer onClick={ () => handleAction('furniture') }>{ LocalizeText('group.buyfurni') }</Text>
|
<Text small underline pointer onClick={ () => handleAction('furniture') }>{ LocalizeText('group.buyfurni') }</Text>
|
||||||
<Text small underline pointer>{ LocalizeText('group.showgroups') }</Text>
|
<Text small underline pointer onClick={ () => handleAction('popular_groups') }>{ LocalizeText('group.showgroups') }</Text>
|
||||||
</Column>
|
</Column>
|
||||||
{ (groupInformation.type !== GroupType.PRIVATE) &&
|
{ (groupInformation.type !== GroupType.PRIVATE) &&
|
||||||
<Button disabled={ (groupInformation.membershipType === GroupMembershipType.REQUEST_PENDING) || isRealOwner } onClick={ handleButtonClick }>
|
<Button disabled={ (groupInformation.membershipType === GroupMembershipType.REQUEST_PENDING) || isRealOwner } onClick={ handleButtonClick }>
|
||||||
{ LocalizeText(getButtonText()) }
|
{ LocalizeText(getButtonText()) }
|
||||||
</Button> }
|
</Button> }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user