Skip to content

Commit 686a65d

Browse files
authored
Merge pull request #2220 from hexlet-codebattle/add_event_modal
2 parents 15e820c + 8a585e2 commit 686a65d

File tree

18 files changed

+428
-160
lines changed

18 files changed

+428
-160
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@
5555
}
5656

5757
.cb-custom-event-td:not(:last-child)::after {
58-
background-color: gray;
5958
right: 0;
6059
top: 8px;
6160
}
6261

6362
.cb-custom-event-nav-item:not(:first-child):not(.active)::after {
64-
background-color: white;
6563
left: 0;
6664
top: 13px;
6765
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,8 @@ a.cb-text:hover {
21782178
background-color: $cb-success;
21792179
border-color: $cb-success;
21802180

2181-
&:hover {
2181+
&:hover:not(:disabled),
2182+
&:hover:not(.disabled) {
21822183
background-color: $cb-hovered-success;
21832184
border-color: $cb-hovered-success;
21842185
}
@@ -2187,7 +2188,8 @@ a.cb-text:hover {
21872188
.cb-btn-outline-success {
21882189
border-color: $cb-success;
21892190

2190-
&:hover {
2191+
&:hover:not(:disabled),
2192+
&:hover:not(.disabled) {
21912193
background-color: $cb-hovered-success;
21922194
border-color: $cb-hovered-success;
21932195
}
@@ -2500,3 +2502,7 @@ a.cb-text:hover {
25002502
// background-color: rgba(90, 123, 151, 0.2);
25012503
// }
25022504
//
2505+
2506+
.btn-link {
2507+
color: white;
2508+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import dayjs from 'dayjs';
2+
import duration from 'dayjs/plugin/duration';
3+
import timezone from 'dayjs/plugin/timezone';
4+
import utc from 'dayjs/plugin/utc';
5+
6+
dayjs.extend(utc);
7+
dayjs.extend(timezone);
8+
dayjs.extend(duration);
9+
10+
export default dayjs;

services/app/apps/codebattle/assets/js/widgets/App.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ export const TournamentsSchedulePage = () => (
150150
<Provider store={store}>
151151
<PersistGate loading={null} persistor={persistor}>
152152
<Suspense>
153-
<TournamentsSchedule />
153+
<NiceModal.Provider>
154+
<TournamentsSchedule />
155+
</NiceModal.Provider>
154156
</Suspense>
155157
</PersistGate>
156158
</Provider>

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as selectors from '../selectors';
99

1010
import LanguageIcon from './LanguageIcon';
1111

12-
const customStyle = {
12+
export const customStyle = {
1313
control: provided => ({
1414
...provided,
1515
color: 'white',
@@ -24,6 +24,10 @@ const customStyle = {
2424
borderColor: '#4c4c5a',
2525
},
2626
}),
27+
singleValue: provider => ({
28+
...provider,
29+
color: 'white',
30+
}),
2731
indicatorsContainer: provided => ({
2832
...provided,
2933
height: '29px',
@@ -39,14 +43,17 @@ const customStyle = {
3943
}),
4044
input: provided => ({
4145
...provided,
46+
color: 'white',
4247
height: '21px',
4348
}),
4449
menu: provided => ({
4550
...provided,
51+
color: 'white',
4652
backgroundColor: '#2a2a35',
4753
}),
4854
option: provided => ({
4955
...provided,
56+
color: 'white',
5057
backgroundColor: '#2a2a35',
5158
':hover': {
5259
backgroundColor: '#3a3f50',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ function UserInfo({
6262
const content = useMemo(() => <UserPopoverContent user={user} />, [user]);
6363

6464
if (!user?.id) {
65-
return <span className="text-secondary">John Doe</span>;
65+
return <span className="text-white">John Doe</span>;
6666
}
6767

6868
if (user?.id === 0) {
69-
return <span className="text-secondary">{user.name}</span>;
69+
return <span className="text-white">{user.name}</span>;
7070
}
7171

7272
const isOnline = presenceList.some(({ id }) => id === user?.id);

services/app/apps/codebattle/assets/js/widgets/config/modalCodes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const modalCodes = {
88
premiumRestrictionModal: 'premium_restriction_modal',
99
awardModal: 'award_modal',
1010
eventStageModal: 'event_stage_modal',
11+
calendarEventModal: 'calendar_event_modal',
1112
};
1213

1314
export default modalCodes;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ const AnimationModal = NiceModal.create(() => {
3535
const currentUserId = useSelector(state => currentUserIdSelector(state));
3636
const tournamentId = useSelector(state => state.game.gameStatus.tournamentId);
3737

38+
useEffect(() => {
39+
if (modal.visible) {
40+
NiceModal.hide(ModalCodes.premiumRestrictionModal);
41+
NiceModal.hide(ModalCodes.taskDescriptionModal);
42+
}
43+
}, [modal.visible]);
44+
3845
const currentPlayer = players[currentUserId];
3946

4047
if (!currentPlayer || currentPlayer.result === 'undefined') {
@@ -48,13 +55,6 @@ const AnimationModal = NiceModal.create(() => {
4855
: i18n.t("If you read this you've lost the game");
4956
const buttonText = result === 'won' ? i18n.t('GG') : i18n.t("I'll be back");
5057

51-
useEffect(() => {
52-
if (modal.visible) {
53-
NiceModal.hide(ModalCodes.premiumRestrictionModal);
54-
NiceModal.hide(ModalCodes.taskDescriptionModal);
55-
}
56-
}, [modal.visible]);
57-
5858
return (
5959
<Modal
6060
show={modal.visible}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const OutputTab = ({ sideOutput, large = false }) => {
5555

5656
return (
5757
<>
58-
{isShowMessage && <span className="font-weight-bold small mr-3">{assertsStatusMessage}</span>}
59-
<span className={`p-2 bg-${statusColor}`}>{message}</span>
58+
{isShowMessage && <span className="font-weight-bold text-white small mr-3">{assertsStatusMessage}</span>}
59+
<span className={`p-2 text-white bg-${statusColor}`}>{message}</span>
6060
</>
6161
);
6262
};

0 commit comments

Comments
 (0)