summaryrefslogtreecommitdiff
path: root/Pages/Component/MobileMenu.razor
blob: 49c45d553d65d05efdcf53b914e72817a1abaf82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@inject NavigationManager navigationManager
@inject IJSRuntime jsRuntime
@implements IDisposable

<div id="mobile-menu" class="hidden">
	<a href="/">Home</a>
	<a href="/TagDefinitions">Tags</a>
	<a href="/Gallery?ingest=true">Ingest</a>
	<a href="/Upload">Upload</a>
	<div id="nsfw-switch">
		<p id="nsfw-label">NSFW</p>
		<NsfwSwitch/>
	</div>
   	<a href="javascript:logout();">Logout</a>
</div>

@code {
	protected override void OnInitialized() =>
		navigationManager.LocationChanged += LocationChanged;

	public async void LocationChanged(object? sender, LocationChangedEventArgs e) =>
		await jsRuntime.InvokeVoidAsync("hideMobileMenu");

	public void Dispose() =>
		navigationManager.LocationChanged -= LocationChanged;
}