This repository has been archived on 2026-04-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
watch-together-yandex-disk/web/custom_widgets/header.py
T

17 lines
678 B
Python

from nicegui import ui
from web.misc import logout, check_user
async def draw_header():
with ui.header(wrap=False):
with ui.row(wrap=False).classes("w-full justify-between"):
with ui.row(wrap=False).classes("items-center"):
ui.button(icon="home", on_click=lambda: ui.navigate.to("/contents"))
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))