From 742ca4b54846c4a47c69c55df9de267c113717fc Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 12 Jun 2021 18:19:59 -0300 Subject: [PATCH] Toolbar updates --- src/views/toolbar/ToolbarView.tsx | 5 +++-- src/views/toolbar/me/ToolbarMeView.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/toolbar/ToolbarView.tsx b/src/views/toolbar/ToolbarView.tsx index 49e85ce4..6ab6a57e 100644 --- a/src/views/toolbar/ToolbarView.tsx +++ b/src/views/toolbar/ToolbarView.tsx @@ -1,6 +1,6 @@ import { UserInfoEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/user/data/UserInfoEvent'; import { UserInfoDataParser } from 'nitro-renderer/src/nitro/communication/messages/parser/user/data/UserInfoDataParser'; -import { useCallback, useState } from 'react'; +import { FC, useCallback, useState } from 'react'; import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent } from '../../events'; import { dispatchUiEvent } from '../../hooks/events/ui/ui-event'; import { CreateMessageHook } from '../../hooks/messages/message-event'; @@ -10,7 +10,7 @@ import { AvatarImageView } from '../avatar-image/AvatarImageView'; import { ToolbarMeView } from './me/ToolbarMeView'; import { ToolbarViewItems, ToolbarViewProps } from './ToolbarView.types'; -export function ToolbarView(props: ToolbarViewProps): JSX.Element +export const ToolbarView: FC = props => { const { isInRoom } = props; @@ -46,6 +46,7 @@ export function ToolbarView(props: ToolbarViewProps): JSX.Element return; case ToolbarViewItems.CLOTHING_ITEM: dispatchUiEvent(new AvatarEditorEvent(AvatarEditorEvent.TOGGLE_EDITOR)); + setMeExpanded(false); return; } }, []); diff --git a/src/views/toolbar/me/ToolbarMeView.tsx b/src/views/toolbar/me/ToolbarMeView.tsx index 48564dfd..31cc71ab 100644 --- a/src/views/toolbar/me/ToolbarMeView.tsx +++ b/src/views/toolbar/me/ToolbarMeView.tsx @@ -1,9 +1,9 @@ import { MouseEventType } from 'nitro-renderer'; -import { useEffect, useRef } from 'react'; +import { FC, useEffect, useRef } from 'react'; import { ToolbarViewItems } from '../ToolbarView.types'; import { ToolbarMeViewProps } from './ToolbarMeView.types'; -export function ToolbarMeView(props: ToolbarMeViewProps): JSX.Element +export const ToolbarMeView: FC = props => { const { setMeExpanded = null, handleToolbarItemClick = null } = props;