diff --git a/src/common/index.scss b/src/common/index.scss index 69f24cbd..b62c340c 100644 --- a/src/common/index.scss +++ b/src/common/index.scss @@ -132,9 +132,6 @@ width: 100%; min-width: 100%; max-width: 100%; - height: 90px; - min-height: 90px; - max-height: 90px; border: none; resize: none; outline: none; diff --git a/src/common/layout/LayoutGiftTagView.tsx b/src/common/layout/LayoutGiftTagView.tsx index 41bb1b2e..0db589b0 100644 --- a/src/common/layout/LayoutGiftTagView.tsx +++ b/src/common/layout/LayoutGiftTagView.tsx @@ -1,4 +1,5 @@ import { FC } from 'react'; +import { Column, Flex, Text } from '..'; import { LocalizeText } from '../../api'; import { LayoutAvatarImageView } from './LayoutAvatarImageView'; @@ -16,18 +17,23 @@ export const LayoutGiftTagView: FC = props => const { figure = null, userName = null, message = null, editable = false, onChange = null } = props; return ( -
+
{ !userName &&
} { figure &&
}
-
- { !editable &&
{ message }
} - { editable && onChange && } - { userName &&
{ LocalizeText('catalog.gift_wrapping_new.message_from', ['name'], [userName]) }
} -
-
+ + + { !editable && + { message } } + { editable && (onChange !== null) && + } + { userName && + { LocalizeText('catalog.gift_wrapping_new.message_from', ['name'], [userName]) } } + + + ); }; diff --git a/src/components/user-profile/UserProfileView.tsx b/src/components/user-profile/UserProfileView.tsx index c8d005f1..9454370a 100644 --- a/src/components/user-profile/UserProfileView.tsx +++ b/src/components/user-profile/UserProfileView.tsx @@ -1,8 +1,8 @@ -import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, UserCurrentBadgesComposer, UserCurrentBadgesEvent, UserProfileEvent, UserProfileParser, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; +import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, RoomEngineObjectEvent, RoomObjectCategory, RoomObjectType, UserCurrentBadgesComposer, UserCurrentBadgesEvent, UserProfileEvent, UserProfileParser, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useState } from 'react'; -import { GetSessionDataManager, GetUserProfile, LocalizeText, SendMessageComposer } from '../../api'; +import { GetRoomSession, GetSessionDataManager, GetUserProfile, LocalizeText, SendMessageComposer } from '../../api'; import { Column, Flex, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../common'; -import { BatchUpdates, UseMessageEventHook } from '../../hooks'; +import { BatchUpdates, UseMessageEventHook, UseRoomEngineEvent } from '../../hooks'; import { BadgesContainerView } from './views/BadgesContainerView'; import { FriendsContainerView } from './views/FriendsContainerView'; import { GroupsContainerView } from './views/GroupsContainerView'; @@ -70,6 +70,21 @@ export const UserProfileView: FC<{}> = props => UseMessageEventHook(UserProfileEvent, onUserProfileEvent); + const onRoomEngineObjectEvent = useCallback((event: RoomEngineObjectEvent) => + { + if(!userProfile) return; + + if(event.category !== RoomObjectCategory.UNIT) return; + + const userData = GetRoomSession().userDataManager.getUserDataByIndex(event.objectId); + + if(userData.type !== RoomObjectType.USER) return; + + GetUserProfile(userData.webID); + }, [ userProfile ]); + + UseRoomEngineEvent(RoomEngineObjectEvent.SELECTED, onRoomEngineObjectEvent); + if(!userProfile) return null; return (