From b48f78a381058c188ed61e6f372fbf86d95ad2f9 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Wed, 14 Jun 2023 22:26:39 +0200 Subject: Add changes --- .../RoomListComponents/RoomListCategory.razor | 24 +++++++++++++ .../Shared/RoomListComponents/RoomListSpace.razor | 42 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor create mode 100644 MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor (limited to 'MatrixRoomUtils.Web/Shared/RoomListComponents') diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor new file mode 100644 index 0000000..ecdcc68 --- /dev/null +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor @@ -0,0 +1,24 @@ +
+ @roomType (@rooms.Count) + @foreach (var room in rooms) { +
+ + View timeline + + @if (roomType == "Space") { + + } +
+ } +
+
+ +@code { + + [Parameter] + public KeyValuePair> Category { get; set; } + + private string roomType => Category.Key; + private List rooms => Category.Value; + +} \ No newline at end of file diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor new file mode 100644 index 0000000..c90ae8f --- /dev/null +++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListSpace.razor @@ -0,0 +1,42 @@ +Manage space + +
+
+ @Children.Count children + @if (_shouldRenderChildren) { +

Breadcrumb: @Breadcrumbs

+
+ +
+ } +
+ +@code { + + [Parameter] + public Room Space { get; set; } + + [Parameter, CascadingParameter] + public string? Breadcrumbs { + get => _breadcrumbs + Space.RoomId; + set => _breadcrumbs = value; + } + + private List Children { get; set; } = new(); + + protected override async Task OnInitializedAsync() { + if (Breadcrumbs == null) throw new ArgumentNullException(nameof(Breadcrumbs)); + Children = (await Space.AsSpace.GetRoomsAsync()).Where(x => !Breadcrumbs.Contains(x.RoomId)).ToList(); + await base.OnInitializedAsync(); + } + + private bool _shouldRenderChildren = false; + private string? _breadcrumbs; + + private async Task SpaceChildrenOpened() { + if (_shouldRenderChildren) return; + _shouldRenderChildren = true; + Console.WriteLine($"[RoomList] Rendering children of {Space.RoomId}"); + } + +} \ No newline at end of file -- cgit 1.5.1