add leaderboard
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-03-09 20:00:11 +08:00
parent 9c577f9bc1
commit a7aa4f63ac
8 changed files with 173 additions and 3 deletions

View File

@@ -44,6 +44,12 @@
>
<Icon :width="16" icon="lucide:list"></Icon>
</n-button>
<n-button text @click="$router.push({ name: 'leaderboard' })">
<Icon :width="16" icon="lucide:trophy" />
</n-button>
<n-button text v-if="isLoggedIn" @click="$router.push({ name: 'my-scores' })">
<Icon :width="16" icon="lucide:bar-chart-2" />
</n-button>
<n-button text v-if="roleSuper" @click="edit">
<Icon :width="16" icon="lucide:edit"></Icon>
</n-button>
@@ -63,7 +69,7 @@ import { step } from "../store/tutorial"
import { roleSuper } from "../store/user"
import { taskTab, challengeDisplay } from "../store/task"
import { useRoute, useRouter } from "vue-router"
import { TASK_TYPE } from "../utils/const"
import { TASK_TYPE, STORAGE_KEY } from "../utils/const"
import Challenge from "./Challenge.vue"
import Tutorial from "./Tutorial.vue"
@@ -73,6 +79,8 @@ const tutorialRef = ref<InstanceType<typeof Tutorial>>()
defineEmits(["hide"])
const isLoggedIn = computed(() => localStorage.getItem(STORAGE_KEY.LOGIN) === "true")
const hideNav = computed(
() =>
taskTab.value !== TASK_TYPE.Tutorial ||