feat: Implement core user profile, dashboard, course browsing pages, common components, and internationalization.
This commit is contained in:
parent
01978f9438
commit
11d714c632
10 changed files with 289 additions and 99 deletions
|
|
@ -14,6 +14,7 @@ import { ref, computed, onMounted } from 'vue'
|
|||
import { useAuth } from '~/composables/useAuth'
|
||||
|
||||
const { currentUser, logout } = useAuth()
|
||||
const { t } = useI18n()
|
||||
const isOpen = ref(false)
|
||||
const isDarkMode = ref(false)
|
||||
const menuRef = ref<HTMLDivElement | null>(null)
|
||||
|
|
@ -42,12 +43,13 @@ const userName = computed(() => {
|
|||
})
|
||||
|
||||
// Navigation menu definition
|
||||
const menuItems = [
|
||||
{ label: 'หน้าหลัก', to: '/dashboard' },
|
||||
{ label: 'รายการคอร์ส', to: '/browse/discovery' },
|
||||
{ label: 'คอร์สของฉัน', to: '/dashboard/my-courses' },
|
||||
{ label: 'ตั้งค่าบัญชี', to: '/dashboard/profile' }
|
||||
]
|
||||
// Navigation menu definition
|
||||
const menuItems = computed(() => [
|
||||
{ label: t('userMenu.home'), to: '/dashboard' },
|
||||
{ label: t('userMenu.courseList'), to: '/browse/discovery' },
|
||||
{ label: t('userMenu.myCourses'), to: '/dashboard/my-courses' },
|
||||
{ label: t('userMenu.settings'), to: '/dashboard/profile' }
|
||||
])
|
||||
|
||||
const handleNavigate = (path: string) => {
|
||||
navigateTo(path)
|
||||
|
|
@ -166,7 +168,7 @@ onMounted(() => {
|
|||
class="w-full flex items-center justify-between py-2"
|
||||
@click="toggleDarkMode"
|
||||
>
|
||||
<span class="text-sm font-medium text-slate-800 dark:text-white">โหมดกลางคืน</span>
|
||||
<span class="text-sm font-medium text-slate-800 dark:text-white">{{ $t('userMenu.darkMode') }}</span>
|
||||
<div
|
||||
:class="[
|
||||
'relative inline-flex h-6 w-11 items-center rounded-full transition-colors',
|
||||
|
|
@ -189,7 +191,7 @@ onMounted(() => {
|
|||
class="w-full px-4 py-2 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/40 rounded-lg font-medium transition-colors text-sm"
|
||||
@click="handleLogout"
|
||||
>
|
||||
ออกจากระบบ
|
||||
{{ $t('userMenu.logout') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue