diff --git a/src/common/layout/LayoutNotificationBubbleView.tsx b/src/common/layout/LayoutNotificationBubbleView.tsx index 1f6e3ac..0b62a84 100644 --- a/src/common/layout/LayoutNotificationBubbleView.tsx +++ b/src/common/layout/LayoutNotificationBubbleView.tsx @@ -1,6 +1,6 @@ +import { AnimatePresence, motion } from 'framer-motion'; import { FC, useEffect, useMemo, useState } from 'react'; import { Flex, FlexProps } from '../Flex'; -import { TransitionAnimation, TransitionAnimationTypes } from '../transitions'; export interface LayoutNotificationBubbleViewProps extends FlexProps { @@ -45,8 +45,14 @@ export const LayoutNotificationBubbleView: FC }, [ fadesOut, timeoutMs, onClose ]); return ( - - - + + { isVisible && + + + } + ); }; diff --git a/src/components/MainView.tsx b/src/components/MainView.tsx index b86ac44..bfbf443 100644 --- a/src/components/MainView.tsx +++ b/src/components/MainView.tsx @@ -1,6 +1,6 @@ import { AddLinkEventTracker, GetCommunication, HabboWebTools, ILinkEventTracker, RemoveLinkEventTracker, RoomSessionEvent } from '@nitrots/nitro-renderer'; +import { AnimatePresence, motion } from 'framer-motion'; import { FC, useEffect, useState } from 'react'; -import { TransitionAnimation, TransitionAnimationTypes } from '../common'; import { useNitroEvent } from '../hooks'; import { AchievementsView } from './achievements/AchievementsView'; import { AvatarEditorView } from './avatar-editor'; @@ -80,9 +80,15 @@ export const MainView: FC<{}> = props => return ( <> - - - + + { landingViewVisible && + + + } + diff --git a/src/components/room/RoomView.tsx b/src/components/room/RoomView.tsx index e6c3b42..afec584 100644 --- a/src/components/room/RoomView.tsx +++ b/src/components/room/RoomView.tsx @@ -1,4 +1,5 @@ -import { GetRenderer } from '@nitrots/nitro-renderer'; +import { GetRenderer, RoomSession } from '@nitrots/nitro-renderer'; +import { AnimatePresence, motion } from 'framer-motion'; import { FC, useEffect, useRef } from 'react'; import { DispatchMouseEvent, DispatchTouchEvent } from '../../api'; import { useRoom } from '../../hooks'; @@ -13,6 +14,8 @@ export const RoomView: FC<{}> = (props) => useEffect(() => { + if(!roomSession) return; + const canvas = GetRenderer().canvas; if(!canvas) return; @@ -34,19 +37,23 @@ export const RoomView: FC<{}> = (props) => canvas.classList.add('bg-black'); element.appendChild(canvas); - }, []); + }, [roomSession]); - return ( -
- {roomSession && ( - <> - - {roomSession.isSpectator && } - - )} -
+ return ( + + { + +
+ { roomSession instanceof RoomSession && + <> + + { roomSession.isSpectator && } + } +
+
} +
); }; diff --git a/src/components/room/widgets/furniture/FurnitureCraftingView.tsx b/src/components/room/widgets/furniture/FurnitureCraftingView.tsx index b92e86b..580fb1d 100644 --- a/src/components/room/widgets/furniture/FurnitureCraftingView.tsx +++ b/src/components/room/widgets/furniture/FurnitureCraftingView.tsx @@ -14,7 +14,7 @@ export const FurnitureCraftingView: FC<{}> = props => { const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, objectId, RoomObjectCategory.FLOOR); return IsOwnerOfFurniture(roomObject); - }, [ objectId, roomSession.roomId ]); + }, [ objectId, roomSession ]); const canCraft = useMemo(() => { diff --git a/src/components/room/widgets/room-tools/RoomToolsWidgetView.tsx b/src/components/room/widgets/room-tools/RoomToolsWidgetView.tsx index 292536f..962a3ce 100644 --- a/src/components/room/widgets/room-tools/RoomToolsWidgetView.tsx +++ b/src/components/room/widgets/room-tools/RoomToolsWidgetView.tsx @@ -1,9 +1,11 @@ import { CreateLinkEvent, GetGuestRoomResultEvent, GetRoomEngine, NavigatorSearchComposer, RateFlatMessageComposer } from '@nitrots/nitro-renderer'; +import { AnimatePresence, motion } from 'framer-motion'; +import { classNames } from '../../../../layout'; import { FC, useEffect, useState } from 'react'; import { GetConfigurationValue, LocalizeText, SendMessageComposer } from '../../../../api'; -import { Text, TransitionAnimation, TransitionAnimationTypes } from '../../../../common'; +import { Text } from '../../../../common'; import { useMessageEvent, useNavigator, useRoom } from '../../../../hooks'; -import { classNames } from '../../../../layout'; + export const RoomToolsWidgetView: FC<{}> = props => { @@ -33,10 +35,8 @@ export const RoomToolsWidgetView: FC<{}> = props => else { const geometry = GetRoomEngine().getRoomInstanceGeometry(roomSession.roomId, 1); - if(geometry) geometry.performZoom(); } - return !prevValue; }); return; @@ -59,7 +59,6 @@ export const RoomToolsWidgetView: FC<{}> = props => useMessageEvent(GetGuestRoomResultEvent, event => { const parser = event.getParser(); - if(!parser.roomEnter || (parser.data.roomId !== roomSession.roomId)) return; if(roomName !== parser.data.roomName) setRoomName(parser.data.roomName); @@ -70,9 +69,7 @@ export const RoomToolsWidgetView: FC<{}> = props => useEffect(() => { setIsOpen(true); - const timeout = setTimeout(() => setIsOpen(false), 5000); - return () => clearTimeout(timeout); }, [ roomName, roomOwner, roomTags ]); @@ -86,21 +83,40 @@ export const RoomToolsWidgetView: FC<{}> = props =>
handleToolClick('like_room') } /> }
- -
-
-
- { roomName } - { roomOwner } + + { isOpen && + +
+
+
+ { roomName } + { roomOwner } +
+ { roomTags && roomTags.length > 0 && +
+ { roomTags.map((tag, index) => ( + handleToolClick('navigator_search_tag', tag) } + > + #{ tag } + + )) } +
} +
- { roomTags && roomTags.length > 0 && -
- { roomTags.map((tag, index) => handleToolClick('navigator_search_tag', tag) }>#{ tag }) } -
} -
-
- + } +
); -}; +}; \ No newline at end of file diff --git a/src/components/toolbar/ToolbarMeView.tsx b/src/components/toolbar/ToolbarMeView.tsx index 6df6d5b..c7e6a35 100644 --- a/src/components/toolbar/ToolbarMeView.tsx +++ b/src/components/toolbar/ToolbarMeView.tsx @@ -4,14 +4,11 @@ import { DispatchUiEvent, GetConfigurationValue, GetRoomSession, GetUserProfile import { Flex, LayoutItemCountView } from '../../common'; import { GuideToolEvent } from '../../events'; -interface ToolbarMeViewProps -{ +export const ToolbarMeView: FC>; -} - -export const ToolbarMeView: FC> = props => +}>> = props => { const { useGuideTool = false, unseenAchievementCount = 0, setMeExpanded = null, children = null, ...rest } = props; const elementRef = useRef(); diff --git a/src/components/toolbar/ToolbarView.tsx b/src/components/toolbar/ToolbarView.tsx index 150425c..27e6a4a 100644 --- a/src/components/toolbar/ToolbarView.tsx +++ b/src/components/toolbar/ToolbarView.tsx @@ -1,7 +1,8 @@ import { CreateLinkEvent, Dispose, DropBounce, EaseOut, GetSessionDataManager, JumpBy, Motions, NitroToolbarAnimateIconEvent, PerkAllowancesMessageEvent, PerkEnum, Queue, Wait } from '@nitrots/nitro-renderer'; +import { AnimatePresence, motion } from 'framer-motion'; import { FC, useState } from 'react'; import { GetConfigurationValue, MessengerIconState, OpenMessengerChat, VisitDesktop } from '../../api'; -import { Flex, LayoutAvatarImageView, LayoutItemCountView, TransitionAnimation, TransitionAnimationTypes } from '../../common'; +import { Flex, LayoutAvatarImageView, LayoutItemCountView } from '../../common'; import { useAchievements, useFriends, useInventoryUnseenTracker, useMessageEvent, useMessenger, useNitroEvent, useSessionInfo } from '../../hooks'; import { ToolbarItemView } from './ToolbarItemView'; import { ToolbarMeView } from './ToolbarMeView'; @@ -64,13 +65,18 @@ export const ToolbarView: FC<{ isInRoom: boolean }> = props => return ( <> - - - + { isMeExpanded && ( + + )} + - setMeExpanded(!isMeExpanded) }> + + { + setMeExpanded(!isMeExpanded); + event.stopPropagation(); + } }> { (getTotalUnseen > 0) && } diff --git a/src/hooks/rooms/widgets/useAvatarInfoWidget.ts b/src/hooks/rooms/widgets/useAvatarInfoWidget.ts index f0421f9..f1f427d 100644 --- a/src/hooks/rooms/widgets/useAvatarInfoWidget.ts +++ b/src/hooks/rooms/widgets/useAvatarInfoWidget.ts @@ -346,6 +346,8 @@ const useAvatarInfoWidgetState = () => useEffect(() => { + if(!roomSession) return; + roomSession.isDecorating = isDecorating; }, [ roomSession, isDecorating ]);