From 20c7b786e7649e65f6dc60c084ec70d87b54702e Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Fri, 19 Apr 2024 14:38:56 +0200 Subject: [PATCH] Invoices list --- BTCPayApp.UI/Components/InvoiceItem.razor | 48 +++++++++++++ BTCPayApp.UI/Components/InvoiceItem.razor.css | 10 +++ .../Components/Layout/NavbarBottom.razor | 6 ++ BTCPayApp.UI/Components/TruncateCenter.razor | 41 +++++++++++ .../Components/TruncateCenter.razor.css | 55 ++++++++++++++ BTCPayApp.UI/Layout/SimpleLayout.razor.css | 1 + BTCPayApp.UI/Models/Invoice.cs | 11 +++ BTCPayApp.UI/Models/Notification.cs | 10 +++ BTCPayApp.UI/Pages/DashboardPage.razor | 18 +++-- BTCPayApp.UI/Pages/InvoicePage.razor | 45 ++++++++++++ BTCPayApp.UI/Pages/InvoicesPage.razor | 71 +++++++++++++++++++ BTCPayApp.UI/Pages/NotificationsPage.razor | 13 +--- BTCPayApp.UI/Routes.cs | 4 ++ 13 files changed, 315 insertions(+), 18 deletions(-) create mode 100644 BTCPayApp.UI/Components/InvoiceItem.razor create mode 100644 BTCPayApp.UI/Components/InvoiceItem.razor.css create mode 100644 BTCPayApp.UI/Components/TruncateCenter.razor create mode 100644 BTCPayApp.UI/Components/TruncateCenter.razor.css create mode 100644 BTCPayApp.UI/Models/Invoice.cs create mode 100644 BTCPayApp.UI/Models/Notification.cs create mode 100644 BTCPayApp.UI/Pages/InvoicePage.razor create mode 100644 BTCPayApp.UI/Pages/InvoicesPage.razor diff --git a/BTCPayApp.UI/Components/InvoiceItem.razor b/BTCPayApp.UI/Components/InvoiceItem.razor new file mode 100644 index 0000000..630191d --- /dev/null +++ b/BTCPayApp.UI/Components/InvoiceItem.razor @@ -0,0 +1,48 @@ +@using BTCPayApp.UI.Models + + +
+ + + @Amount @Currency +
+ @State +
+
+ +
+ +@code { + [Parameter] + public string? Id { get; set; } + + [Parameter] + public string? OrderId { get; set; } + + [Parameter] + public string? Status { get; set; } + + [Parameter] + public DateTimeOffset Date { get; set; } + + [Parameter] + public string? Currency { get; set; } + + [Parameter] + public decimal Amount { get; set; } + + [Parameter] + public Invoice Invoice { + set + { + Id = value.Id; + OrderId = value.OrderId; + Status = value.Status; + Date = value.Date; + Currency = value.Currency; + Amount = value.Amount; + } + } + + private string State => Status?.ToLowerInvariant() ?? "unknown"; +} diff --git a/BTCPayApp.UI/Components/InvoiceItem.razor.css b/BTCPayApp.UI/Components/InvoiceItem.razor.css new file mode 100644 index 0000000..8eb418e --- /dev/null +++ b/BTCPayApp.UI/Components/InvoiceItem.razor.css @@ -0,0 +1,10 @@ +.invoice .badge-container { + flex: 0 0 5.125rem; + text-align: right; +} + +@media (max-width: 359px) { + .invoice .badge-container { + flex-grow: 1; + } +} diff --git a/BTCPayApp.UI/Components/Layout/NavbarBottom.razor b/BTCPayApp.UI/Components/Layout/NavbarBottom.razor index add3ad9..7f1e960 100644 --- a/BTCPayApp.UI/Components/Layout/NavbarBottom.razor +++ b/BTCPayApp.UI/Components/Layout/NavbarBottom.razor @@ -15,6 +15,12 @@ Wallet +