feat: Implement initial e-learning platform frontend structure including dashboard, course management, authentication, and common UI components.
This commit is contained in:
parent
aceeb80d9a
commit
ad11c6b7c5
44 changed files with 720 additions and 578 deletions
|
|
@ -1,4 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
/**
|
||||
* @file UserAvatar.vue
|
||||
* @description คอมโพเนนต์แสดงรูปโปรไฟล์ผู้ใช้ หากไม่มีรูปจะแสดงตัวอักษรย่อของชื่อ
|
||||
*/
|
||||
const props = defineProps<{
|
||||
size?: number | string
|
||||
photoURL?: string
|
||||
|
|
@ -19,7 +23,7 @@ const avatarSize = computed(() => {
|
|||
const initials = computed(() => {
|
||||
const getFirstChar = (name?: string) => {
|
||||
if (!name) return ''
|
||||
// For Thai names, if the first char is a leading vowel (เ แ โ ใ ไ), skip it to get the consonant
|
||||
// สำหรับชื่อภาษาไทย ถ้าตัวอักษรแรกเป็นสระนำหน้า (เ แ โ ใ ไ) ให้ข้ามไปเอาพยัญชนะ
|
||||
const leadingVowels = ['เ', 'แ', 'โ', 'ใ', 'ไ']
|
||||
if (leadingVowels.includes(name.charAt(0)) && name.length > 1) {
|
||||
return name.charAt(1)
|
||||
|
|
@ -36,7 +40,7 @@ const handleImageError = () => {
|
|||
imageError.value = true
|
||||
}
|
||||
|
||||
// Watch for photoURL changes to reset error state
|
||||
// รีเซ็ตสถานะข้อผิดพลาดเมื่อรูปโปรไฟล์เปลี่ยน (Watch for photoURL changes to reset error state)
|
||||
watch(() => props.photoURL, () => {
|
||||
imageError.value = false
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
/**
|
||||
* @file UserMenu.vue
|
||||
* @description User profile dropdown menu component using Quasar.
|
||||
* @description คอมโพเนนต์เมนู Dropdown ของโปรไฟล์ผู้ใช้ ใช้ Quasar
|
||||
*/
|
||||
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
|
@ -12,7 +12,7 @@ const { currentUser, logout } = useAuth()
|
|||
const { t } = useI18n()
|
||||
const $q = useQuasar()
|
||||
|
||||
// Use centralized theme management
|
||||
// จัดการการเปลี่ยนธีมแบบรวมศูนย์ (Use centralized theme management)
|
||||
const { isDark, set } = useThemeMode()
|
||||
|
||||
const isHydrated = ref(false)
|
||||
|
|
@ -21,7 +21,7 @@ onMounted(() => {
|
|||
isHydrated.value = true
|
||||
})
|
||||
|
||||
// User Initials
|
||||
// ตัวอักษรย่อของผู้ใช้ (User Initials)
|
||||
const userInitials = computed(() => {
|
||||
if (!currentUser.value) return ''
|
||||
const f = currentUser.value.firstName?.charAt(0).toUpperCase() || 'U'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue