Init Chat widget

This commit is contained in:
Batman 2021-04-21 19:52:06 -03:00
parent 0ffb6b0d47
commit e5d81b7a53
12 changed files with 82 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import { WindowResizeEvent } from '../../api/nitro/room/DispatchResizeEvent';
import { DispatchTouchEvent } from '../../api/nitro/room/DispatchTouchEvent';
import { GetRoomEngine } from '../../api/nitro/room/GetRoomEngine';
import { RoomViewProps } from './RoomView.types';
import { ChatWidgetsView } from './widgets/chat/ChatWidgetsView';
import { FurnitureWidgetsView } from './widgets/furniture/FurnitureWidgetsView';
export function RoomView(props: RoomViewProps): JSX.Element
@ -85,7 +86,10 @@ export function RoomView(props: RoomViewProps): JSX.Element
{ roomSession && <div id="room-view" className="nitro-room-container"></div> }
{ roomSession && events && roomCanvas &&
createPortal(props.children, document.getElementById('room-view').appendChild(roomCanvas)) &&
<FurnitureWidgetsView events={ events } /> }
<>
<FurnitureWidgetsView events={ events } />
<ChatWidgetsView />
</> }
</div>
);
}

View File

@ -1 +1,2 @@
@import './chat/ChatWidgetsView';
@import './furniture/FurnitureWidgets';

View File

@ -0,0 +1 @@
@import './form/ChatFormWidgetView';

View File

@ -0,0 +1,15 @@
import { ChatWidgetsViewProps } from './ChatWidgetsView.types';
import { ChatFormWidgetView } from './form/ChatFormWidgetView';
import { ChatMessagesWidgetView } from './messages/ChatMessagesWidgetView';
export function ChatWidgetsView(props: ChatWidgetsViewProps): JSX.Element
{
const {} = props;
return (
<>
<ChatMessagesWidgetView />
<ChatFormWidgetView />
</>
);
}

View File

@ -0,0 +1,3 @@
export interface ChatWidgetsViewProps
{}

View File

@ -0,0 +1,16 @@
.nitro-chat-form-input {
display: inline-grid;
vertical-align: top;
align-items: center;
position: relative;
height: 100%;
padding:0 10px;
input {
width: auto;
height: 45px;
border-radius: 10px;
border: 1px solid rgb(0, 0, 0);
background: #EDEDED;
}
}

View File

@ -0,0 +1,15 @@
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { ChatFormWidgetViewProps } from './ChatFormWidgetView.types';
export function ChatFormWidgetView(props: ChatFormWidgetViewProps): JSX.Element
{
const {} = props;
return (
<div className="nitro-chat-form fixed-bottom mb-4 d-flex justify-content-center">
<div className="nitro-chat-form-input">
<input type="text" className="form-control" placeholder={ LocalizeText('widgets.chatinput.default') } />
</div>
</div>
);
}

View File

@ -0,0 +1,2 @@
export interface ChatFormWidgetViewProps
{}

View File

@ -0,0 +1,10 @@
import { ChatMessagesWidgetViewProps } from './ChatMessagesWidgetView.types';
export function ChatMessagesWidgetView(props: ChatMessagesWidgetViewProps): JSX.Element
{
const {} = props;
return (
<></>
);
}

View File

@ -0,0 +1,2 @@
export interface ChatMessagesWidgetViewProps
{}

View File

@ -0,0 +1,10 @@
import { ChatMessageWidgetViewProps } from './ChatMessageWidgetView.types';
export function ChatMessageWidgetView(props: ChatMessageWidgetViewProps): JSX.Element
{
const {} = props;
return (
<></>
);
}

View File

@ -0,0 +1,2 @@
export interface ChatMessageWidgetViewProps
{}