added pair screen, home screen, and channels screen

This commit is contained in:
2026-03-08 06:56:18 +11:00
parent 3bcab4414a
commit 83c927d23a
11 changed files with 197 additions and 40 deletions

View File

@@ -0,0 +1,55 @@
from textual.containers import VerticalScroll, Vertical, HorizontalGroup
from textual.widgets import Static, Button, Rule
from api.channel import Channel
class ChannelView(Button):
DEFAULT_CSS = """
ChannelView {
margin: 0 1;
background: $boost;
border: $surface-lighten-1 tall;
content-align: left middle;
text-align: left;
width: 30;
}
"""
def __init__(self, channel: Channel):
super().__init__(" [b]" + channel.name, flat=True)
self.channel = channel
class ChannelsList(Vertical):
DEFAULT_CSS = """
ChannelsList {
Rule {
color: $surface-lighten-1;
}
#buttons {
margin-bottom: 1;
Button {
margin: 0 1;
}
}
}
"""
def compose(self):
with VerticalScroll():
yield Static("channels", classes="banner")
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield ChannelView(Channel("test channel", "AQ=="))
yield Rule()
with HorizontalGroup(id="buttons"):
yield Button("Create Channel")
yield Button("Advertise")