add username to header
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from nicegui import ui
|
||||
|
||||
from web.misc import logout
|
||||
from web.misc import logout, check_user
|
||||
|
||||
|
||||
async def draw_header():
|
||||
@@ -8,4 +8,8 @@ async def draw_header():
|
||||
with ui.row(wrap=False).classes("w-full justify-between") as header_row:
|
||||
ui.button(icon="home", on_click=lambda: ui.navigate.to("/"))
|
||||
ui.button(text="Rooms", icon="movie", on_click=lambda: ui.navigate.to("/rooms"))
|
||||
|
||||
with ui.row(wrap=False).classes("items-center"):
|
||||
if user := await check_user():
|
||||
ui.html(f"<b>{user.username}</b>")
|
||||
ui.button(icon="logout", on_click=lambda: logout(redirect=True))
|
||||
|
||||
Reference in New Issue
Block a user