Skip to content

Commit

Permalink
Merge branch 'master' into feature/jwk-wallets
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/aoWebWallet/Pages/WalletDetail.razor
#	src/aoWebWallet/Pages/Wallets.razor
  • Loading branch information
michielpost committed Mar 27, 2024
2 parents 4c471cb + a1842eb commit 3bbc5f8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
24 changes: 17 additions & 7 deletions src/aoWebWallet/Pages/WalletDetail.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
</MudStack>
<MudIconButton Class="copy-clipboard" Icon="@Icons.Material.Filled.ContentCopy" Color="Color.Default" OnClick="async () => { await BindingContext.CopyToClipboard(BindingContext.SelectedWallet?.Address); }" />
<MudSpacer />
<MudTooltip Text="Refresh balances" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.Refresh" aria-label="refresh transactions" OnClick="RefreshTransactions"></MudIconButton>
</MudTooltip>
@if(BindingContext.SelectedWallet?.Source == WalletTypes.Explorer)
{
<MudIconButton Icon="@Icons.Material.Outlined.Grade" aria-label="add to wallets" OnClick="AddWalletAsReadonly"></MudIconButton>
Expand Down Expand Up @@ -70,8 +73,12 @@
}

<MudContainer style="max-width: 100%;" Width="100%" Class="d-flex justify-end mb-4 pr-2">
<MudIconButton Icon="@Icons.Material.Filled.Refresh" aria-label="refresh transactions" OnClick="RefreshBalances"></MudIconButton>
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add token" Size="Size.Large" OnClick="OpenAddTokenDialog"></MudIconButton>
<MudTooltip Text="Refresh balances" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.Refresh" aria-label="refresh transactions" OnClick="RefreshBalances"></MudIconButton>
</MudTooltip>
<MudTooltip Text="Add token" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add token" Size="Size.Large" OnClick="OpenAddTokenDialog"></MudIconButton>
</MudTooltip>
</MudContainer>

<DataLoaderProgress DataLoader="BindingContext.TokenList.DataLoader" Title="tokens" />
Expand Down Expand Up @@ -100,19 +107,22 @@
<DataLoaderProgress DataLoader="balance.DataLoader" Title="balance" />
@if (balance.Data?.BalanceData != null)
{
<MudContainer style="max-width: 100%;" Width="100%" Class="d-flex align-center">
<MudText Typo="Typo.h5">@BalanceHelper.FormatBalance(balance.Data.BalanceData.Balance, balance.Data.Token?.TokenData?.Denomination ?? 0)</MudText>
</MudContainer>
<MudText Typo="Typo.h5">@BalanceHelper.FormatBalance(balance.Data.BalanceData.Balance, balance.Data.Token?.TokenData?.Denomination ?? 0)</MudText>
}
</MudStack>
<MudSpacer />
<MudSpacer />
<MudStack Justify="Justify.Center" Spacing="0" Row="true">
<MudIconButton Icon="@Icons.Material.Filled.South" aria-label="Receive" OnClick="()=>{Receive(balance.Data);}"></MudIconButton>
<MudTooltip Text="Deposit tokens" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.South" aria-label="Receive" OnClick="()=>{Receive(balance.Data);}"></MudIconButton>
</MudTooltip>

@if ((BindingContext.SelectedWallet?.CanSend ?? false))
{
var hasBalance = balance.Data?.BalanceData?.Balance ?? 0;
<MudIconButton Icon="@Icons.Material.Filled.ArrowOutward" Disabled="hasBalance <= 0" aria-label="Send" OnClick="()=>{Send(balance.Data);}"></MudIconButton>
<MudTooltip Text="Withdraw tokens" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.ArrowOutward" Disabled="hasBalance <= 0" aria-label="Send" OnClick="()=>{Send(balance.Data);}"></MudIconButton>
</MudTooltip>
}
</MudStack>
</MudStack>
Expand Down
7 changes: 3 additions & 4 deletions src/aoWebWallet/Pages/Wallets.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
<MudContainer style="max-width: 100%;" Width="100%" Class="d-flex justify-end mb-4 pr-3">
@if (BindingContext.WalletList.Data != null && BindingContext.WalletList.Data.Any())
{
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add wallet" Size="Size.Large" OnClick="OpenDialog"></MudIconButton>
<MudTooltip Text="Add wallet" Arrow="true" Placement="Placement.Left">
<MudIconButton Icon="@Icons.Material.Filled.AddCircle" aria-label="add wallet" Size="Size.Large" OnClick="OpenDialog"></MudIconButton>
</MudTooltip>
}
</MudContainer>

Expand All @@ -49,7 +51,6 @@
</MudLink>
<MudIconButton Class="copy-clipboard" Icon="@Icons.Material.Filled.ContentCopy" Color="Color.Default" OnClick="async () => { await BindingContext.CopyToClipboard(wallet.Address); }" />
</div>

<div style="display:flex; flex-direction:row;">
@if (wallet.IsReadOnly)
{
Expand All @@ -68,13 +69,11 @@
</div>
</MudStack>
<MudSpacer />

@if(!string.IsNullOrEmpty(wallet.Jwk))
{
<MudIconButton Class="delete-address" Icon="@Icons.Material.Filled.Save" aria-label="backup" OnClick="() => { DownloadWallet(wallet); }"></MudIconButton>
}
<MudIconButton Class="delete-address" Icon="@Icons.Material.Filled.Delete" aria-label="delete" OnClick="() => { DeleteWallet(wallet); }"></MudIconButton>

</MudStack>
</MudPaper>

Expand Down

0 comments on commit 3bbc5f8

Please sign in to comment.