LANCommander/LANCommander.Client/UI/Components/Footer.razor

38 lines
915 B
Text
Raw Permalink Normal View History

2024-05-27 17:07:28 -05:00
@using LANCommander.Client.Models
2024-05-30 00:31:38 -05:00
@using System.Diagnostics
2024-05-27 17:07:28 -05:00
@inject DownloadService DownloadService
2024-05-29 20:01:46 -05:00
@inject SDK.Client Client
@inject GameService GameService
2024-05-27 17:07:28 -05:00
2024-05-29 20:01:46 -05:00
<footer>
@if (DownloadService.Queue.Any(qi => qi.State))
{
<div class="downloader" @onclick="() => ShowDownloadQueue()">
<CurrentDownloadItem ShowIcon="true" />
</div>
}
else
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" OnClick="() => ShowDownloadQueue()">Downloads</Button>
}
2024-05-29 20:01:46 -05:00
</footer>
2024-05-27 17:07:28 -05:00
2024-05-29 20:13:38 -05:00
<DownloadQueue @bind-Visible="@DownloadQueueVisible" />
2024-05-27 17:07:28 -05:00
@code {
2024-05-29 20:13:38 -05:00
bool DownloadQueueVisible = false;
protected override async Task OnInitializedAsync()
{
DownloadService.OnQueueChanged += async () =>
{
await InvokeAsync(StateHasChanged);
};
}
2024-05-29 20:13:38 -05:00
async Task ShowDownloadQueue()
{
DownloadQueueVisible = true;
}
2024-05-27 17:07:28 -05:00
}