Add header for game list (#3)
Co-authored-by: Maxime Adler <madler@sqli.com> Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using GameIdeas.BlazorApp.Pages.Games.Models;
|
||||
using GameIdeas.BlazorApp.Shared.Components.Dropdown;
|
||||
using GameIdeas.Resources;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Shared.Headers;
|
||||
|
||||
public partial class HeaderBase
|
||||
{
|
||||
[Parameter] public RenderFragment? Body { get; set; }
|
||||
[Parameter] public EventCallback<AddType> AddTypeChanged { get; set; }
|
||||
|
||||
private DropdownContent<AddTypeParams>? DropdownAdd;
|
||||
private readonly IEnumerable<AddTypeParams> AddTypes =
|
||||
[
|
||||
new AddTypeParams(AddType.Manual, ResourcesKey.ManualAdd),
|
||||
new AddTypeParams(AddType.Auto, ResourcesKey.AutoAdd)
|
||||
];
|
||||
|
||||
private AccountSettings? AccountSettings;
|
||||
|
||||
private void HandleIconClicked()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private async Task HandleMoreButton()
|
||||
{
|
||||
if (DropdownAdd != null)
|
||||
{
|
||||
await DropdownAdd.OpenAsync();
|
||||
}
|
||||
|
||||
AccountSettings?.Close();
|
||||
}
|
||||
|
||||
private async Task HandleAddTypeClickedAsync(AddTypeParams value)
|
||||
{
|
||||
await AddTypeChanged.InvokeAsync(value.AddType);
|
||||
}
|
||||
|
||||
private void HandleAccountClicked()
|
||||
{
|
||||
AccountSettings?.Toggle();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user