LANCommander/LANCommander.Launcher/UI/Components/Footer.razor

82 lines
3.1 KiB
Text
Raw Permalink Normal View History

@using LANCommander.Launcher.Models
2024-05-30 00:31:38 -05:00
@using System.Diagnostics
2024-05-29 20:01:46 -05:00
@inject SDK.Client Client
2024-11-12 02:35:28 -06:00
@inject InstallService InstallService
@inject GameService GameService
2024-11-12 02:35:28 -06:00
@inject NavigationManager NavigationManager
@inject LocalizationService LocalizationService
2024-11-12 02:35:28 -06:00
2025-02-22 00:26:54 -06:00
<Flex Justify="FlexJustify.Center" Align="FlexAlign.Center" Gap="FlexGap.Small" Class="footer">
<div style="flex: 1;">
@if (NavigationManager.Uri.Contains("/Depot"))
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Hdd" OnClick="@(() => NavigationManager.NavigateTo("/"))">@LocalizationService.GetString("Library")</Button>
2025-02-22 00:26:54 -06:00
}
else
{
if (Client.Settings?.EnableUserLibraries ?? false)
2025-02-22 00:26:54 -06:00
{
<ConnectionStateView>
<Online>
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" OnClick="@(() => NavigationManager.NavigateTo("/Depot"))">@LocalizationService.GetString("Depot")</Button>
2025-02-22 00:26:54 -06:00
</Online>
<Offline>
<Tooltip Title="@LocalizationService.GetString("YouAreCurrentlyOffline")" Placement="Placement.TopLeft">
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.AppstoreAdd" Disabled>@LocalizationService.GetString("Depot")</Button>
2025-02-22 00:26:54 -06:00
</Tooltip>
</Offline>
</ConnectionStateView>
}
}
</div>
2024-05-27 17:07:28 -05:00
<ConnectionStateView>
<Online>
@if (InstallService.Queue.Any(qi => qi.State))
{
<div class="downloader" @onclick="() => ShowDownloadQueue()" style="flex-shrink: 0;">
<CurrentDownloadItem ShowIcon="true"/>
</div>
}
else
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" OnClick="() => ShowDownloadQueue()">@LocalizationService.GetString("Downloads")</Button>
}
</Online>
<Offline>
<Tooltip Title="@LocalizationService.GetString("YouAreCurrentlyOffline")" Placement="Placement.TopLeft">
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" Disabled>@LocalizationService.GetString("Downloads")</Button>
</Tooltip>
</Offline>
</ConnectionStateView>
2024-11-12 02:35:28 -06:00
2025-02-22 00:26:54 -06:00
<div style="flex: 1; text-align: right;">
<Tooltip Title="@LocalizationService.GetString("ComingSoon")" Placement="Placement.TopRight">
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Team" Disabled>@LocalizationService.GetString("Friends")</Button>
2025-02-22 00:26:54 -06:00
</Tooltip>
</div>
2024-11-12 02:35:28 -06:00
</Flex>
2024-05-27 17:07:28 -05:00
<DownloadQueue @ref="DownloadQueue" />
2024-05-29 20:13:38 -05:00
2024-05-27 17:07:28 -05:00
@code {
[CascadingParameter] public bool Connected { get; set; }
2024-05-29 20:13:38 -05:00
bool DownloadQueueVisible = false;
DownloadQueue DownloadQueue;
protected override async Task OnInitializedAsync()
{
InstallService.OnQueueChanged += async () =>
{
await InvokeAsync(StateHasChanged);
};
}
2024-05-29 20:13:38 -05:00
async Task ShowDownloadQueue()
{
await DownloadQueue.Show();
2024-05-29 20:13:38 -05:00
}
2024-05-27 17:07:28 -05:00
}