Skip to content

Commit

Permalink
Display: Simply MyCourses component
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Feb 5, 2025
1 parent 1f06b5a commit b3d43aa
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions assets/vue/layouts/MyCourses.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
<template>
<div class="flex justify-between items-center">
<h2 v-t="'My courses'" />
<Button
v-if="isTeacher"
:label="t('Course')"
class="p-button-secondary hidden md:inline-flex"
icon="pi pi-plus"
@click="redirectToCreateCourse"
/>
</div>
<hr />
<SectionHeader :title="t('My courses')">
<BaseAppLink :to="{ name: 'CourseCreate' }">
<BaseButton
v-if="isTeacher"
type="secondary"
icon="plus"
:label="t('Course')"
/>
</BaseAppLink>
</SectionHeader>
<router-view />
</template>

<script setup>
import Button from "primevue/button"
import { useI18n } from "vue-i18n"
import { storeToRefs } from "pinia"
import { useSecurityStore } from "../store/securityStore"
import { useRouter } from "vue-router"
import SectionHeader from "../components/layout/SectionHeader.vue"
import BaseButton from "../components/basecomponents/BaseButton.vue"
import BaseAppLink from "../components/basecomponents/BaseAppLink.vue"
const { t } = useI18n()
const { isTeacher } = storeToRefs(useSecurityStore())
const router = useRouter()
const redirectToCreateCourse = () => {
router.push({ name: "CourseCreate" })
}
</script>

0 comments on commit b3d43aa

Please sign in to comment.