Fix group issue

This commit is contained in:
Bill 2021-12-09 00:38:56 -05:00
parent 3e4f313f07
commit 6411253bb0
2 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ export const GroupsContainerView: FC<GroupsContainerViewProps> = props =>
useEffect(() => useEffect(() =>
{ {
if(groups.length > 0 && !selectedGroupId) setSelectedGroupId(groups[0].id); if(groups.length > 0 && !selectedGroupId) setSelectedGroupId(groups[0].groupId);
}, [ groups, selectedGroupId ]); }, [ groups, selectedGroupId ]);
useEffect(() => useEffect(() =>
@ -49,9 +49,9 @@ export const GroupsContainerView: FC<GroupsContainerViewProps> = props =>
<div className="h-100 overflow-auto d-flex flex-column gap-1"> <div className="h-100 overflow-auto d-flex flex-column gap-1">
{ groups.map((group, index) => { groups.map((group, index) =>
{ {
return <div key={ index } onClick={ () => setSelectedGroupId(group.id) } className={ 'profile-groups-item position-relative flex-shrink-0 d-flex align-items-center justify-content-center cursor-pointer' + classNames({ ' active': selectedGroupId === group.id }) }> return <div key={ index } onClick={ () => setSelectedGroupId(group.groupId) } className={ 'profile-groups-item position-relative flex-shrink-0 d-flex align-items-center justify-content-center cursor-pointer' + classNames({ ' active': selectedGroupId === group.groupId }) }>
{ itsMe && <i className={ 'position-absolute icon icon-group-' + (group.ownerOrFavorite ? 'favorite' : 'not-favorite') } onClick={ () => favoriteGroup(group.id) } /> } { itsMe && <i className={ 'position-absolute icon icon-group-' + (group.favourite ? 'favorite' : 'not-favorite') } onClick={ () => favoriteGroup(group.groupId) } /> }
<BadgeImageView badgeCode={ group.badge } isGroup={ true } /> <BadgeImageView badgeCode={ group.badgeCode } isGroup={ true } />
</div> </div>
}) } }) }
</div> </div>

View File

@ -1,8 +1,8 @@
import { GroupDataParser } from '@nitrots/nitro-renderer'; import { HabboGroupEntryData } from '@nitrots/nitro-renderer';
export interface GroupsContainerViewProps export interface GroupsContainerViewProps
{ {
itsMe: boolean; itsMe: boolean;
groups: GroupDataParser[]; groups: HabboGroupEntryData[];
onLeaveGroup: () => void; onLeaveGroup: () => void;
} }