Skip to content

Commit 7d4c564

Browse files
committed
Fix
1 parent 05b0bdc commit 7d4c564

File tree

5 files changed

+39
-16
lines changed

5 files changed

+39
-16
lines changed

services/app/apps/codebattle/assets/css/style.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,12 +2586,14 @@ a:hover {
25862586
}
25872587

25882588
.cb-stream-widget-header-img-left {
2589+
background-size: cover;
25892590
width: 20%;
25902591
background-image: url(../static/images/stream/back-stripes.svg);
25912592
fill: #FAFF0F;
25922593
}
25932594

25942595
.cb-stream-widget-header-img-right {
2596+
background-size: cover;
25952597
width: 20%;
25962598
background-image: url(../static/images/stream/stripes.svg);
25972599
fill: #FAFF0F;

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamEditorPanel.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,23 @@ function StreamEditorPanel({
1919
theme: editorThemes.dark,
2020
mute: true,
2121
loading: false,
22-
value: editor?.text,
22+
value: editor?.text || '',
2323
fontSize,
24-
lineNumbers: false,
24+
lineNumbers: 'off',
2525
wordWrap: 'on',
26+
// Add required props
27+
onChange: () => {},
28+
mode: 'default',
29+
roomMode: 'spectator',
30+
checkResult: () => {},
31+
userType: 'spectator',
32+
userId: 0,
2633
};
2734

2835
return (
2936
<div
3037
className={`cb-stream-editor-panel p-4 cb-stream-editor-${orientation}`}
31-
// style={{ width, maxWidth: width, minWidth: width }}
38+
style={{ width, maxWidth: width, minWidth: width }}
3239
>
3340
<div className="d-flex flex-column flex-grow-1 position-relative cb-editor-height h-100">
3441
<ExtendedEditor {...editorParams} />

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamFullPanel.jsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,35 @@ function StreamFullPanel({
2424
theme: editorThemes.dark,
2525
mute: true,
2626
loading: false,
27-
value: leftEditor?.text,
27+
value: leftEditor?.text || '',
2828
fontSize: codeFontSize,
2929
lineNumbers: false,
3030
wordWrap: 'on',
31+
// Add required props
32+
onChange: () => {},
33+
mode: 'default',
34+
roomMode: 'spectator',
35+
checkResult: () => {},
36+
userType: 'spectator',
37+
userId: 0,
3138
};
3239
const editorRightParams = {
3340
editable: false,
3441
syntax: rightEditor?.currentLangSlug,
3542
theme: editorThemes.dark,
3643
mute: true,
3744
loading: false,
38-
value: rightEditor?.text,
45+
value: rightEditor?.text || '',
3946
fontSize: codeFontSize,
4047
lineNumbers: false,
4148
wordWrap: 'on',
49+
// Add required props
50+
onChange: () => {},
51+
mode: 'default',
52+
roomMode: 'spectator',
53+
checkResult: () => {},
54+
userType: 'spectator',
55+
userId: 0,
4256
};
4357

4458
return (

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamTaskInfoPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ function StreamTaskInfoPanel({
4343
{/* <span>3 / 8 Задача</span> */}
4444
{/* </div> */}
4545
<div className="d-flex flex-column align-items-center cb-stream-name cb-stream-widget-text">
46-
{(player?.name || 'Фамилия Имя').split(' ').map(str => (
47-
<div style={{ fontSize }}>{upperCase(str || 'Test')}</div>
46+
{(player?.name || 'Фамилия Имя').split(' ').map((str, index) => (
47+
<div key={index} style={{ fontSize }}>{upperCase(str || 'Test')}</div>
4848
))}
4949
</div>
5050
</div>

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamWidget.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function StreamWidget({
4949

5050
useEffect(() => {
5151
dispatch(connectToStream());
52-
}, []);
52+
}, [dispatch]);
5353

5454
useEffect(() => {
5555
if (!game.id) {
@@ -71,18 +71,18 @@ function StreamWidget({
7171
}, [game.id, mainService, waitingRoomService, dispatch]);
7272

7373
if (!game.id) {
74-
return <div className="vh-100 cb-stream-widget" />;
74+
return <div className="vh-100 overflow-hidden cb-stream-widget" />;
7575
}
7676

7777
return (
78-
<div className="vh-100 p-2 cb-stream-widget">
78+
<div className="vh-100 overflow-hidden cb-stream-widget">
7979
<div className="d-flex flex-column w-100 h-100">
80-
<div className="cb-stream-widget-header cb-stream-widget-text" style={headerFontSize}>
81-
<div className="cb-stream-widget-header-img-left" />
82-
<div className="cb-stream-widget-header-title text-center p-4">Баттл Вузов</div>
83-
<div className="cb-stream-widget-header-img-right" />
80+
<div className="cb-stream-widget-header cb-stream-widget-text d-flex" style={{ fontSize: `${headerFontSize}px` }}>
81+
<div className="cb-stream-widget-header-img-left"/>
82+
<div className="cb-stream-widget-header-title text-center p-2 ">Баттл Вузов</div>
83+
<div className="cb-stream-widget-header-img-right"/>
8484
</div>
85-
<div className="p-2">
85+
<div className="flex-grow-1 d-flex flex-column h-100">
8686
{orientations.NONE === orientation && (
8787
<StreamFullPanel
8888
game={game}
@@ -91,7 +91,7 @@ function StreamWidget({
9191
codeFontSize={codeFontSize}
9292
/>
9393
)}
94-
<div className="d-flex w-100 h-100" styles={{ fontSize }}>
94+
<div className="d-flex w-100 flex-grow-1 h-100" style={{ fontSize: `${fontSize}px` }}>
9595
{orientations.LEFT === orientation && (
9696
<>
9797
<StreamTaskInfoPanel

0 commit comments

Comments
 (0)