SharpRSS/WebSharpRSS/Shared/SideGuide.razor

58 lines
2.2 KiB
Plaintext
Raw Normal View History

2023-04-28 21:58:36 +02:00
@using WebSharpRSS.Models
@using MudBlazor.Utilities
2023-04-29 19:40:16 +02:00
@using CodeHollow.FeedReader
@using Serilog
2023-04-28 21:58:36 +02:00
2023-04-29 19:40:16 +02:00
<MudStack Spacing="2">
<MudNavMenu>
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
</MudNavMenu>
<MudList DisableGutters="true" Clickable="true" Color="Color.Warning" SelectedItemChanged="Callback">
<MudListSubheader>
Categories
</MudListSubheader>
@foreach (CategoryTreeItem cat in Categories)
{
/* Category item*/
<MudListItem Class="pl-4" Text="@cat.CategoryTitle" Icon="@cat.CategoryIcon" @bind-Expanded="@cat.IsExpanded">
<NestedList>
@if (cat.IsExpanded)
{
foreach (Feed feed in cat.Feeds)
{
/* Feed item */
<MudListItem Value="feed">
<MudImage ObjectFit="ObjectFit.ScaleDown" Height="16" Width="16" Class="d-inline" Src="https://fedoramagazine.org/wp-content/themes/fedoramagazine-1.15/favicon.ico"/>
<MudText Class="d-inline">@feed.Title</MudText>
</MudListItem>
}
}
</NestedList>
</MudListItem>
}
</MudList>
</MudStack>
2023-04-28 21:58:36 +02:00
@code {
public HashSet<CategoryTreeItem> Categories = new HashSet<CategoryTreeItem>();
protected override void OnInitialized()
{
2023-04-29 19:40:16 +02:00
Log.Verbose("Setting up test data");
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Social", CategoryIcon = Icons.Material.Filled.People });
2023-04-28 21:58:36 +02:00
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Blogs", CategoryIcon = Icons.Material.Filled.RssFeed });
Categories.Add(new CategoryTreeItem() { CategoryTitle = "Tech", CategoryIcon = Icons.Material.Filled.Computer });
Categories.Add(new CategoryTreeItem() { CategoryTitle = "News", CategoryIcon = Icons.Material.Filled.Newspaper });
}
2023-04-29 19:40:16 +02:00
private void Callback(MudListItem obj)
{
switch (obj.Value)
{
case CategoryTreeItem catTreeItem:
break;
case Feed feed:
break;
}
}
2023-04-28 21:58:36 +02:00
}