add contest detail.

This commit is contained in:
2023-01-23 22:56:50 +08:00
parent b060262f70
commit 7def5a4d83
8 changed files with 118 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ import { getContestList } from "oj/api"
import Pagination from "~/shared/Pagination.vue"
import { filterEmptyValue, parseTime, duration } from "utils/functions"
import { Contest } from "utils/types"
import { CONTEST_STATUS } from "~/utils/constants"
import { ContestType, CONTEST_STATUS } from "~/utils/constants"
import ContestTitle from "./components/ContestTitle.vue"
import { useUserStore } from "~/shared/store/user"
import { toggleLogin } from "~/shared/composables/modal"
@@ -108,7 +108,7 @@ function rowProps(row: Contest) {
return {
style: "cursor: pointer",
onClick() {
if (!userStore.isAuthed && row.contest_type === "Password Protected") {
if (!userStore.isAuthed && row.contest_type === ContestType.private) {
toggleLogin(true)
} else {
router.push("/contest/" + row.id)