btcpayserver/BTCPayServer/Views/Shared/LNURL/LightningAddressOption.cshtml
2022-01-25 06:57:55 +01:00

51 lines
2.3 KiB
Plaintext

@using BTCPayServer.Payments.Lightning
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
var store = Context.GetStoreData();
var cryptoCode = "BTC";
var isLightningEnabled = store.IsLightningEnabled(BTCPayNetworkProvider);
var isLNUrlEnabled = store.IsLNUrlEnabled(BTCPayNetworkProvider);
var possible =
isLightningEnabled &&
isLNUrlEnabled &&
store.GetSupportedPaymentMethods(BTCPayNetworkProvider).OfType<LNURLPaySupportedPaymentMethod>().Any(type => type.CryptoCode == cryptoCode);
}
<li class="list-group-item bg-tile" id="lightning-address-option">
<div class="d-flex align-items-center">
<span class="d-flex flex-wrap flex-fill flex-column flex-sm-row">
<strong class="me-3">
Lightning Address
<a href="https://lightningaddress.com/" target="_blank" rel="noreferrer noopener">
<span class="fa fa-question-circle-o" title="More information..."></span>
</a>
</strong>
</span>
<span class="d-flex align-items-center fw-semibold">
@if (possible)
{
<a id="lightning-address-setup-link" class="btn btn-primary btn-sm ms-4 px-3 py-1 fw-semibold" asp-controller="UILNURL" asp-action="EditLightningAddress" asp-route-storeId="@Context.GetRouteValue("storeId")">
Setup
</a>
}
else
{
if (!isLightningEnabled)
{
<a asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-cryptoCode="@cryptoCode" asp-route-storeId="@store.Id" class="btn btn-link p-0">
You need to setup Lightning first
</a>
}
else
{
<span class="d-flex align-items-center text-danger">
<span class="me-2 btcpay-status btcpay-status--disabled"></span>
<a asp-action="LightningSettings" asp-route-cryptoCode="BTC" asp-route-storeId="@store.Id" asp-fragment="ln-url">
You need LNURL configured first
</a>
</span>
}
}
</span>
</div>
</li>