about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents')
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor37
-rw-r--r--MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor.css6
2 files changed, 38 insertions, 5 deletions
diff --git a/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor b/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor

index 4216824..7a3b27b 100644 --- a/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor +++ b/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor
@@ -1,17 +1,34 @@ @using MatrixUtils.Abstractions -<div class="spaceListItem" onclick="@ToggleSpace"> +<div class="spaceListItem" style="@(SelectedSpace == Space ? "background-color: #FFFFFF33;" : "")" onclick="@SelectSpace"> + @if (IsSpaceOpened()) { + <span onclick="@ToggleSpace">▼ </span> + } + else { + <span onclick="@ToggleSpace">▶ </span> + } + <MxcImage Circular="true" Height="32" Width="32" Homeserver="Space.Room.Homeserver" MxcUri="@Space.RoomIcon"></MxcImage> <span class="spaceNameEllipsis">@Space.RoomName</span> + + @if (IsSpaceOpened()) { + <span>meow</span> + } </div> @code { [Parameter] public RoomInfo Space { get; set; } + + [Parameter] + public RoomInfo SelectedSpace { get; set; } + + [Parameter] + public EventCallback<RoomInfo> SelectedSpaceChanged { get; set; } [Parameter] public List<RoomInfo> OpenedSpaces { get; set; } - + protected override Task OnInitializedAsync() { Space.PropertyChanged += (sender, args) => { StateHasChanged(); }; return base.OnInitializedAsync(); @@ -20,8 +37,20 @@ public void ToggleSpace() { if (OpenedSpaces.Contains(Space)) { OpenedSpaces.Remove(Space); - } else { + } + else { OpenedSpaces.Add(Space); } } -} \ No newline at end of file + + public void SelectSpace() { + SelectedSpace = Space; + SelectedSpaceChanged.InvokeAsync(Space); + } + + public bool IsSpaceOpened() { + return OpenedSpaces.Contains(Space); + } + +} + diff --git a/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor.css b/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor.css
index c174567..a88975b 100644 --- a/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor.css +++ b/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents/MainTabSpaceItem.razor.css
@@ -5,11 +5,15 @@ text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; - width: calc(100% - 38px); + width: calc(100% - 64px); } .spaceListItem { display: block; width: 100%; height: 50px; +} + +.spaceListItem > img { + display: inline-block; } \ No newline at end of file