-
+
diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/tournament/TournamentMainControlButtons.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/tournament/TournamentMainControlButtons.jsx
index ec8d2d186..329885b1b 100644
--- a/services/app/apps/codebattle/assets/js/widgets/pages/tournament/TournamentMainControlButtons.jsx
+++ b/services/app/apps/codebattle/assets/js/widgets/pages/tournament/TournamentMainControlButtons.jsx
@@ -1,11 +1,10 @@
-import React, { memo, useCallback, useContext } from 'react';
+import React, { memo, useCallback } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import cn from 'classnames';
import Dropdown from 'react-bootstrap/Dropdown';
import { useDispatch } from 'react-redux';
-import CustomEventStylesContext from '../../components/CustomEventStylesContext';
import {
cancelTournament,
restartTournament as handleRestartTournament,
@@ -45,8 +44,6 @@ const TournamentMainControlButtons = ({
}) => {
const dispatch = useDispatch();
- const hasCustomEventStyles = useContext(CustomEventStylesContext);
-
const handleStartTournament = useCallback(() => {
handleStartRound('firstRound');
}, [handleStartRound]);
@@ -57,21 +54,13 @@ const TournamentMainControlButtons = ({
handleStartRound('nextRound');
}, [handleStartRound]);
- const restartBtnClassName = cn('btn text-white text-nowrap ml-lg-2 rounded-left', {
- 'btn-info': !hasCustomEventStyles,
- 'cb-custom-event-btn-info': hasCustomEventStyles,
- });
- const roundBtnClassName = cn('btn text-white text-nowrap ml-lg-2 rounded-left', {
- 'btn-success': !hasCustomEventStyles,
- 'cb-custom-event-btn-success': hasCustomEventStyles,
- });
+ const restartBtnClassName = cn('btn text-nowrap ml-lg-2 rounded-left btn-secondary cb-btn-secondary');
+ const roundBtnClassName = cn('btn text-nowrap ml-lg-2 rounded-left btn-success cb-btn-success text-white');
const dropdownBtnClassName = cn('btn text-white rounded-right', {
'rounded-left': streamMode,
- 'btn-info': !hasCustomEventStyles && canRestart,
- 'btn-success': !hasCustomEventStyles && !canRestart,
- 'cb-custom-event-btn-info': hasCustomEventStyles && canRestart,
- 'cb-custom-event-btn-success': hasCustomEventStyles && !canRestart,
+ 'btn-secondary cb-btn-secondary': canRestart,
+ 'btn-success cb-btn-success text-white': !canRestart,
});
return (
diff --git a/services/app/apps/codebattle/assets/js/widgets/slices/leaderboard.js b/services/app/apps/codebattle/assets/js/widgets/slices/leaderboard.js
index 2bc1d2ea3..9b55e358a 100644
--- a/services/app/apps/codebattle/assets/js/widgets/slices/leaderboard.js
+++ b/services/app/apps/codebattle/assets/js/widgets/slices/leaderboard.js
@@ -30,14 +30,14 @@ const fetchUsers = createAsyncThunk(
};
const params = periodType === periodTypes.ALL
- ? baseParams
- : {
- ...baseParams,
- date_from: moment()
- .startOf(periodMapping[periodType])
- .utc()
- .format('YYYY-MM-DD'),
- };
+ ? baseParams
+ : {
+ ...baseParams,
+ date_from: moment()
+ .startOf(periodMapping[periodType])
+ .utc()
+ .format('YYYY-MM-DD'),
+ };
const response = await axios.get('/api/v1/users', { params });
diff --git a/services/app/apps/codebattle/assets/js/widgets/utils/useTournamentScheduleModals.js b/services/app/apps/codebattle/assets/js/widgets/utils/useTournamentScheduleModals.js
new file mode 100644
index 000000000..7efb620b1
--- /dev/null
+++ b/services/app/apps/codebattle/assets/js/widgets/utils/useTournamentScheduleModals.js
@@ -0,0 +1,21 @@
+import { useEffect } from 'react';
+
+import NiceModal, { unregister } from '@ebay/nice-modal-react';
+
+import ModalCodes from '../config/modalCodes';
+import { EventModal } from '../pages/schedule/EventModal';
+
+const useTournamentScheduleModals = () => {
+ useEffect(() => {
+ NiceModal.register(ModalCodes.calendarEventModal, EventModal);
+
+ const unregisterModals = () => {
+ unregister(ModalCodes.calendarEventModal);
+ };
+
+ return unregisterModals;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+};
+
+export default useTournamentScheduleModals;