From 72495c18a0e75bd1636b9be1cbda1e0551ac7823 Mon Sep 17 00:00:00 2001 From: vtm9 Date: Fri, 7 Jun 2024 21:06:40 +0200 Subject: [PATCH] Fix UI --- .../js/widgets/pages/game/TaskAssignment.jsx | 15 +++-- .../widgets/pages/tournament/MatchAction.jsx | 37 +++++------ .../pages/tournament/TournamentUserPanel.jsx | 65 ++++++++++++------- .../priv/gettext/ru/LC_MESSAGES/default.po | 3 + 4 files changed, 68 insertions(+), 52 deletions(-) diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/game/TaskAssignment.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/game/TaskAssignment.jsx index ad0784b3f..f848156ab 100644 --- a/services/app/apps/codebattle/assets/js/widgets/pages/game/TaskAssignment.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/pages/game/TaskAssignment.jsx @@ -107,19 +107,20 @@ function TaskAssignment({ {task.name}
- + {/* */} {!fullSize && ( )} {!hideGuide && } diff --git a/services/app/apps/codebattle/assets/js/widgets/pages/tournament/MatchAction.jsx b/services/app/apps/codebattle/assets/js/widgets/pages/tournament/MatchAction.jsx index 1bb37ae60..2c5dd153a 100644 --- a/services/app/apps/codebattle/assets/js/widgets/pages/tournament/MatchAction.jsx +++ b/services/app/apps/codebattle/assets/js/widgets/pages/tournament/MatchAction.jsx @@ -3,18 +3,16 @@ import React, { memo, useContext } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import cn from 'classnames'; import i18next from 'i18next'; +import { useSelector } from 'react-redux'; import CustomEventStylesContext from '../../components/CustomEventStylesContext'; import MatchStatesCodes from '../../config/matchStates'; import { sendMatchGameOver } from '../../middlewares/TournamentAdmin'; -function MatchAction({ - match, - canModerate, - currentUserIsPlayer, -}) { +function MatchAction({ match, canModerate, currentUserIsPlayer }) { const href = `/games/${match.gameId}`; const hasCustomEventStyles = useContext(CustomEventStylesContext); + const streamMode = useSelector(state => state.gameUI.streamMode); const showBtnClassName = cn('btn btn-sm text-nowrap rounded-lg px-3', { 'btn-primary': !hasCustomEventStyles, @@ -32,12 +30,7 @@ function MatchAction({ switch (match.state) { case MatchStatesCodes.pending: return ( - + {i18next.t('Show')} @@ -54,16 +47,16 @@ function MatchAction({ {i18next.t('Continue')} - {canModerate && ( - - )} + {canModerate && !streamMode && ( + + )} ); } @@ -78,7 +71,7 @@ function MatchAction({ {i18next.t('Show')} - {canModerate && ( + {canModerate && !streamMode && (
diff --git a/services/app/apps/codebattle/priv/gettext/ru/LC_MESSAGES/default.po b/services/app/apps/codebattle/priv/gettext/ru/LC_MESSAGES/default.po index e3bd7673e..805960d94 100644 --- a/services/app/apps/codebattle/priv/gettext/ru/LC_MESSAGES/default.po +++ b/services/app/apps/codebattle/priv/gettext/ru/LC_MESSAGES/default.po @@ -311,6 +311,9 @@ msgstr "Cбросить решение" msgid "Check solution" msgstr "Проверить решение" +msgid "Expand" +msgstr "Развернуть описание" + msgid "Found a mistake? Have something to add? Pull Requests are welcome: " msgstr "Нашли ошибку? Вам есть что добавить к описанию? Мы будем рады вашим Pull Requests: "