about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/MainLayout.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-01 02:43:32 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-01 02:43:32 +0200
commitdf9031c47f8e97d8e2df3177093271a458f27267 (patch)
tree4e81dec4048c6e76a928ef69c905560d7c173fdf /MatrixRoomUtils.Web/Shared/MainLayout.razor
downloadMatrixUtils-df9031c47f8e97d8e2df3177093271a458f27267.tar.xz
Initial commit
Diffstat (limited to 'MatrixRoomUtils.Web/Shared/MainLayout.razor')
-rw-r--r--MatrixRoomUtils.Web/Shared/MainLayout.razor36
1 files changed, 36 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Web/Shared/MainLayout.razor b/MatrixRoomUtils.Web/Shared/MainLayout.razor
new file mode 100644
index 0000000..e0c8260
--- /dev/null
+++ b/MatrixRoomUtils.Web/Shared/MainLayout.razor
@@ -0,0 +1,36 @@
+@inherits LayoutComponentBase
+
+@using Blazored.LocalStorage
+@using MatrixRoomUtils.Web.Classes
+@inject ILocalStorageService LocalStorage
+@inject NavigationManager NavigationManager
+
+<div class="page">
+    <div class="sidebar">
+        <NavMenu/>
+    </div>
+
+    <main>
+        <div class="top-row px-4">
+            <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
+        </div>
+
+        <article class="content px-4">
+            @Body
+        </article>
+    </main>
+</div>
+
+@code {
+
+    protected override async Task OnInitializedAsync()
+    {
+        if (!RuntimeStorage.WasLoaded)
+        {
+            await RuntimeStorage.LoadFromLocalStorage(LocalStorage);
+            Console.WriteLine("Loaded from local storage");
+            StateHasChanged();
+        }
+    }
+
+}
\ No newline at end of file