diff --git a/src/views/navigator/views/room-info/NavigatorRoomInfoView.tsx b/src/views/navigator/views/room-info/NavigatorRoomInfoView.tsx index 82cbabb1..62e789f7 100644 --- a/src/views/navigator/views/room-info/NavigatorRoomInfoView.tsx +++ b/src/views/navigator/views/room-info/NavigatorRoomInfoView.tsx @@ -8,6 +8,7 @@ import { dispatchUiEvent } from '../../../../hooks/events'; import { SendMessageHook } from '../../../../hooks/messages'; import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../layout'; import { BadgeImageView } from '../../../shared/badge-image/BadgeImageView'; +import { UserProfileIconView } from '../../../shared/user-profile-icon/UserProfileIconView'; import { useNavigatorContext } from '../../context/NavigatorContext'; import { NavigatorActions } from '../../reducers/NavigatorReducer'; import { NavigatorRoomInfoViewProps } from './NavigatorRoomInfoView.types'; @@ -110,7 +111,7 @@ export const NavigatorRoomInfoView: FC = props => { roomInfoData.enteredGuestRoom.showOwner && <>
{ LocalizeText('navigator.roomownercaption') }
- +
{ roomInfoData.enteredGuestRoom.ownerName }
} diff --git a/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx b/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx index 25266e60..8e88af87 100644 --- a/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx +++ b/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx @@ -1,6 +1,7 @@ -import { RoomControllerLevel, RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer'; +import { RoomControllerLevel, RoomObjectCategory, RoomObjectVariable, UserProfileComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { GetOwnRoomObject, LocalizeText, RoomWidgetMessage, RoomWidgetUserActionMessage } from '../../../../../../api'; +import { SendMessageHook } from '../../../../../../hooks'; import { useRoomContext } from '../../../../context/RoomContext'; import { ContextMenuView } from '../../../context-menu/ContextMenuView'; import { ContextMenuHeaderView } from '../../../context-menu/views/header/ContextMenuHeaderView'; @@ -191,9 +192,14 @@ export const AvatarInfoWidgetAvatarView: FC = p return flag; }, []); + const openProfile = useCallback(() => + { + SendMessageHook(new UserProfileComposer(userData.webID)); + }, [ userData ]); + return ( - + openProfile() }> { userData.name } { (mode === MODE_NORMAL) && diff --git a/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx b/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx index 06faeb8e..c5555ec3 100644 --- a/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx +++ b/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx @@ -1,8 +1,8 @@ -import { AvatarAction, AvatarExpressionEnum, RoomObjectCategory } from '@nitrots/nitro-renderer'; +import { AvatarAction, AvatarExpressionEnum, RoomObjectCategory, UserProfileComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useState } from 'react'; import { GetCanStandUp, GetCanUseExpression, GetOwnPosture, HasHabboClub, HasHabboVip, IsRidingHorse, LocalizeText, RoomWidgetAvatarExpressionMessage, RoomWidgetChangePostureMessage, RoomWidgetDanceMessage, RoomWidgetMessage, RoomWidgetUserActionMessage } from '../../../../../../api'; import { AvatarEditorEvent } from '../../../../../../events'; -import { dispatchUiEvent } from '../../../../../../hooks'; +import { dispatchUiEvent, SendMessageHook } from '../../../../../../hooks'; import { CurrencyIcon } from '../../../../../shared/currency-icon/CurrencyIcon'; import { useRoomContext } from '../../../../context/RoomContext'; import { ContextMenuView } from '../../../context-menu/ContextMenuView'; @@ -102,12 +102,17 @@ export const AvatarInfoWidgetOwnAvatarView: FC + { + SendMessageHook(new UserProfileComposer(userData.webID)); + }, [ userData ]); const isRidingHorse = IsRidingHorse(); return ( - + openProfile() }> { userData.name } { (mode === MODE_NORMAL) && diff --git a/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.tsx b/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.tsx index e8991af2..2a1adf1f 100644 --- a/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.tsx +++ b/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.tsx @@ -3,10 +3,10 @@ import { ContextMenuHeaderViewProps } from './ContextMenuHeaderView.types'; export const ContextMenuHeaderView: FC = props => { - const { children = null } = props; + const { className = null, onClick = null, children = null } = props; return ( -
+
{ children }
); diff --git a/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.types.ts b/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.types.ts index 65bfa25e..11d98094 100644 --- a/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.types.ts +++ b/src/views/room/widgets/context-menu/views/header/ContextMenuHeaderView.types.ts @@ -1,4 +1,5 @@ export interface ContextMenuHeaderViewProps { - + className?: string; + onClick?: (e) => void; } diff --git a/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx b/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx index 6e8a3ace..d68bd6a8 100644 --- a/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx +++ b/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx @@ -1,10 +1,11 @@ -import { CrackableDataType, RoomControllerLevel, RoomObjectCategory, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, StringDataType } from '@nitrots/nitro-renderer'; +import { CrackableDataType, RoomControllerLevel, RoomObjectCategory, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter, RoomWidgetFurniInfoUsagePolicyEnum, SetObjectDataMessageComposer, StringDataType, UserProfileComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { CreateLinkEvent, GetRoomEngine, LocalizeText, RoomWidgetFurniActionMessage } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; import { LimitedEditionCompactPlateView } from '../../../../../shared/limited-edition/compact-plate/LimitedEditionCompactPlateView'; import { RarityLevelView } from '../../../../../shared/rarity-level/RarityLevelView'; +import { UserProfileIconView } from '../../../../../shared/user-profile-icon/UserProfileIconView'; import { useRoomContext } from '../../../../context/RoomContext'; import { InfoStandBaseView } from '../base/InfoStandBaseView'; import { InfoStandWidgetFurniViewProps } from './InfoStandWidgetFurniView.types'; @@ -222,6 +223,11 @@ export const InfoStandWidgetFurniView: FC = props widgetHandler.processWidgetMessage(new RoomWidgetFurniActionMessage(messageType, furniData.id, furniData.category, furniData.purchaseOfferId, objectData)); }, [ widgetHandler, furniData, pickupMode, customKeys, customValues, getFurniSettingsAsString ]); + const openProfile = useCallback(() => + { + SendMessageHook(new UserProfileComposer(furniData.ownerId)); + }, [ furniData ]); + if(!furniData) return null; return ( @@ -243,7 +249,7 @@ export const InfoStandWidgetFurniView: FC = props
{ furniData.description }

- +
{ LocalizeText('furni.owner', [ 'name' ], [ furniData.ownerName ]) }
{ (furniData.purchaseOfferId > 0) && } diff --git a/src/views/room/widgets/infostand/views/pet/InfoStandWidgetPetView.tsx b/src/views/room/widgets/infostand/views/pet/InfoStandWidgetPetView.tsx index c0d0b54b..0de4f613 100644 --- a/src/views/room/widgets/infostand/views/pet/InfoStandWidgetPetView.tsx +++ b/src/views/room/widgets/infostand/views/pet/InfoStandWidgetPetView.tsx @@ -1,6 +1,7 @@ import { FC } from 'react'; import { LocalizeText } from '../../../../../../api'; import { PetImageView } from '../../../../../shared/pet-image/PetImageView'; +import { UserProfileIconView } from '../../../../../shared/user-profile-icon/UserProfileIconView'; import { InfoStandBaseView } from '../base/InfoStandBaseView'; import { InfoStandWidgetPetViewProps } from './InfoStandWidgetPetView.types'; @@ -46,7 +47,7 @@ export const InfoStandWidgetPetView: FC = props =>
{ LocalizeText('pet.age', ['age'], [petData.age.toString()]) }

- +
{ LocalizeText('infostand.text.petowner', ['name'], [petData.ownerName]) }
diff --git a/src/views/room/widgets/infostand/views/rentable-bot/InfoStandWidgetRentableBotView.tsx b/src/views/room/widgets/infostand/views/rentable-bot/InfoStandWidgetRentableBotView.tsx index 3b72705e..896098aa 100644 --- a/src/views/room/widgets/infostand/views/rentable-bot/InfoStandWidgetRentableBotView.tsx +++ b/src/views/room/widgets/infostand/views/rentable-bot/InfoStandWidgetRentableBotView.tsx @@ -4,6 +4,7 @@ import { LocalizeText } from '../../../../../../api'; import { SendMessageHook } from '../../../../../../hooks/messages'; import { AvatarImageView } from '../../../../../shared/avatar-image/AvatarImageView'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; +import { UserProfileIconView } from '../../../../../shared/user-profile-icon/UserProfileIconView'; import { BotSkillsEnum } from '../../../avatar-info/common/BotSkillsEnum'; import { InfoStandBaseView } from '../base/InfoStandBaseView'; import { InfoStandWidgetRentableBotViewProps } from './InfoStandWidgetRentableBotView.types'; @@ -25,7 +26,7 @@ export const InfoStandWidgetRentableBotView: FC{ rentableBotData.motto }

- +
{ LocalizeText('infostand.text.botowner', [ 'name' ], [ rentableBotData.ownerName ]) }
{ (rentableBotData.carryItem > 0) && diff --git a/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx b/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx index dac5083a..76c7ed27 100644 --- a/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx +++ b/src/views/room/widgets/infostand/views/user/InfoStandWidgetUserView.tsx @@ -5,6 +5,7 @@ import { CreateMessageHook, SendMessageHook } from '../../../../../../hooks'; import { CreateEventDispatcherHook } from '../../../../../../hooks/events'; import { AvatarImageView } from '../../../../../shared/avatar-image/AvatarImageView'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; +import { UserProfileIconView } from '../../../../../shared/user-profile-icon/UserProfileIconView'; import { RelationshipsContainerView } from '../../../../../user-profile/views/relationships-container/RelationshipsContainerView'; import { useRoomContext } from '../../../../context/RoomContext'; import { InfoStandWidgetUserViewProps } from './InfoStandWidgetUserView.types'; @@ -81,7 +82,10 @@ export const InfoStandWidgetUserView: FC = props =
-
{ userData.name }
+
+ + { userData.name } +

diff --git a/src/views/shared/user-profile-icon/UserProfileIconView.tsx b/src/views/shared/user-profile-icon/UserProfileIconView.tsx index 6d1c2dc6..e2b4ded3 100644 --- a/src/views/shared/user-profile-icon/UserProfileIconView.tsx +++ b/src/views/shared/user-profile-icon/UserProfileIconView.tsx @@ -1,16 +1,18 @@ +import { UserProfileComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback } from 'react'; +import { SendMessageHook } from '../../../hooks'; import { UserProfileIconViewProps } from './UserProfileIconView.types'; export const UserProfileIconView: FC = props => { - const { userId = -1, userName = null } = props; + const { userId = 0, userName = null } = props; const visitProfile = useCallback(() => { + if(userId) SendMessageHook(new UserProfileComposer(userId)); + }, [ userId ]); - }, [ userId, userName ]); - - return ( + return (<> - ); + ); }