Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
### What's done:
 * Renamed `PARTICIPANTS` ContestView tab to `SUMMARY`
 * Renamed `RESULTS` ContestView tab to `SUBMISSIONS`
 * Improved `SUBMISSIONS` tab
 * Added `ContestExecutionView`
 * Added several endpoints on backend for new tab and view

 (#1035)
  • Loading branch information
sanyavertolet committed Aug 22, 2022
1 parent d54843c commit 3fb5f9e
Showing 1 changed file with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import react.dom.html.ReactHTML.p
* Enum that defines the bar that is chosen
*/
enum class ContestMenuBar {
EXECUTION,
INFO,
SUBMISSIONS,
SUMMARY,
Expand Down Expand Up @@ -98,36 +97,33 @@ class ContestView : AbstractView<ContestViewProps, ContestViewState>(false) {
}

private fun ChildrenBuilder.renderContestMenuBar() {
if (state.selectedMenu != ContestMenuBar.EXECUTION) {
div {
className = ClassName("row align-items-center justify-content-center")
nav {
className = ClassName("nav nav-tabs mb-4")
ContestMenuBar.values()
.filter { it != ContestMenuBar.EXECUTION }
.forEachIndexed { i, contestMenu ->
li {
className = ClassName("nav-item")
val classVal =
if ((i == 0 && state.selectedMenu == null) || state.selectedMenu == contestMenu) {
" active font-weight-bold"
} else {
""
}
p {
className = ClassName("nav-link $classVal text-gray-800")
onClick = {
if (state.selectedMenu != contestMenu) {
setState {
selectedMenu = contestMenu
}
div {
className = ClassName("row align-items-center justify-content-center")
nav {
className = ClassName("nav nav-tabs mb-4")
ContestMenuBar.values()
.forEachIndexed { i, contestMenu ->
li {
className = ClassName("nav-item")
val classVal =
if ((i == 0 && state.selectedMenu == null) || state.selectedMenu == contestMenu) {
" active font-weight-bold"
} else {
""
}
p {
className = ClassName("nav-link $classVal text-gray-800")
onClick = {
if (state.selectedMenu != contestMenu) {
setState {
selectedMenu = contestMenu
}
}
+contestMenu.name
}
+contestMenu.name
}
}
}
}
}
}
}
Expand Down

0 comments on commit 3fb5f9e

Please sign in to comment.