feat: initial LMS frontend with adaptive navigation and routing

This commit is contained in:
Flook
2026-05-04 17:44:35 +07:00
commit b4725b184b
17 changed files with 395 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import flet as ft
from app.widgets.adaptive_menu import adaptive_menu
def main_layout(page: ft.Page, content_container: ft.Container):
print(">>> ENTER main_layout")
menu = adaptive_menu(page)
# ตรวจสอบโหมด (ป้องกันหน้าจอขาวจาก width=0)
width = page.width if page.width > 0 else 1024 # default ไว้ที่ desktop ก่อนถ้ายังไม่รู้ width
is_mobile = width < 600
print(f">>> Device mode: {'MOBILE' if is_mobile else 'DESKTOP'} (Width: {page.width})")
if is_mobile:
return ft.Column(
controls=[
content_container,
menu
],
expand=True
)
else:
return ft.Row(
controls=[
menu,
ft.VerticalDivider(width=1),
content_container
],
expand=True
)