LANCommander/LANCommander.Launcher/UI/Components/Footer.razor
2024-11-14 00:33:56 -06:00

60 lines
1.7 KiB
Text

@using LANCommander.Launcher.Models
@using System.Diagnostics
@inject SDK.Client Client
@inject InstallService InstallService
@inject GameService GameService
@inject NavigationManager NavigationManager
<Flex Justify="space-between" Class="footer">
@if (NavigationManager.Uri.Contains("/Depot"))
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Hdd" OnClick="@(() => NavigationManager.NavigateTo("/"))">Library</Button>
}
else
{
if (Client.IsConnected())
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" OnClick="@(() => NavigationManager.NavigateTo("/Depot"))">Depot</Button>
}
else
{
<Tooltip Title="You are currently offline">
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" Disabled>Depot</Button>
</Tooltip>
}
}
@if (InstallService.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>
}
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Team">Friends</Button>
</Flex>
<DownloadQueue @ref="DownloadQueue" />
@code {
bool DownloadQueueVisible = false;
DownloadQueue DownloadQueue;
protected override async Task OnInitializedAsync()
{
InstallService.OnQueueChanged += async () =>
{
await InvokeAsync(StateHasChanged);
};
}
async Task ShowDownloadQueue()
{
await DownloadQueue.Show();
}
}