You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.4 KiB
71 lines
1.4 KiB
@layout PageLayout |
|
|
|
@inject INoteService noteService |
|
@implements IDisposable |
|
|
|
@page "/notes/{href1}/{href2?}/{href3?}/{href4?}/{href5?}" |
|
|
|
|
|
@if (!noteService.IsLoaded()) |
|
{ |
|
<LoadingComponent/> |
|
} |
|
else |
|
{ |
|
<LayoutWithSidebarComponent> |
|
<Sidebar> |
|
<NoteNavComponent |
|
Connections="noteService.NoteConnectionModels" |
|
Notes="noteService.NoteContentModels"/> |
|
</Sidebar> |
|
<Content> |
|
<PaperComponent> |
|
@foreach (var note in noteService.NoteContentModels) |
|
{ |
|
if (!note.Href.Equals(Href)) |
|
{ |
|
continue; |
|
} |
|
<NoteComponent NoteContentModel="note"/> |
|
} |
|
</PaperComponent> |
|
</Content> |
|
</LayoutWithSidebarComponent> |
|
} |
|
|
|
<style> |
|
|
|
</style> |
|
|
|
@code { |
|
|
|
[Parameter] |
|
public string? Href1 { get; set; } |
|
|
|
[Parameter] |
|
public string? Href2 { get; set; } |
|
|
|
[Parameter] |
|
public string? Href3 { get; set; } |
|
|
|
[Parameter] |
|
public string? Href4 { get; set; } |
|
|
|
[Parameter] |
|
public string? Href5 { get; set; } |
|
|
|
private string Href => Href5 ?? Href4 ?? Href3 ?? Href2 ?? Href1 ?? ""; |
|
|
|
protected override void OnInitialized() |
|
{ |
|
noteService.Subscribe(StateHasChanged); |
|
|
|
noteService.Load(); |
|
} |
|
|
|
public void Dispose() |
|
{ |
|
noteService.Unsubscribe(StateHasChanged); |
|
} |
|
|
|
} |