added members sidebar
This commit is contained in:
@@ -35,6 +35,7 @@ def open_chat(channel: dict, channel_name: str, is_group=False):
|
|||||||
chat_content.clear()
|
chat_content.clear()
|
||||||
|
|
||||||
with chat_content:
|
with chat_content:
|
||||||
|
# back btn
|
||||||
with ui.row():
|
with ui.row():
|
||||||
ui.button("Back", icon="arrow_back", on_click=show_contacts).props("flat")
|
ui.button("Back", icon="arrow_back", on_click=show_contacts).props("flat")
|
||||||
|
|
||||||
@@ -43,7 +44,9 @@ def open_chat(channel: dict, channel_name: str, is_group=False):
|
|||||||
|
|
||||||
ui.separator()
|
ui.separator()
|
||||||
|
|
||||||
with ui.column().classes('w-full h-full overflow-auto'):
|
with ui.row().classes('w-full h-full'):
|
||||||
|
# message history
|
||||||
|
with ui.column().classes('flex-grow h-full overflow-auto'):
|
||||||
|
|
||||||
current_messages = []
|
current_messages = []
|
||||||
|
|
||||||
@@ -54,6 +57,18 @@ def open_chat(channel: dict, channel_name: str, is_group=False):
|
|||||||
ui.chat_message(current_messages, name=msg.sender.name, stamp=msg.timestamp, sent=msg.sender != me)
|
ui.chat_message(current_messages, name=msg.sender.name, stamp=msg.timestamp, sent=msg.sender != me)
|
||||||
current_messages = []
|
current_messages = []
|
||||||
|
|
||||||
|
# users column on the right
|
||||||
|
with ui.column().classes('w-50 border-l h-full'):
|
||||||
|
ui.label("Users").classes('pl-4 text-h5')
|
||||||
|
ui.separator()
|
||||||
|
|
||||||
|
for user in set(msg.sender.name for msg in channel):
|
||||||
|
with ui.item():
|
||||||
|
with ui.item_section().props("avatar"):
|
||||||
|
ui.icon("person")
|
||||||
|
with ui.item_section():
|
||||||
|
ui.item_label(user)
|
||||||
|
|
||||||
def show_contacts():
|
def show_contacts():
|
||||||
chat_content.clear()
|
chat_content.clear()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user