42 lines
1.3 KiB
Python
42 lines
1.3 KiB
Python
import flet as ft
|
|
import designer as ds
|
|
from info import AuthService
|
|
from views.content_users.main_page import MainPageUser
|
|
|
|
|
|
class UserView(ft.View):
|
|
def __init__(self, page: ft.Page):
|
|
self._auth = AuthService(page)
|
|
url_key = page.session.store.get("url_key") or ""
|
|
|
|
profile_btn = ft.IconButton(
|
|
icon=ft.Icons.ACCOUNT_CIRCLE,
|
|
icon_color=ds.clolors.ferst,
|
|
icon_size=30,
|
|
tooltip="Профиль",
|
|
on_click=lambda _: page.go(f"/profile/{url_key}"),
|
|
)
|
|
|
|
super().__init__(
|
|
route=f"/user/{url_key}",
|
|
bgcolor=ds.clolors.background,
|
|
horizontal_alignment=ft.CrossAxisAlignment.START,
|
|
vertical_alignment=ft.MainAxisAlignment.START,
|
|
)
|
|
self.controls = [
|
|
ft.Column(
|
|
expand=True,
|
|
alignment=ft.MainAxisAlignment.START,
|
|
controls=[
|
|
ft.Row(
|
|
alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
|
|
controls=[
|
|
ds.CastomText(text="Добро пожаловать в COPP!", size=24, weight=ft.FontWeight.BOLD),
|
|
profile_btn,
|
|
]
|
|
),
|
|
MainPageUser(page),
|
|
]
|
|
)
|
|
]
|