mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-09-20 01:54:20 +02:00
71 lines
2.7 KiB
Plaintext
71 lines
2.7 KiB
Plaintext
@using WebSharpRSS.Models
|
|
@using MudBlazor.Utilities
|
|
@using CodeHollow.FeedReader
|
|
@using Serilog
|
|
<style>
|
|
.cat-item{
|
|
background: transparent;
|
|
}
|
|
.cat-item:hover{
|
|
background: @Colors.Blue.Accent1;
|
|
}
|
|
</style>
|
|
<MudStack Spacing="2">
|
|
<MudNavMenu>
|
|
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
|
|
</MudNavMenu>
|
|
<CategoryGuide Categories="Categories" HandleCat="HandleCat"/>
|
|
@*<MudList DisableGutters="true" Clickable="true" Color="Color.Warning" SelectedItemChanged="Callback">
|
|
<MudListSubheader>
|
|
Categories
|
|
</MudListSubheader>
|
|
@foreach (CategoryGuideItem 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>
|
|
|
|
@code {
|
|
public HashSet<CategoryGuideItem> Categories = new HashSet<CategoryGuideItem>();
|
|
protected override void OnInitialized()
|
|
{
|
|
Log.Verbose("Setting up test data");
|
|
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 });
|
|
}
|
|
|
|
private void Callback(MudListItem obj)
|
|
{
|
|
switch (obj.Value)
|
|
{
|
|
case CategoryGuideItem catTreeItem:
|
|
break;
|
|
case Feed feed:
|
|
break;
|
|
}
|
|
}
|
|
|
|
private void HandleCat(CategoryGuideItem obj)
|
|
{
|
|
//throw new NotImplementedException();
|
|
}
|
|
|
|
} |