mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 22:40:50 +01:00
Add check for decorate mode button
This commit is contained in:
parent
b107c2b713
commit
e94cdbf4be
@ -1,5 +1,5 @@
|
|||||||
import { AvatarAction, AvatarExpressionEnum, RoomObjectCategory, UserProfileComposer } from '@nitrots/nitro-renderer';
|
import { AvatarAction, AvatarExpressionEnum, RoomControllerLevel, RoomObjectCategory, UserProfileComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useState } from 'react';
|
import { FC, useCallback, useMemo, useState } from 'react';
|
||||||
import { GetCanStandUp, GetCanUseExpression, GetOwnPosture, HasHabboClub, HasHabboVip, IsRidingHorse, LocalizeText, RoomWidgetAvatarExpressionMessage, RoomWidgetChangePostureMessage, RoomWidgetDanceMessage, RoomWidgetMessage, RoomWidgetUpdateDecorateModeEvent, RoomWidgetUserActionMessage } from '../../../../../../api';
|
import { GetCanStandUp, GetCanUseExpression, GetOwnPosture, HasHabboClub, HasHabboVip, IsRidingHorse, LocalizeText, RoomWidgetAvatarExpressionMessage, RoomWidgetChangePostureMessage, RoomWidgetDanceMessage, RoomWidgetMessage, RoomWidgetUpdateDecorateModeEvent, RoomWidgetUserActionMessage } from '../../../../../../api';
|
||||||
import { AvatarEditorEvent } from '../../../../../../events';
|
import { AvatarEditorEvent } from '../../../../../../events';
|
||||||
import { dispatchUiEvent, SendMessageHook } from '../../../../../../hooks';
|
import { dispatchUiEvent, SendMessageHook } from '../../../../../../hooks';
|
||||||
@ -108,6 +108,11 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
|
|||||||
SendMessageHook(new UserProfileComposer(userData.webID));
|
SendMessageHook(new UserProfileComposer(userData.webID));
|
||||||
}, [ userData ]);
|
}, [ userData ]);
|
||||||
|
|
||||||
|
const isShowDecorate = useMemo(() =>
|
||||||
|
{
|
||||||
|
return (userData.amIOwner || userData.amIAnyRoomController || (userData.roomControllerLevel > RoomControllerLevel.GUEST));
|
||||||
|
}, [ userData ]);
|
||||||
|
|
||||||
const isRidingHorse = IsRidingHorse();
|
const isRidingHorse = IsRidingHorse();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -121,9 +126,10 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
|
|||||||
<ContextMenuListItemView onClick={ event => processAction('change_name') }>
|
<ContextMenuListItemView onClick={ event => processAction('change_name') }>
|
||||||
{ LocalizeText('widget.avatar.change_name') }
|
{ LocalizeText('widget.avatar.change_name') }
|
||||||
</ContextMenuListItemView> }
|
</ContextMenuListItemView> }
|
||||||
<ContextMenuListItemView onClick={ event => processAction('decorate') }>
|
{ isShowDecorate &&
|
||||||
{ LocalizeText('widget.avatar.decorate') }
|
<ContextMenuListItemView onClick={ event => processAction('decorate') }>
|
||||||
</ContextMenuListItemView>
|
{ LocalizeText('widget.avatar.decorate') }
|
||||||
|
</ContextMenuListItemView> }
|
||||||
<ContextMenuListItemView onClick={ event => processAction('change_looks') }>
|
<ContextMenuListItemView onClick={ event => processAction('change_looks') }>
|
||||||
{ LocalizeText('widget.memenu.myclothes') }
|
{ LocalizeText('widget.memenu.myclothes') }
|
||||||
</ContextMenuListItemView>
|
</ContextMenuListItemView>
|
||||||
|
Loading…
Reference in New Issue
Block a user