SharpRSS/WebSharpRSS/Shared/SideGuide.razor

71 lines
2.7 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-30 20:13:14 +02:00
<style>
.cat-item{
background: transparent;
}
.cat-item:hover{
background: @Colors.Blue.Accent1;
}
</style>
2023-04-29 19:40:16 +02:00
<MudStack Spacing="2">
<MudNavMenu>
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
</MudNavMenu>
2023-04-30 20:13:14 +02:00
<CategoryGuide Categories="Categories" HandleCat="HandleCat"/>
@*<MudList DisableGutters="true" Clickable="true" Color="Color.Warning" SelectedItemChanged="Callback">
2023-04-29 19:40:16 +02:00
<MudListSubheader>
Categories
</MudListSubheader>
2023-04-30 20:13:14 +02:00
@foreach (CategoryGuideItem cat in Categories)
2023-04-29 19:40:16 +02:00
{
/* 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>
}
2023-04-30 20:13:14 +02:00
</MudList>*@
2023-04-29 19:40:16 +02:00
</MudStack>
2023-04-28 21:58:36 +02:00
@code {
2023-04-30 20:13:14 +02:00
public HashSet<CategoryGuideItem> Categories = new HashSet<CategoryGuideItem>();
2023-04-28 21:58:36 +02:00
protected override void OnInitialized()
{
2023-04-29 19:40:16 +02:00
Log.Verbose("Setting up test data");
2023-04-30 20:13:14 +02:00
Categories.Add(new CategoryGuideItem() { CategoryTitle = "Social", CategoryIcon = Icons.Material.Filled.People });
Categories.Add(new CategoryGuideItem() { CategoryTitle = "Blogs", CategoryIcon = Icons.Material.Filled.RssFeed, CategoryHexColor = Colors.Green.Accent1 });
Categories.Add(new CategoryGuideItem() { CategoryTitle = "Tech", CategoryIcon = Icons.Material.Filled.Computer, CategoryHexColor = Colors.Brown.Lighten1 });
Categories.Add(new CategoryGuideItem() { CategoryTitle = "News", CategoryIcon = Icons.Material.Filled.Newspaper, CategoryHexColor = Colors.Red.Accent1 });
2023-04-28 21:58:36 +02:00
}
2023-04-29 19:40:16 +02:00
private void Callback(MudListItem obj)
{
switch (obj.Value)
{
2023-04-30 20:13:14 +02:00
case CategoryGuideItem catTreeItem:
2023-04-29 19:40:16 +02:00
break;
case Feed feed:
break;
}
}
2023-04-30 20:13:14 +02:00
private void HandleCat(CategoryGuideItem obj)
{
//throw new NotImplementedException();
}
2023-04-28 21:58:36 +02:00
}