Skip to content

Commit 5c32277

Browse files
authored
Merge pull request #2228 from hexlet-codebattle/improve_styles_and_fix_saving_game
improve_styles_and_fix_saving_game
2 parents 9dda5a1 + 47c4422 commit 5c32277

File tree

12 files changed

+51
-55
lines changed

12 files changed

+51
-55
lines changed

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

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ $fa-font-path: '/fonts';
8080

8181
@import 'fonts';
8282
@import 'tournaments';
83-
@import 'taskComponent';
8483
@import 'grades';
8584

8685
.katex .rlap>.inner {
@@ -1118,16 +1117,27 @@ a:hover {
11181117
border-radius: 0.50rem;
11191118
}
11201119

1121-
.dropdown-item.cb-dropdown-item {
1122-
color: white;
1120+
#tasklang-dropdown {
11231121

1124-
&:disabled,
1125-
&.disabled {
1126-
color: $text-muted;
1122+
&-toggle,
1123+
&-menu {
1124+
min-width: 4.375rem;
11271125
}
1126+
}
11281127

1129-
&:hover:not(:disabled):not(.disabled) {
1130-
background-color: $cb-bg-panel;
1128+
.dropdown-menu,
1129+
.cb-dropdown-menu {
1130+
& .dropdown-item.cb-dropdown-item {
1131+
color: white;
1132+
1133+
&:hover:not(:active):not(.active) {
1134+
background-color: $cb-bg-panel;
1135+
}
1136+
1137+
&:active,
1138+
&.active {
1139+
background-color: $cb-bg-panel;
1140+
}
11311141
}
11321142
}
11331143

@@ -2542,3 +2552,17 @@ a.cb-text:hover {
25422552
.cb-subtle-background {
25432553
background: radial-gradient(circle at 50% 0%, #3a3b40 0%, $cb-bg-panel 100%);
25442554
}
2555+
2556+
.cb-blur {
2557+
background: rgba(0, 0, 0, .3);
2558+
backdrop-filter: blur(16px);
2559+
}
2560+
2561+
.arrow::after,
2562+
.bs-popover-bottom .arrow::after {
2563+
border-bottom-color: rgba(0, 0, 0);
2564+
2565+
.cb-blur & {
2566+
border-bottom-color: rgba(0, 0, 0, .3);
2567+
}
2568+
}

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

Lines changed: 0 additions & 14 deletions
This file was deleted.

services/app/apps/codebattle/assets/js/widgets/components/LanguagePickerView.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ export const customStyle = {
4949
menu: provided => ({
5050
...provided,
5151
color: 'white',
52-
backgroundColor: '#2a2a35',
52+
backgroundColor: 'rgba(0, 0, 0, .3)',
53+
backdropFilter: 'blur(16px)',
5354
}),
5455
option: provided => ({
5556
...provided,
5657
color: 'white',
57-
backgroundColor: '#2a2a35',
58+
backgroundColor: 'transparent',
59+
5860
':hover': {
5961
backgroundColor: '#3a3f50',
6062
},

services/app/apps/codebattle/assets/js/widgets/components/PopoverStickOnHover.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function PopoverStickOnHover({
5757
shouldUpdatePosition
5858
>
5959
<Popover
60-
className="cb-bg-panel cb-text cb-rounded"
60+
className="cb-blur cb-text cb-rounded"
6161
trigger="click"
6262
onMouseEnter={() => {
6363
setShowPopover(true);

services/app/apps/codebattle/assets/js/widgets/pages/game/CopyEditorButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const CopyEditorButton = ({ editor }) => {
99
const text = i18n.t('Copy');
1010

1111
const handleCopyClick = () => {
12-
copy(editor.value);
12+
copy(editor.text);
1313
};
1414

1515
return (

services/app/apps/codebattle/assets/js/widgets/pages/game/GameActionButtons.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function GameActionButtons({
203203
<FontAwesomeIcon icon="ellipsis-v" className="mr-1" />
204204
</Dropdown.Toggle>
205205

206-
<Dropdown.Menu className="h-auto cb-overflow-x-hidden cb-scrollable-menu-dropdown-chat bg-dark">
206+
<Dropdown.Menu className="h-auto cb-overflow-x-hidden cb-scrollable-menu-dropdown-chat cb-blur">
207207
<ResetButtonDropDownItem onSelect={handleReset} status={resetBtnStatus} />
208208
{showGiveUpBtn && <GiveUpButtonDropdownItem onSelect={modalShow} status={giveUpBtnStatus} />}
209209
</Dropdown.Menu>

services/app/apps/codebattle/assets/js/widgets/pages/game/InfoWidget.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function CommonBattleInfoWidget({
5050
taskLanguage,
5151
handleSetLanguage,
5252
hideContribution: !!tournamentId,
53-
hideGuide: !!tournamentId,
5453
hideContent: isRestricted,
5554
};
5655

services/app/apps/codebattle/assets/js/widgets/pages/game/TaskAssignment.jsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
55
import cn from 'classnames';
66
import isEmpty from 'lodash/isEmpty';
77
import PropTypes from 'prop-types';
8-
import { useDispatch } from 'react-redux';
98

109
import i18n from '../../../i18n';
1110
import GameLevelBadge from '../../components/GameLevelBadge';
1211
import ModalCodes from '../../config/modalCodes';
1312
import PageNames from '../../config/pageNames';
14-
import { actions } from '../../slices';
1513
import useTaskDescriptionParams from '../../utils/useTaskDescriptionParams';
1614

1715
import ContributorsList from './ContributorsList';
@@ -29,33 +27,12 @@ const renderTaskLink = name => {
2927
);
3028
};
3129

32-
function ShowGuideButton() {
33-
const dispatch = useDispatch();
34-
const guideShow = () => {
35-
dispatch(actions.updateGameUI({ isShowGuide: true }));
36-
};
37-
38-
return (
39-
<button
40-
type="button"
41-
className="btn btn-outline-secondary cb-btn-outline-secondary btn-sm mx-2 text-nowrap cb-rounded"
42-
onClick={guideShow}
43-
data-toggle="tooltip"
44-
data-placement="top"
45-
title="Show guide"
46-
>
47-
{i18n.t('Show guide')}
48-
</button>
49-
);
50-
}
51-
5230
function TaskAssignment({
5331
task,
5432
taskLanguage,
5533
taskSize = 0,
5634
handleSetLanguage,
5735
changeTaskDescriptionSizes,
58-
hideGuide = false,
5936
hideContribution = false,
6037
hideContent = false,
6138
hidingControls = false,
@@ -124,7 +101,6 @@ function TaskAssignment({
124101
{i18n.t('Expand')}
125102
</button>
126103
)}
127-
{!hideGuide && <ShowGuideButton />}
128104
{changeTaskDescriptionSizes && !hidingControls && (
129105
<div
130106
className="btn-group align-items-center ml-2 mr-auto"

services/app/apps/codebattle/assets/js/widgets/pages/game/TaskDescriptionModal.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const TaskDescriptionModal = NiceModal.create(() => {
3434
task={task}
3535
taskLanguage={taskLanguage}
3636
handleSetLanguage={handleSetLanguage}
37-
hideGuide
3837
hideContribution
3938
fullSize
4039
/>

services/app/apps/codebattle/assets/js/widgets/pages/game/TaskLanguageSelection.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const TaskLanguagesSelection = ({
1616
key={language}
1717
active={language === displayLanguage}
1818
onClick={handleSetLanguage(language)}
19+
className="cb-dropdown-item"
1920
>
2021
<span translate="no">{`${language.toUpperCase()}`}</span>
2122
</Dropdown.Item>
@@ -30,7 +31,7 @@ const TaskLanguagesSelection = ({
3031
>
3132
{displayLanguage.toUpperCase()}
3233
</Dropdown.Toggle>
33-
<Dropdown.Menu id="tasklang-dropdown-menu" className="cb-bg-highlight-panel cb-border-color text-white">
34+
<Dropdown.Menu id="tasklang-dropdown-menu" className="cb-blur">
3435
{avaibleLanguages.map(renderLanguage)}
3536
</Dropdown.Menu>
3637
</Dropdown>

0 commit comments

Comments
 (0)