oqtane.framework/Oqtane.Client/Themes/Controls/Theme/Logo.razor
2021-05-26 12:01:35 -04:00

24 lines
606 B
Plaintext

@namespace Oqtane.Themes.Controls
@inherits ThemeControlBase
@inject IFileService FileService
@if (file != null)
{
<span class="app-logo">
<a href="@PageState.Alias.Path">
<img class="img-fluid" src="@file.Url" alt="@PageState.Site.Name" />
</a>
</span>
}
@code {
private File file = null;
protected override async Task OnParametersSetAsync()
{
if (PageState.Site.LogoFileId != null && file?.FileId != PageState.Site.LogoFileId.Value)
{
file = await FileService.GetFileAsync(PageState.Site.LogoFileId.Value);
}
}
}