add problem.

This commit is contained in:
2023-01-05 10:24:06 +08:00
parent 56e28abfa6
commit f88c053848
9 changed files with 228 additions and 102 deletions

View File

@@ -119,11 +119,26 @@ export const STORAGE_KEY = {
USER: "user",
}
export const DIFFICULTY = {
Low: "简单",
Mid: "中等",
High: "困难",
}
export function getTagColor(tag: string) {
return {
Low: "success",
Mid: "",
High: "danger",
: "success",
: "",
: "danger",
}[tag]
}
export function buildProblemCodeKey(problemID: number, contestID = null) {
if (contestID) {
return `${STORAGE_KEY.PROBLEM_CODE}_${contestID}_${problemID}`
}
return `${STORAGE_KEY.PROBLEM_CODE}_NaN_${problemID}`
}
export const GOOGLE_ANALYTICS_ID = "UA-111499601-1"