mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-02-18 18:02:36 +01:00
More restructuring
This commit is contained in:
parent
86fe89934f
commit
8a21e0aaf6
22
src/App.scss
22
src/App.scss
@ -1,4 +1,26 @@
|
||||
$toolbar-me-zindex: 90;
|
||||
$chatinput-zindex: 80;
|
||||
$toolbar-zindex: 70;
|
||||
$rightside-zindex: 69;
|
||||
$notification-center-zindex: 68;
|
||||
$toolbar-memenu-zindex: 60;
|
||||
$roomtools-zindex: 50;
|
||||
$context-menu-zindex: 40;
|
||||
$infostand-zindex: 30;
|
||||
$chat-zindex: 20;
|
||||
$highscore-zindex: 19;
|
||||
|
||||
$grid-bg-color: #CDD3D9;
|
||||
$grid-border-color: $muted;
|
||||
$grid-active-bg-color: #ECECEC;
|
||||
$grid-active-border-color: $white;
|
||||
|
||||
$toolbar-height: 55px;
|
||||
|
||||
.nitro-app {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@import './layout/Layout';
|
||||
@import './views/Styles';
|
||||
|
18
src/App.tsx
18
src/App.tsx
@ -1,15 +1,15 @@
|
||||
import { ConfigurationEvent, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, RoomEngineEvent, WebGL } from 'nitro-renderer';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { FC, useCallback, useMemo, useState } from 'react';
|
||||
import { GetConfiguration } from './api';
|
||||
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
|
||||
import { useLocalizationEvent } from './hooks/events/nitro/localization/localization-event';
|
||||
import { dispatchMainEvent, useMainEvent } from './hooks/events/nitro/main-event';
|
||||
import { useRoomEngineEvent } from './hooks/events/nitro/room/room-engine-event';
|
||||
import { GetConfiguration } from './utils/GetConfiguration';
|
||||
import { AuthView } from './views/auth/AuthView';
|
||||
import { LoadingView } from './views/loading/LoadingView';
|
||||
import { MainView } from './views/main/MainView';
|
||||
|
||||
export function App(): JSX.Element
|
||||
export const App: FC<{}> = props =>
|
||||
{
|
||||
const [ isReady, setIsReady ] = useState(false);
|
||||
const [ isError, setIsError ] = useState(false);
|
||||
@ -21,22 +21,18 @@ export function App(): JSX.Element
|
||||
|
||||
if(!Nitro.instance) Nitro.bootstrap();
|
||||
|
||||
function getPreloadAssetUrls(): string[]
|
||||
const getPreloadAssetUrls = useMemo(() =>
|
||||
{
|
||||
const urls: string[] = [];
|
||||
|
||||
const assetUrls = GetConfiguration<string[]>('preload.assets.urls');
|
||||
|
||||
if(assetUrls && assetUrls.length)
|
||||
{
|
||||
for(const url of assetUrls)
|
||||
{
|
||||
urls.push(Nitro.instance.core.configuration.interpolate(url));
|
||||
}
|
||||
for(const url of assetUrls) urls.push(Nitro.instance.core.configuration.interpolate(url));
|
||||
}
|
||||
|
||||
return urls;
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handler = useCallback((event: NitroEvent) =>
|
||||
{
|
||||
@ -95,7 +91,7 @@ export function App(): JSX.Element
|
||||
setIsReady(true);
|
||||
return;
|
||||
case NitroLocalizationEvent.LOADED:
|
||||
Nitro.instance.core.asset.downloadAssets(getPreloadAssetUrls(), (status: boolean) =>
|
||||
Nitro.instance.core.asset.downloadAssets(getPreloadAssetUrls, (status: boolean) =>
|
||||
{
|
||||
if(status)
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
export * from './avatar';
|
||||
export * from './camera';
|
||||
export * from './GetConfiguration';
|
||||
export * from './GetConnection';
|
||||
export * from './GetTicker';
|
||||
export * from './room';
|
||||
|
@ -1 +0,0 @@
|
||||
@import './draggable-window/DraggableWindow';
|
@ -17,27 +17,4 @@ body {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
$toolbar-me-zindex: 90;
|
||||
$chatinput-zindex: 80;
|
||||
$toolbar-zindex: 70;
|
||||
$rightside-zindex: 69;
|
||||
$notification-center-zindex: 68;
|
||||
$toolbar-memenu-zindex: 60;
|
||||
$roomtools-zindex: 50;
|
||||
$context-menu-zindex: 40;
|
||||
$infostand-zindex: 30;
|
||||
$chat-zindex: 20;
|
||||
$highscore-zindex: 19;
|
||||
|
||||
$grid-bg-color: #CDD3D9;
|
||||
$grid-border-color: $muted;
|
||||
$grid-active-bg-color: #ECECEC;
|
||||
$grid-active-border-color: $white;
|
||||
|
||||
$toolbar-height: 55px;
|
||||
|
||||
@import './utils/Styles';
|
||||
@import './App';
|
||||
@import './hooks/Styles';
|
||||
@import './layout/Layout';
|
||||
@import './views/Styles';
|
||||
|
@ -3,4 +3,5 @@
|
||||
}
|
||||
|
||||
@import './card/NitroCardView';
|
||||
@import './draggable-window/DraggableWindow';
|
||||
@import './loading-spinner/LoadingSpinnerView';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { DraggableWindow } from '../../hooks/draggable-window/DraggableWindow';
|
||||
import { DraggableWindow } from '../draggable-window/DraggableWindow';
|
||||
import { NitroCardContextProvider } from './context/NitroCardContext';
|
||||
import { NitroCardViewProps } from './NitroCardView.types';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FC, MouseEvent, useEffect, useRef } from 'react';
|
||||
import { FC, MouseEvent, useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import Draggable from 'react-draggable';
|
||||
import { DraggableWindowProps } from './DraggableWindow.types';
|
||||
|
||||
@ -6,11 +6,10 @@ const currentWindows: HTMLDivElement[] = [];
|
||||
|
||||
export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
||||
{
|
||||
const { disableDrag = false, noCenter = false } = props;
|
||||
|
||||
const { disableDrag = false, noCenter = false, handle = '.drag-handler', draggableOptions = {}, children = null } = props;
|
||||
const elementRef = useRef<HTMLDivElement>();
|
||||
|
||||
function bringToTop(): void
|
||||
const bringToTop = useCallback(() =>
|
||||
{
|
||||
let zIndex = 400;
|
||||
|
||||
@ -20,9 +19,9 @@ export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
||||
|
||||
existingWindow.style.zIndex = zIndex.toString();
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
function onMouseDown(event: MouseEvent): void
|
||||
const onMouseDown = useCallback((event: MouseEvent) =>
|
||||
{
|
||||
const index = currentWindows.indexOf(elementRef.current);
|
||||
|
||||
@ -41,7 +40,7 @@ export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
||||
}
|
||||
|
||||
bringToTop();
|
||||
}
|
||||
}, [ bringToTop ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -70,22 +69,16 @@ export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
||||
|
||||
if(index >= 0) currentWindows.splice(index, 1);
|
||||
}
|
||||
}, [ elementRef, noCenter ]);
|
||||
}, [ elementRef, noCenter, bringToTop ]);
|
||||
|
||||
function getWindowContent(): JSX.Element
|
||||
const getWindowContent = useMemo(() =>
|
||||
{
|
||||
return (
|
||||
<div ref={ elementRef } className="position-absolute draggable-window" onMouseDownCapture={ onMouseDown }>
|
||||
{ props.children }
|
||||
{ children }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}, [ children, onMouseDown ]);
|
||||
|
||||
if(disableDrag) return getWindowContent();
|
||||
|
||||
return (
|
||||
<Draggable handle={ props.handle } { ...props.draggableOptions }>
|
||||
{ getWindowContent() }
|
||||
</Draggable>
|
||||
);
|
||||
return disableDrag ? getWindowContent : <Draggable handle={ handle } { ...draggableOptions }>{ getWindowContent }</Draggable>;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { ScrollableAreaViewProps } from './ScrollableAreaView.types';
|
||||
|
||||
export const ScrollableAreaView: FC<ScrollableAreaViewProps> = props =>
|
||||
{
|
||||
const { className = null, children = null } = props;
|
||||
const [ height, setHeight ] = useState(0);
|
||||
const elementRef = useRef<HTMLDivElement>();
|
||||
|
||||
const resize = useCallback(() =>
|
||||
{
|
||||
setHeight(elementRef.current.parentElement.clientHeight);
|
||||
}, [ elementRef ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
resize();
|
||||
|
||||
window.addEventListener('resize', resize);
|
||||
|
||||
return () =>
|
||||
{
|
||||
window.removeEventListener('resize', resize);
|
||||
}
|
||||
}, [ resize ]);
|
||||
|
||||
return (
|
||||
<div ref={ elementRef } className={ className } style={ { 'overflowY': 'auto', height } }>
|
||||
{ children }
|
||||
</div>
|
||||
);
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
export interface ScrollableAreaViewProps
|
||||
{
|
||||
className?: string;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export interface IProps
|
||||
{
|
||||
readonly children?: ReactNode;
|
||||
}
|
@ -3,8 +3,8 @@ import { AuthenticationMessageComposer } from 'nitro-renderer';
|
||||
import { AuthenticationEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/handshake/AuthenticationEvent';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import ReCAPTCHA from "react-google-recaptcha";
|
||||
import { GetConfiguration } from '../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages';
|
||||
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||
import { AuthField, AuthViewProps } from './AuthView.types';
|
||||
import { AuthFormView } from './views/form/AuthFormView';
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
import { CatalogPageOfferData, ICatalogPageData, ICatalogPageParser, IFurnitureData, SellablePetPaletteData } from 'nitro-renderer';
|
||||
import { GetRoomEngine } from '../../../api';
|
||||
import { GetProductDataForLocalization } from '../../../api/nitro/session/GetProductDataForLocalization';
|
||||
import { GetConfiguration } from '../../../utils/GetConfiguration';
|
||||
import { GetConfiguration, GetProductDataForLocalization, GetRoomEngine } from '../../../api';
|
||||
|
||||
export interface ICatalogOffers
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { GetConfiguration } from '../../../../utils/GetConfiguration';
|
||||
import { GetConfiguration } from '../../../../api';
|
||||
import { CatalogIconViewProps } from './CatalogIconView.types';
|
||||
|
||||
export const CatalogIconView: FC<CatalogIconViewProps> = props =>
|
||||
|
@ -12,7 +12,7 @@ import { CatalogLayoutSpacesView } from './spaces-new/CatalogLayoutSpacesView';
|
||||
import { CatalogLayoutTrophiesView } from './trophies/CatalogLayoutTrophiesView';
|
||||
import { CatalogLayoutVipBuyView } from './vip-buy/CatalogLayoutVipBuyView';
|
||||
|
||||
export function GetCatalogLayout(pageParser: ICatalogPageParser, roomPreviewer: RoomPreviewer): JSX.Element
|
||||
export const GetCatalogLayout = (pageParser: ICatalogPageParser, roomPreviewer: RoomPreviewer) =>
|
||||
{
|
||||
switch(pageParser.layoutCode)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FC, useCallback, useMemo } from 'react';
|
||||
import { GetConfiguration } from '../../../../../../utils/GetConfiguration';
|
||||
import { GetConfiguration } from '../../../../../../api';
|
||||
import { CatalogLayoutFrontpage4ViewProps } from './CatalogLayoutFrontpage4View.types';
|
||||
|
||||
export const CatalogLayoutFrontpage4View: FC<CatalogLayoutFrontpage4ViewProps> = props =>
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { FurnitureType } from 'nitro-renderer';
|
||||
import { FC, useMemo } from 'react';
|
||||
import { GetRoomEngine, GetSessionDataManager } from '../../../../../api';
|
||||
import { GetConfiguration } from '../../../../../utils/GetConfiguration';
|
||||
import { GetConfiguration, GetRoomEngine, GetSessionDataManager } from '../../../../../api';
|
||||
import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView';
|
||||
import { LimitedEditionStyledNumberView } from '../../../../shared/limited-edition/styled-number/LimitedEditionStyledNumberView';
|
||||
import { ProductTypeEnum } from '../../../common/ProductTypeEnum';
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { CatalogSearchComposer, FurnitureType, MouseEventType } from 'nitro-renderer';
|
||||
import { FC, MouseEvent, useCallback } from 'react';
|
||||
import { GetRoomEngine, GetSessionDataManager } from '../../../../../../api';
|
||||
import { GetConfiguration, GetRoomEngine, GetSessionDataManager } from '../../../../../../api';
|
||||
import { SendMessageHook } from '../../../../../../hooks/messages/message-event';
|
||||
import { GetConfiguration } from '../../../../../../utils/GetConfiguration';
|
||||
import { CatalogSearchResultOfferViewProps } from './CatalogSearchResultOfferView.types';
|
||||
|
||||
export const CatalogSearchResultOfferView: FC<CatalogSearchResultOfferViewProps> = props =>
|
||||
|
@ -5,6 +5,13 @@ export const FriendBarItemView: FC<FriendBarItemViewProps> = props =>
|
||||
{
|
||||
const { friend = null } = props;
|
||||
|
||||
if(!friend)
|
||||
{
|
||||
return (
|
||||
<div>offline</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>{ friend.name }</div>
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FC } from 'react';
|
||||
import { FC, useMemo, useState } from 'react';
|
||||
import { useFriendListContext } from '../../context/FriendListContext';
|
||||
import { FriendBarItemView } from '../friend-bar-item/FriendBarItemView';
|
||||
import { FriendBarViewProps } from './FriendBarView.types';
|
||||
@ -7,13 +7,29 @@ export const FriendBarView: FC<FriendBarViewProps> = props =>
|
||||
{
|
||||
const { friendListState = null } = useFriendListContext();
|
||||
const { friends = null } = friendListState;
|
||||
const [ indexOffset, setIndexOffset ] = useState(0);
|
||||
|
||||
const canDecreaseIndex = useMemo(() =>
|
||||
{
|
||||
if(indexOffset === 0) return false;
|
||||
|
||||
return true;
|
||||
}, [ indexOffset ]);
|
||||
|
||||
const canIncreaseIndex = useMemo(() =>
|
||||
{
|
||||
if(indexOffset === (friends.length - 1)) return false;
|
||||
|
||||
return true;
|
||||
}, [ indexOffset, friends ]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{ friends.map((friend, index) =>
|
||||
{
|
||||
return <FriendBarItemView key={ index } friend={ friend } />
|
||||
})}
|
||||
<div className="d-flex">
|
||||
<button type="button" className="btn btn-sm btn-primary" disabled={ !canDecreaseIndex } onClick={ event => setIndexOffset(indexOffset - 1) }>back</button>
|
||||
<FriendBarItemView friend={ (friends[ indexOffset ] || null) } />
|
||||
<FriendBarItemView friend={ (friends[ indexOffset + 1 ] || null) } />
|
||||
<FriendBarItemView friend={ (friends[ indexOffset + 2 ] || null) } />
|
||||
<button type="button" className="btn btn-sm btn-primary" disabled={ !canIncreaseIndex } onClick={ event => setIndexOffset(indexOffset + 1) }>forward</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Nitro, RoomSessionEvent } from 'nitro-renderer';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetConfiguration } from '../../api';
|
||||
import { useRoomSessionManagerEvent } from '../../hooks/events/nitro/session/room-session-manager-event';
|
||||
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||
import { HotelViewProps } from './HotelView.types';
|
||||
|
||||
export function HotelView(props: HotelViewProps): JSX.Element
|
||||
export const HotelView: FC<HotelViewProps> = props =>
|
||||
{
|
||||
const [ isVisible, setIsVisible ] = useState(true);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { FC } from 'react';
|
||||
import { LoadingViewProps } from './LoadingView.types';
|
||||
|
||||
export function LoadingView(props: LoadingViewProps): JSX.Element
|
||||
export const LoadingView: FC<LoadingViewProps> = props =>
|
||||
{
|
||||
const { isError = false, message = '' } = props;
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { GenericErrorEvent, NavigatorCategoriesComposer, NavigatorMetadataEvent, NavigatorSearchEvent, NavigatorSettingsComposer, RoomDataParser, RoomDoorbellAcceptedEvent, RoomDoorbellEvent, RoomForwardEvent, RoomInfoComposer, RoomInfoEvent, RoomInfoOwnerEvent, UserInfoEvent } from 'nitro-renderer';
|
||||
import { useCallback } from 'react';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { GetRoomSessionManager, GetSessionDataManager } from '../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { useNavigatorContext } from './context/NavigatorContext';
|
||||
import { NavigatorMessageHandlerProps } from './NavigatorMessageHandler.types';
|
||||
import { NavigatorActions } from './reducers/NavigatorReducer';
|
||||
|
||||
export function NavigatorMessageHandler(props: NavigatorMessageHandlerProps): JSX.Element
|
||||
export const NavigatorMessageHandler: FC<NavigatorMessageHandlerProps> = props =>
|
||||
{
|
||||
const { dispatchNavigatorState = null } = useNavigatorContext();
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { UserCurrencyComposer } from 'nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useReducer } from 'react';
|
||||
import { GetConfiguration } from '../../api';
|
||||
import { NotificationCenterEvent } from '../../events';
|
||||
import { dispatchUiEvent } from '../../hooks/events';
|
||||
import { SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { GetConfiguration } from '../../utils/GetConfiguration';
|
||||
import { SetLastCurrencies } from './common/CurrencyHelper';
|
||||
import { PurseContextProvider } from './context/PurseContext';
|
||||
import { CurrencyView } from './currency/CurrencyView';
|
||||
|
@ -1,9 +1,10 @@
|
||||
import { FC } from 'react';
|
||||
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
|
||||
import { LocalizeShortNumber } from '../../../utils/LocalizeShortNumber';
|
||||
import { CurrencyIcon } from '../../shared/currency-icon/CurrencyIcon';
|
||||
import { CurrencyViewProps } from './CurrencyView.types';
|
||||
|
||||
export function CurrencyView(props: CurrencyViewProps): JSX.Element
|
||||
export const CurrencyView: FC<CurrencyViewProps> = props =>
|
||||
{
|
||||
const { currency = null } = props;
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { FC } from 'react';
|
||||
import { PurseView } from '../purse/PurseView';
|
||||
import { RightSideProps } from './RightSideView.types';
|
||||
|
||||
export function RightSideView(props: RightSideProps): JSX.Element
|
||||
export const RightSideView: FC<RightSideProps> = props =>
|
||||
{
|
||||
return (
|
||||
<div className="nitro-right-side">
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { IRoomSession } from 'nitro-renderer';
|
||||
import { IProps } from '../../utils/IProps';
|
||||
|
||||
export interface RoomViewProps extends IProps
|
||||
export interface RoomViewProps
|
||||
{
|
||||
roomSession: IRoomSession;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { NitroRectangle } from 'nitro-renderer';
|
||||
import { FC, useCallback, useRef } from 'react';
|
||||
import { GetRoomEngine } from '../../../../../../api/nitro/room/GetRoomEngine';
|
||||
import { GetRoomSession } from '../../../../../../api/nitro/session/GetRoomSession';
|
||||
import { DraggableWindow } from '../../../../../../hooks/draggable-window/DraggableWindow';
|
||||
import { DraggableWindow } from '../../../../../../layout/draggable-window/DraggableWindow';
|
||||
import { LocalizeText } from '../../../../../../utils/LocalizeText';
|
||||
import { useCameraWidgetContext } from '../../context/CameraWidgetContext';
|
||||
import { CameraWidgetCaptureViewProps } from './CameraWidgetCaptureView.types';
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { FC, MouseEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { GetRoomSession } from '../../../../api';
|
||||
import { SendChatTypingMessage } from '../../../../api/nitro/session/SendChatTypingMessage';
|
||||
import { GetConfiguration } from '../../../../utils/GetConfiguration';
|
||||
import { GetConfiguration, GetRoomSession, SendChatTypingMessage } from '../../../../api';
|
||||
import { LocalizeText } from '../../../../utils/LocalizeText';
|
||||
import { useRoomContext } from '../../context/RoomContext';
|
||||
import { ChatInputMessageType, ChatInputViewProps } from './ChatInputView.types';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { RoomObjectCategory, RoomSessionChatEvent } from 'nitro-renderer';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { FC, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { GetRoomEngine, GetRoomSession } from '../../../../api';
|
||||
import { useRoomSessionManagerEvent } from '../../../../hooks/events/nitro/session/room-session-manager-event';
|
||||
import { useRoomContext } from '../../context/RoomContext';
|
||||
@ -8,7 +8,7 @@ import { ChatWidgetMessageView } from './message/ChatWidgetMessageView';
|
||||
import { ChatBubbleMessage } from './utils/ChatBubbleMessage';
|
||||
import { GetBubbleLocation } from './utils/ChatWidgetUtilities';
|
||||
|
||||
export function ChatWidgetView(props: ChatWidgetViewProps): JSX.Element
|
||||
export const ChatWidgetView: FC<ChatWidgetViewProps> = props =>
|
||||
{
|
||||
const { eventDispatcher = null, widgetHandler = null } = useRoomContext();
|
||||
const [ chatMessages, setChatMessages ] = useState<ChatBubbleMessage[]>([]);
|
||||
|
@ -2,13 +2,13 @@ import { LoveLockFurniFinishedEvent, LoveLockFurniFriendConfirmedEvent, LoveLock
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetRoomSession } from '../../../../../api';
|
||||
import { GetRoomEngine } from '../../../../../api/nitro/room/GetRoomEngine';
|
||||
import { DraggableWindow } from '../../../../../hooks/draggable-window/DraggableWindow';
|
||||
import { CreateEventDispatcherHook } from '../../../../../hooks/events/event-dispatcher.base';
|
||||
import { useRoomEngineEvent } from '../../../../../hooks/events/nitro/room/room-engine-event';
|
||||
import { CreateMessageHook } from '../../../../../hooks/messages/message-event';
|
||||
import { NitroCardContentView } from '../../../../../layout/card/content/NitroCardContentView';
|
||||
import { NitroCardHeaderView } from '../../../../../layout/card/header/NitroCardHeaderView';
|
||||
import { NitroCardView } from '../../../../../layout/card/NitroCardView';
|
||||
import { DraggableWindow } from '../../../../../layout/draggable-window/DraggableWindow';
|
||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||
import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView';
|
||||
import { useRoomContext } from '../../../context/RoomContext';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { NitroEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from 'nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetRoomEngine, GetRoomSession, GetSessionDataManager } from '../../../../../api';
|
||||
import { DraggableWindow } from '../../../../../hooks/draggable-window/DraggableWindow';
|
||||
import { CreateEventDispatcherHook } from '../../../../../hooks/events/event-dispatcher.base';
|
||||
import { useRoomEngineEvent } from '../../../../../hooks/events/nitro/room/room-engine-event';
|
||||
import { DraggableWindow } from '../../../../../layout/draggable-window/DraggableWindow';
|
||||
import { ColorUtils } from '../../../../../utils/ColorUtils';
|
||||
import { useRoomContext } from '../../../context/RoomContext';
|
||||
import { RoomWidgetRoomObjectUpdateEvent } from '../../../events';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { NitroEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from 'nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetRoomEngine } from '../../../../../api';
|
||||
import { DraggableWindow } from '../../../../../hooks/draggable-window/DraggableWindow';
|
||||
import { CreateEventDispatcherHook } from '../../../../../hooks/events/event-dispatcher.base';
|
||||
import { useRoomEngineEvent } from '../../../../../hooks/events/nitro/room/room-engine-event';
|
||||
import { DraggableWindow } from '../../../../../layout/draggable-window/DraggableWindow';
|
||||
import { LocalizeText } from '../../../../../utils/LocalizeText';
|
||||
import { useRoomContext } from '../../../context/RoomContext';
|
||||
import { RoomWidgetRoomObjectUpdateEvent } from '../../../events';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { GetConfiguration } from '../../../utils/GetConfiguration';
|
||||
import { GetConfiguration } from '../../../api';
|
||||
import { BadgeImageViewProps } from './BadgeImageView.types';
|
||||
|
||||
export const BadgeImageView: FC<BadgeImageViewProps> = props =>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FC } from 'react';
|
||||
import { GetConfiguration } from '../../../utils/GetConfiguration';
|
||||
import { GetConfiguration } from '../../../api';
|
||||
import { CurrencyIconProps } from './CurrencyIcon.types';
|
||||
|
||||
export const CurrencyIcon: FC<CurrencyIconProps> = props =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user