Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletions services/app/apps/codebattle/assets/js/widgets/App.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import React, { Suspense } from 'react';

import NiceModal from '@ebay/nice-modal-react';
import {
configureStore,
combineReducers,
} from '@reduxjs/toolkit';
import { configureStore, combineReducers } from '@reduxjs/toolkit';
import { Provider } from 'react-redux';
import { persistStore, persistReducer, PERSIST } from 'redux-persist';
import { PersistGate } from 'redux-persist/integration/react';
Expand All @@ -29,7 +26,6 @@ const { gameUI: gameUIReducer, ...otherReducers } = reducers;
const gameUIPersistWhitelist = [
'audioMuted',
'videoMuted',
'showVideoConferencePanel',
'editorMode',
'editorTheme',
'streamMode',
Expand All @@ -55,14 +51,18 @@ const rollbarRedux = rollbarMiddleware(rollbar);
const store = configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware => getDefaultMiddleware({
serializableCheck: { ignoredActions: ['ERROR', PERSIST] },
}).concat(rollbarRedux),
serializableCheck: { ignoredActions: ['ERROR', PERSIST] },
}).concat(rollbarRedux),
});

const persistor = persistStore(store);

const OnlineContainer = React.lazy(() => import('./components/OnlineContainer'));
const InvitesContainer = React.lazy(() => import('./components/InvitesContainer'));
const OnlineContainer = React.lazy(
() => import('./components/OnlineContainer'),
);
const InvitesContainer = React.lazy(
() => import('./components/InvitesContainer'),
);
const RoomWidget = React.lazy(() => import('./pages/RoomWidget'));
const LobbyWidget = React.lazy(() => import('./pages/lobby'));
const RatingList = React.lazy(() => import('./pages/rating'));
Expand All @@ -71,7 +71,9 @@ const UserSettings = React.lazy(() => import('./pages/settings'));
const UserProfile = React.lazy(() => import('./pages/profile'));
const Registration = React.lazy(() => import('./pages/registration'));
const Tournament = React.lazy(() => import('./pages/tournament'));
const TournamentAdmin = React.lazy(() => import('./pages/tournament/TournamentAdminWidget'));
const TournamentAdmin = React.lazy(
() => import('./pages/tournament/TournamentAdminWidget'),
);
const Stream = React.lazy(() => import('./pages/stream/StreamWidget'));
const EventWidget = React.lazy(() => import('./pages/event'));
const TournamentPlayer = React.lazy(() => import('./pages/tournamentPlayer'));
Expand Down Expand Up @@ -187,9 +189,7 @@ export const RegistrationPage = () => (
export const StairwayGamePage = () => (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Suspense>
{/* <Stairway /> */}
</Suspense>
<Suspense>{/* <Stairway /> */}</Suspense>
</PersistGate>
</Provider>
);
Expand All @@ -198,9 +198,7 @@ export const TournamentPage = () => (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Suspense>
<Tournament
waitingRoomMachine={waitingRoomMachine}
/>
<Tournament waitingRoomMachine={waitingRoomMachine} />
</Suspense>
</PersistGate>
</Provider>
Expand All @@ -209,9 +207,7 @@ export const TournamentAdminPage = () => (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Suspense>
<TournamentAdmin
waitingRoomMachine={waitingRoomMachine}
/>
<TournamentAdmin waitingRoomMachine={waitingRoomMachine} />
</Suspense>
</PersistGate>
</Provider>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import useChatRooms from '../../utils/useChatRooms';
import useMachineStateSelector from '../../utils/useMachineStateSelector';

import Notifications from './Notifications';
import VideoConference from './VideoConference';

function ChatWidget() {
const { mainService } = useContext(RoomContext);
Expand All @@ -39,14 +38,22 @@ function ChatWidget() {
const historyMessages = useSelector(selectors.chatHistoryMessagesSelector);
const gameMode = useSelector(selectors.gameModeSelector);
const useChat = useSelector(selectors.gameUseChatSelector);
const showVideoConferencePanel = useSelector(selectors.showVideoConferencePanelSelector);

const openedReplayer = useMachineStateSelector(mainService, openedReplayerSelector);
const isTestingRoom = useMachineStateSelector(mainService, inTestingRoomSelector);
const isRestricted = useMachineStateSelector(mainService, isRestrictedContentSelector);
const openedReplayer = useMachineStateSelector(
mainService,
openedReplayerSelector,
);
const isTestingRoom = useMachineStateSelector(
mainService,
inTestingRoomSelector,
);
const isRestricted = useMachineStateSelector(
mainService,
isRestrictedContentSelector,
);

// const isTournamentGame = (gameMode === GameRoomModes.tournament);
const isStandardGame = (gameMode === GameRoomModes.standard);
const isStandardGame = gameMode === GameRoomModes.standard;
const showChatInput = !openedReplayer && !isTestingRoom && !isRestricted && useChat;
// const showChatParticipants = !isTestingRoom && useChat && !isRestricted;

Expand All @@ -73,39 +80,35 @@ function ChatWidget() {
const filteredMessages = messages.filter(message => shouldShowMessage(message, activeRoom));

return (
<ChatContextMenu
menuId={menuId}
inputRef={inputRef}
request={menuRequest}
>
<ChatContextMenu menuId={menuId} inputRef={inputRef} request={menuRequest}>
<div className="d-flex flex-wrap flex-sm-nowrap cb-bg-panel shadow-sm h-100 cb-rounded">
<div
className={cn(
'd-none d-lg-flex d-md-flex d-sm-flex flex-column flex-grow-1 position-relative p-0 h-100 mh-100 rounded-left',
'cb-game-chat-container cb-messages-container cb-text',
)}
>
{showVideoConferencePanel ? (
<VideoConference />
) : (
<>
<ChatHeader showRooms={isStandardGame} disabled={disabledChatHeader} />
{openedReplayer
? (
<Messages
messages={historyMessages}
disabled={disabledChatMessages}
/>
) : (
<Messages
displayMenu={displayMenu}
messages={filteredMessages}
disabled={disabledChatMessages}
/>
)}
{showChatInput && <ChatInput inputRef={inputRef} disabled={disabledChatInput} />}
</>
)}
<>
<ChatHeader
showRooms={isStandardGame}
disabled={disabledChatHeader}
/>
{openedReplayer ? (
<Messages
messages={historyMessages}
disabled={disabledChatMessages}
/>
) : (
<Messages
displayMenu={displayMenu}
messages={filteredMessages}
disabled={disabledChatMessages}
/>
)}
{showChatInput && (
<ChatInput inputRef={inputRef} disabled={disabledChatInput} />
)}
</>
</div>
<div className="flex-shrink-1 p-0 border-left cb-border-color rounded-right cb-game-control-container">
<div className="d-flex flex-column justify-content-start overflow-auto h-100">
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading