btcpayserver/BTCPayServer/Blazor/Icon.razor
d11n 272cc3d3c9
POS: Option for user sign in via the QR code (#6231)
* Login Code: Turn into Blazor component and extend with data for the app

* POS: Add login code for POS frontend

* Improve components, fix test
2024-09-26 19:10:14 +09:00

20 lines
618 B
Plaintext

@using BTCPayServer.Configuration;
@using Microsoft.AspNetCore.Mvc.ViewFeatures;
@inject IFileVersionProvider FileVersionProvider
@inject BTCPayServerOptions BTCPayServerOptions
<svg role="img" class="icon icon-@Symbol">
<use href="@GetPathTo(Symbol)"></use>
</svg>
@code {
[Parameter, EditorRequired]
public string Symbol { get; set; }
private string GetPathTo(string symbol)
{
var versioned = FileVersionProvider.AddFileVersionToPath(default, "img/icon-sprite.svg");
var rootPath = (BTCPayServerOptions.RootPath ?? "/").WithTrailingSlash();
return $"{rootPath}{versioned}#{symbol}";
}
}