about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-04-05 19:01:39 +0200
committerRory& <root@rory.gay>2024-04-05 19:02:00 +0200
commit9319fe76c56b79e0933c09280fe32658c2f176c7 (patch)
treeafc31b8b8b2a683b549e352237e2260efe97fba6 /MatrixUtils.Web/Pages/Rooms/Index2Components/MainTabComponents
parentChanges (diff)
downloadMatrixUtils-9319fe76c56b79e0933c09280fe32658c2f176c7.tar.xz
Cleanup, work on index2, some tooling updates
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