Skip to content

Commit 7efb0e5

Browse files
committed
Fix side bar, still need to script.
1 parent 8677477 commit 7efb0e5

2 files changed

Lines changed: 42 additions & 7 deletions

File tree

MyApp/Components/Layout/MainLayout.razor

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@inherits LayoutComponentBase
22
@inject NavigationManager NavigationManager;
3-
@inject IJSRuntime JS
43

54
<div>
65
<Header />
@@ -9,8 +8,7 @@
98

109
<div class="md:pl-64 flex flex-col flex-1">
1110
<div class="sticky top-0 z-10 md:hidden pl-1 pt-1 sm:pl-3 sm:pt-3 bg-white dark:bg-black">
12-
<button type="button" class="-ml-0.5 -mt-0.5 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"
13-
@onclick=@(() => CollapseSidebar = false)>
11+
<button type="button" onclick="toggleSidebar()" class="-ml-0.5 -mt-0.5 h-12 w-12 inline-flex items-center justify-center rounded-md text-gray-500 hover:text-gray-900 dark:hover:text-gray-50 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500">
1412
<span class="sr-only">Open sidebar</span>
1513
<!-- Heroicon name: outline/menu -->
1614
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true">
@@ -26,9 +24,44 @@
2624
</div>
2725
</main>
2826
</div>
29-
3027
</div>
3128

32-
@code {
33-
bool CollapseSidebar = true;
34-
}
29+
<script type="module">
30+
import { remount } from "/mjs/app.mjs"
31+
remount()
32+
</script>
33+
34+
<div id="blazor-error-ui" class="hidden fixed bottom-0 w-full z-10">
35+
<div class="flex rounded-md bg-yellow-50 p-4 m-4">
36+
<div class="flex-shrink-0">
37+
<!-- Heroicon name: solid/exclamation -->
38+
<svg class="h-5 w-5 text-yellow-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
39+
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
40+
</svg>
41+
</div>
42+
<div class="ml-3">
43+
<environment include="Staging,Production">
44+
<h3 class="text-sm font-medium text-yellow-800">An error has occurred. This application may no longer respond until reloaded.</h3>
45+
</environment>
46+
<environment include="Development">
47+
<h3 class="text-sm font-medium text-yellow-800">An unhandled exception has occurred. See browser dev tools for details.</h3>
48+
</environment>
49+
<div class="mt-4">
50+
<div class="-mx-2 -my-1.5 flex">
51+
<button type="button" class="reload bg-yellow-50 px-2 py-1.5 rounded-md text-sm font-medium text-yellow-800 hover:bg-yellow-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-yellow-50 focus:ring-yellow-600">Reload</button>
52+
</div>
53+
</div>
54+
</div>
55+
<div class="ml-auto pl-3">
56+
<div class="-mx-1.5 -my-1.5">
57+
<button type="button" class="dismiss inline-flex bg-yellow-50 rounded-md p-1.5 text-yellow-500 hover:bg-yellow-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-yellow-50 focus:ring-yellow-600">
58+
<span class="sr-only">Dismiss</span>
59+
<!-- Heroicon name: solid/x -->
60+
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
61+
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
62+
</svg>
63+
</button>
64+
</div>
65+
</div>
66+
</div>
67+
</div>

MyApp/Components/Shared/Sidebar.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ function toggleSidebar() {
8383
}
8484
document.addEventListener('DOMContentLoaded', () =>
8585
Blazor.addEventListener('enhancedload', hideSidebar))
86+
87+
hideSidebar();
8688
</script>
8789

8890
@code {

0 commit comments

Comments
 (0)