Skip to content

Commit 0499ac8

Browse files
committed
fix tournaments
1 parent 873d602 commit 0499ac8

File tree

10 files changed

+157
-165
lines changed

10 files changed

+157
-165
lines changed

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

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
$body-bg: #e5e5e5;
22
$success: #82b792;
3+
$cb-success: #32CD32;
4+
$cb-hovered-success: #28a428;
35
$secondary: #477591;
46
$link-color: black;
57
$error: #dc3545;
@@ -2708,7 +2710,7 @@ a:hover {
27082710
}
27092711

27102712
.cb-rounded {
2711-
border-radius: 8px;
2713+
border-radius: 0.5rem;
27122714
}
27132715

27142716
.cb-bg-panel {
@@ -2729,19 +2731,61 @@ a:hover {
27292731
}
27302732

27312733
.cb-text-success {
2732-
color: #4CAF50;
2734+
color: $cb-success;
27332735
}
27342736

27352737
.cb-text-danger {
27362738
color: #f04c5c;
27372739
}
27382740

2741+
.cb-btn-secondary {
2742+
background-color: #3a3f50;
2743+
border-color: #282c38;
2744+
2745+
&.show,
2746+
&.active,
2747+
&:focus-visible {
2748+
background-color: #3a3f50;
2749+
border-color: #a4b2d6;
2750+
}
2751+
2752+
&:hover {
2753+
background-color: #4c5369;
2754+
border-color: #7d89a6;
2755+
}
2756+
2757+
&:focus {
2758+
background-color: #3a3f50;
2759+
border-color: #a4b2d6;
2760+
}
2761+
2762+
&:active {
2763+
background-color: #2c303d;
2764+
border-color: #1c1e27;
2765+
}
2766+
2767+
&:disabled,
2768+
&.disabled {
2769+
background-color: #21242e;
2770+
border-color: #13151b;
2771+
}
2772+
}
2773+
27392774
.cb-btn-success {
2740-
background-color: #4CAF50;
2741-
border-color: #4CAF50;
2775+
background-color: $cb-success;
2776+
border-color: $cb-success;
2777+
2778+
&:hover {
2779+
background-color: $cb-hovered-success;
2780+
border-color: $cb-hovered-success;
2781+
}
27422782
}
27432783

27442784
.cb-level-badge {
27452785
width: auto;
27462786
height: auto;
27472787
}
2788+
2789+
body {
2790+
background-image: url('../static/images/main_background.png');
2791+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export default function ChatInput({ inputRef, mode, disabled = false }) {
4040
const activeRoom = useSelector(selectors.activeRoomSelector);
4141
const badwordsRef = useRef(new BadWordsNext());
4242

43+
const sendBtnClassName = cn('btn btn-secondary cb-btn-secondary border-gray border-left rounded-right', {
44+
'cb-border-color': mode === 'dark',
45+
});
4346
const inputClassName = cn('form-control h-auto border-right-0 rounded-left', {
4447
'bg-dark cb-border-color text-white': mode === 'dark',
4548
'border-gray': mode !== 'dark',
@@ -202,7 +205,7 @@ export default function ChatInput({ inputRef, mode, disabled = false }) {
202205
<em-emoji id="grinning" size={20} />
203206
</button>
204207
<button
205-
className="btn btn-secondary border-gray border-left rounded-right"
208+
className={sendBtnClassName}
206209
type="button"
207210
onClick={handleSubmit}
208211
disabled={disabled || isMaxLengthExceeded || isMessageBlank}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function Rooms({ disabled, mode }) {
2222
return (
2323
<>
2424
<Dropdown as={ButtonGroup} title="" disabled={disabled}>
25-
<Dropdown.Toggle className="rounded-top" split variant="secondary" id="dropdown-rooms" disabled={disabled}>
25+
<Dropdown.Toggle className="rounded-top cb-btn-secondary" split variant="secondary" id="dropdown-rooms" disabled={disabled}>
2626
<span className="mr-2">{i18next.t(activeRoom.name)}</span>
2727
</Dropdown.Toggle>
2828

services/app/apps/codebattle/assets/js/widgets/pages/lobby/ActiveGames.jsx

Lines changed: 0 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -133,150 +133,3 @@ const ActiveGames = ({
133133
};
134134

135135
export default ActiveGames;
136-
137-
// const getTabLinkClassName = (...hash) => {
138-
// const url = new URL(window.location);
139-
// const isActive = hash.includes(url.hash || '#lobby');
140-
//
141-
// return cn(
142-
// 'nav-item nav-link text-uppercase text-center text-nowrap rounded-0 font-weight-bold p-3 border-0 w-100',
143-
// {
144-
// active: isActive,
145-
// },
146-
// );
147-
// };
148-
//
149-
// const tabContentClassName = (...hash) => {
150-
// const url = new URL(window.location);
151-
//
152-
// return cn({
153-
// 'tab-pane': true,
154-
// fade: true,
155-
// active: hash.includes(url.hash || '#lobby'),
156-
// show: hash.includes(url.hash || '#lobby'),
157-
// });
158-
// };
159-
//
160-
// const getTabLinkHandler = hash => () => {
161-
// window.location.hash = hash;
162-
// };
163-
//
164-
// const navTabsClassName = cn(
165-
// 'nav nav-tabs flex-nowrap cb-overflow-x-auto cb-overflow-y-hidden',
166-
// 'rounded-top border-bottom',
167-
// );
168-
169-
// const LobbyContainer = ({
170-
// activeGames,
171-
// liveTournaments,
172-
// completedTournaments,
173-
// currentUserId,
174-
// isGuest = true,
175-
// isOnline = false,
176-
// }) => {
177-
// const handleClick = useCallback(e => {
178-
// const { currentTarget: { dataset } } = e;
179-
// getTabLinkHandler(dataset.hash)();
180-
// }, []);
181-
//
182-
// useEffect(() => {
183-
// if (!window.location.hash) {
184-
// getTabLinkHandler(hashLinkNames.default)();
185-
// window.scrollTo({ top: 0 });
186-
// }
187-
// }, []);
188-
//
189-
// return (
190-
// <div className="p-0 shadow-sm rounded-lg">
191-
// <nav>
192-
// <div
193-
// id="nav-tab"
194-
// className={navTabsClassName}
195-
// role="tablist"
196-
// >
197-
// <a
198-
// className={getTabLinkClassName(
199-
// hashLinkNames.lobby,
200-
// hashLinkNames.default,
201-
// )}
202-
// id="lobby-tab"
203-
// data-toggle="tab"
204-
// data-hash={hashLinkNames.lobby}
205-
// href="#lobby"
206-
// role="tab"
207-
// aria-controls="lobby"
208-
// aria-selected="true"
209-
// onClick={handleClick}
210-
// >
211-
// Lobby
212-
// </a>
213-
// <a
214-
// className={getTabLinkClassName(
215-
// hashLinkNames.tournaments,
216-
// )}
217-
// id="tournaments-tab"
218-
// data-toggle="tab"
219-
// data-hash={hashLinkNames.tournaments}
220-
// href="#tournaments"
221-
// role="tab"
222-
// aria-controls="tournaments"
223-
// aria-selected="false"
224-
// onClick={handleClick}
225-
// >
226-
// Tournaments
227-
// </a>
228-
// <a
229-
// className={getTabLinkClassName(
230-
// hashLinkNames.completedGames,
231-
// )}
232-
// id="completedGames-tab"
233-
// data-toggle="tab"
234-
// data-hash={hashLinkNames.completedGames}
235-
// href="#completedGames"
236-
// role="tab"
237-
// aria-controls="completedGames"
238-
// aria-selected="false"
239-
// onClick={handleClick}
240-
// >
241-
// History
242-
// </a>
243-
// </div>
244-
// </nav>
245-
// <div className="tab-content" id="nav-tabContent">
246-
// <div
247-
// className={tabContentClassName(
248-
// hashLinkNames.lobby,
249-
// hashLinkNames.default,
250-
// )}
251-
// id="lobby"
252-
// role="tabpanel"
253-
// aria-labelledby="lobby-tab"
254-
// >
255-
// <ActiveGames
256-
// games={activeGames}
257-
// currentUserId={currentUserId}
258-
// isGuest={isGuest}
259-
// isOnline={isOnline}
260-
// />
261-
// </div>
262-
// <div
263-
// className={tabContentClassName(hashLinkNames.tournaments)}
264-
// id="tournaments"
265-
// role="tabpanel"
266-
// aria-labelledby="tournaments-tab"
267-
// >
268-
// <LiveTournaments tournaments={liveTournaments} />
269-
// <CompletedTournaments tournaments={completedTournaments} />
270-
// </div>
271-
// <div
272-
// className={tabContentClassName(hashLinkNames.completedGames)}
273-
// id="completedGames"
274-
// role="tabpanel"
275-
// aria-labelledby="completedGames-tab"
276-
// >
277-
// <CompletedGames className="cb-lobby-widget-container" />
278-
// </div>
279-
// </div>
280-
// </div>
281-
// );
282-
// };

services/app/apps/codebattle/assets/js/widgets/pages/lobby/CreateGameDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ function CreateGameDialog({ hideModal }) {
267267
/>
268268
<button
269269
type="button"
270-
className="btn btn-success cb-btn-success d-block mt-4 ml-auto text-white font-weight-bold rounded-lg"
270+
className="btn btn-secondary cb-btn-secondary d-block mt-4 ml-auto rounded-lg"
271271
onClick={createGame}
272272
disabled={isInvite && !opponent}
273273
>

services/app/apps/codebattle/assets/js/widgets/pages/lobby/LobbyWidget.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,22 @@ import LobbyChat from './LobbyChat';
2323
import SeasonProfilePanel from './SeasonProfilePanel';
2424

2525
const createBtnClassName = cn(
26-
'btn border-0 rounded-lg',
27-
'text-uppercase font-weight-bold py-3',
26+
'btn rounded-lg',
2827
);
2928

3029
const createBasicGameBtnClassName = cn(
3130
createBtnClassName,
32-
'btn-success cb-btn-success w-100 mr-2',
31+
'btn-secondary cb-btn-secondary w-100 mr-2',
3332
);
3433

3534
const joinGameBtnClassName = cn(
3635
createBtnClassName,
37-
'btn-success cb-btn-success w-100',
36+
'btn-secondary cb-btn-secondary w-100',
3837
);
3938

4039
const createCssGameBtnClassName = cn(
4140
createBtnClassName,
42-
'btn-secondary mt-2 pl-2',
41+
'btn-secondary cb-btn-secondary mt-2 pl-2',
4342
);
4443

4544
const CreateCssGameButton = ({ onClick, isOnline }) => (

services/app/apps/codebattle/assets/js/widgets/pages/lobby/SeasonProfilePanel.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React from 'react';
22

3+
import i18n from '../../../i18n';
4+
35
import TournamentListItem, { activeIcon, upcomingIcon } from './TournamentListItem';
46

57
const contestDatesText = 'Season: Oct 14 - Dec 21';
@@ -41,9 +43,9 @@ const SeasonProfilePanel = ({
4143
)
4244
: <div className="pt-2 mt-2">Competition not started yet</div>}
4345
<div className="d-flex w-100 pt-2 mt-2">
44-
<a href="_blank" type="button" className="btn btn-secondary mx-2 w-100 rounded">Contests History</a>
45-
<a href="_blank" type="button" className="btn btn-secondary mx-2 w-100 rounded">My Tournaments</a>
46-
<a href="_blank" type="button" className="btn btn-secondary mx-2 w-100 rounded">Create Tournament</a>
46+
<a href="_blank" type="button" className="btn btn-secondary cb-btn-secondary mx-2 w-100 rounded">{i18n.t('Contests History')}</a>
47+
<a href="_blank" type="button" className="btn btn-secondary cb-btn-secondary mx-2 w-100 rounded">{i18n.t('My Tournaments')}</a>
48+
<a href="_blank" type="button" className="btn btn-secondary cb-btn-secondary mx-2 w-100 rounded">{i18n.t('Create a Tournament')}</a>
4749
</div>
4850
</div>
4951
</div>

0 commit comments

Comments
 (0)