mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2025-01-18 21:04:21 +01:00
Fixed feed item click crash & cleaned unused code.
This commit is contained in:
parent
493d20820a
commit
7529796b12
|
@ -97,9 +97,9 @@
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public HashSet<CategoryGuideItem> Categories { get; set; } = new HashSet<CategoryGuideItem>();
|
public HashSet<CategoryGuideItem> Categories { get; set; } = new HashSet<CategoryGuideItem>();
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public Action<CategoryGuideItem> HandleCat { get; set; }
|
public Action<CategoryGuideItem>? CatItemClicked { get; set; }
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public Action<FeedGuideItem> FeedItemClicked { get; set; }
|
public Action<FeedGuideItem>? FeedItemClicked { get; set; }
|
||||||
|
|
||||||
ISelectableGuideItem? _selectedCategory;
|
ISelectableGuideItem? _selectedCategory;
|
||||||
|
|
||||||
|
@ -114,10 +114,14 @@
|
||||||
_selectedCategory = categoryItem;
|
_selectedCategory = categoryItem;
|
||||||
_selectedCategory.IsSelected = true;
|
_selectedCategory.IsSelected = true;
|
||||||
}
|
}
|
||||||
// Handle the click.
|
switch (categoryItem)
|
||||||
if (categoryItem is CategoryGuideItem catGuideItem)
|
{
|
||||||
HandleCat(catGuideItem);
|
case CategoryGuideItem catGuideItem:
|
||||||
/*if (categoryItem is FeedGuideItem feedGuideItem)
|
CatItemClicked?.Invoke(catGuideItem);
|
||||||
FeedItemClicked(feedGuideItem);*/
|
break;
|
||||||
|
case FeedGuideItem feedGuideItem:
|
||||||
|
FeedItemClicked?.Invoke(feedGuideItem);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,43 +2,12 @@
|
||||||
@using MudBlazor.Utilities
|
@using MudBlazor.Utilities
|
||||||
@using CodeHollow.FeedReader
|
@using CodeHollow.FeedReader
|
||||||
@using Serilog
|
@using Serilog
|
||||||
<style>
|
|
||||||
.cat-item{
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
.cat-item:hover{
|
|
||||||
background: @Colors.Blue.Accent1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<MudStack Spacing="2">
|
<MudStack Spacing="2">
|
||||||
<MudNavMenu>
|
<MudNavMenu>
|
||||||
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
|
<MudNavLink Href="/" Icon="@Icons.Material.Filled.Home">Home</MudNavLink>
|
||||||
</MudNavMenu>
|
</MudNavMenu>
|
||||||
<CategoryGuide Categories="Categories" HandleCat="HandleCat"/>
|
<CategoryGuide Categories="Categories" CatItemClicked="CategoryClicked" FeedItemClicked="FeedClicked"/>
|
||||||
@*<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>
|
</MudStack>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
@ -63,9 +32,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleCat(CategoryGuideItem obj)
|
private void CategoryClicked(CategoryGuideItem catItem)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FeedClicked(FeedGuideItem feedItem)
|
||||||
{
|
{
|
||||||
//throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user