From 30d9cafdc88a789c616dcb0c8a9290d1a70d3967 Mon Sep 17 00:00:00 2001 From: Michiel Post Date: Thu, 16 May 2024 14:35:45 +0200 Subject: [PATCH 1/2] Added wallet avatar --- src/aoWebWallet/Pages/AddressBook.razor | 8 +- src/aoWebWallet/Pages/WalletDetail.razor | 2 +- src/aoWebWallet/Pages/Wallets.razor | 3 +- .../Shared/Components/WalletAvatar.razor | 9 + src/aoWebWallet/Shared/NavMenu.razor | 12 +- .../ViewModels/WalletDetailViewModel.cs | 8 - src/aoWebWallet/wwwroot/images/account--1.svg | 65 ------- src/aoWebWallet/wwwroot/images/account--2.svg | 21 -- src/aoWebWallet/wwwroot/images/account--3.svg | 184 ------------------ src/aoWebWallet/wwwroot/images/account--4.svg | 95 --------- src/aoWebWallet/wwwroot/images/account--5.svg | 19 -- src/aoWebWallet/wwwroot/index.html | 3 + 12 files changed, 19 insertions(+), 410 deletions(-) create mode 100644 src/aoWebWallet/Shared/Components/WalletAvatar.razor delete mode 100644 src/aoWebWallet/wwwroot/images/account--1.svg delete mode 100644 src/aoWebWallet/wwwroot/images/account--2.svg delete mode 100644 src/aoWebWallet/wwwroot/images/account--3.svg delete mode 100644 src/aoWebWallet/wwwroot/images/account--4.svg delete mode 100644 src/aoWebWallet/wwwroot/images/account--5.svg diff --git a/src/aoWebWallet/Pages/AddressBook.razor b/src/aoWebWallet/Pages/AddressBook.razor index 78f3f88..9af82b2 100644 --- a/src/aoWebWallet/Pages/AddressBook.razor +++ b/src/aoWebWallet/Pages/AddressBook.razor @@ -27,14 +27,12 @@ { if(BindingContext.WalletList.Data.Where(x => x.IsReadOnly).Any()) { - int logoCount = 1; foreach (var wallet in BindingContext.WalletList.Data.Where(x => x.IsReadOnly)) { - string logoUrl = $"images/account--{logoCount}.svg"; string detailUrl = $"wallet/{wallet.Address}"; - +
@@ -57,10 +55,6 @@ - - logoCount++; - if (logoCount > 5) - logoCount = 1; } } else diff --git a/src/aoWebWallet/Pages/WalletDetail.razor b/src/aoWebWallet/Pages/WalletDetail.razor index 714219a..d8fee90 100644 --- a/src/aoWebWallet/Pages/WalletDetail.razor +++ b/src/aoWebWallet/Pages/WalletDetail.razor @@ -15,7 +15,7 @@ - + @Address diff --git a/src/aoWebWallet/Pages/Wallets.razor b/src/aoWebWallet/Pages/Wallets.razor index 7f8f2d1..1671349 100644 --- a/src/aoWebWallet/Pages/Wallets.razor +++ b/src/aoWebWallet/Pages/Wallets.razor @@ -40,11 +40,10 @@ int logoCount = 1; foreach (var wallet in BindingContext.WalletList.Data.Where(x => !x.IsReadOnly)) { - string logoUrl = $"images/account--{logoCount}.svg"; string detailUrl = $"wallet/{wallet.Address}"; - +
diff --git a/src/aoWebWallet/Shared/Components/WalletAvatar.razor b/src/aoWebWallet/Shared/Components/WalletAvatar.razor new file mode 100644 index 0000000..8b77caa --- /dev/null +++ b/src/aoWebWallet/Shared/Components/WalletAvatar.razor @@ -0,0 +1,9 @@ +
+ +
+ +@code { + + [Parameter] + public string? Address { get; set; } +} diff --git a/src/aoWebWallet/Shared/NavMenu.razor b/src/aoWebWallet/Shared/NavMenu.razor index 2e95140..c3d328d 100644 --- a/src/aoWebWallet/Shared/NavMenu.razor +++ b/src/aoWebWallet/Shared/NavMenu.razor @@ -6,20 +6,16 @@ { Home - @{ - int logoCount = 1; - } @foreach (var wallet in BindingContext.WalletList.Data?.Where(x => !x.IsReadOnly).ToList() ?? new()) { - string logoUrl = $"images/account--{logoCount}.svg"; - string detailUrl = $"wallet/{wallet.Address}"; + string detailUrl = $"wallet/{wallet.Address}"; - +
+ +
@wallet.Address.ToShortAddress()
- - logoCount++; }
} diff --git a/src/aoWebWallet/ViewModels/WalletDetailViewModel.cs b/src/aoWebWallet/ViewModels/WalletDetailViewModel.cs index 64b386c..70969fb 100644 --- a/src/aoWebWallet/ViewModels/WalletDetailViewModel.cs +++ b/src/aoWebWallet/ViewModels/WalletDetailViewModel.cs @@ -50,9 +50,6 @@ public partial class WalletDetailViewModel : ObservableObject [ObservableProperty] public bool? hasArConnectExtension; - public int? SelectedWalletIndex { get; set; } - - public WalletDetailsViewModel? SelectedWallet { get; set; } @@ -194,9 +191,6 @@ private async Task SelectWallet(string? address) if (current != null) { SelectedWallet = new WalletDetailsViewModel(current); - var indexOf = all.IndexOf(current); - SelectedWalletIndex = (indexOf % 5) + 1; - } else { @@ -209,7 +203,6 @@ private async Task SelectWallet(string? address) Source = WalletTypes.Explorer }; SelectedWallet = new WalletDetailsViewModel(tempWallet); - SelectedWalletIndex = 5; } this.LoadBalanceDataList(address); @@ -224,7 +217,6 @@ private async Task SelectWallet(string? address) else { SelectedWallet = null; - SelectedWalletIndex = null; } } diff --git a/src/aoWebWallet/wwwroot/images/account--1.svg b/src/aoWebWallet/wwwroot/images/account--1.svg deleted file mode 100644 index 0f5eabf..0000000 --- a/src/aoWebWallet/wwwroot/images/account--1.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/aoWebWallet/wwwroot/images/account--2.svg b/src/aoWebWallet/wwwroot/images/account--2.svg deleted file mode 100644 index 3b973e4..0000000 --- a/src/aoWebWallet/wwwroot/images/account--2.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/aoWebWallet/wwwroot/images/account--3.svg b/src/aoWebWallet/wwwroot/images/account--3.svg deleted file mode 100644 index 03fd0b7..0000000 --- a/src/aoWebWallet/wwwroot/images/account--3.svg +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/aoWebWallet/wwwroot/images/account--4.svg b/src/aoWebWallet/wwwroot/images/account--4.svg deleted file mode 100644 index cc36913..0000000 --- a/src/aoWebWallet/wwwroot/images/account--4.svg +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/aoWebWallet/wwwroot/images/account--5.svg b/src/aoWebWallet/wwwroot/images/account--5.svg deleted file mode 100644 index ee02298..0000000 --- a/src/aoWebWallet/wwwroot/images/account--5.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/src/aoWebWallet/wwwroot/index.html b/src/aoWebWallet/wwwroot/index.html index b061bb3..5ccda02 100644 --- a/src/aoWebWallet/wwwroot/index.html +++ b/src/aoWebWallet/wwwroot/index.html @@ -55,6 +55,9 @@ + From 2e3b52620ddf38c5ada1bfc896216b172231dc58 Mon Sep 17 00:00:00 2001 From: Michiel Post Date: Sun, 19 May 2024 19:36:43 +0200 Subject: [PATCH 2/2] smaller avatar in navbar --- src/aoWebWallet/Shared/NavMenu.razor | 2 +- src/aoWebWallet/wwwroot/index.html | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/aoWebWallet/Shared/NavMenu.razor b/src/aoWebWallet/Shared/NavMenu.razor index c3d328d..46b2506 100644 --- a/src/aoWebWallet/Shared/NavMenu.razor +++ b/src/aoWebWallet/Shared/NavMenu.razor @@ -11,7 +11,7 @@ string detailUrl = $"wallet/{wallet.Address}"; -
+
@wallet.Address.ToShortAddress()
diff --git a/src/aoWebWallet/wwwroot/index.html b/src/aoWebWallet/wwwroot/index.html index 5ccda02..50d589d 100644 --- a/src/aoWebWallet/wwwroot/index.html +++ b/src/aoWebWallet/wwwroot/index.html @@ -55,9 +55,7 @@ - + @@ -65,7 +63,7 @@
- AoWW + AoWW

loading...