Skip to content

Commit

Permalink
Merge branch 'feature/milestone-01' of github.com:michielpost/aoWebWa…
Browse files Browse the repository at this point in the history
…llet into feature/milestone-01
  • Loading branch information
michielpost committed May 11, 2024
2 parents bf00ab1 + 98d0612 commit d71a0a1
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 33 deletions.
14 changes: 7 additions & 7 deletions src/aoWebWallet/Pages/ActionPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
}
else
{
<MudSelect @bind-Value="@selectedWallet" Label="Select a wallet" Variant="Variant.Outlined" MaxHeight="250" ReadOnly="@readOnly">
<MudSelect @bind-Value="@selectedWallet" Label="Select a wallet" Class="mb-4 wallet-item-background" Variant="Variant.Outlined" ReadOnly="@readOnly">
@foreach (var wallet in sendWallets ?? new())
{
<MudSelectItem Value="@wallet.Address">
<MudSelectItem Value="@wallet.Address" Class="wallet-item-background">
<MudStack Row="true">
@* <MudAvatar Image="@logoUrl" Size="Size.Large" Class="rounded-full" /> *@
<MudStack style="overflow: hidden;" Justify="Justify.Center" Spacing="0">
Expand All @@ -36,7 +36,7 @@
@wallet.Address
</MudText>
</div>
<div style="display:flex; flex-direction:row;">
<div style="display:flex; flex-direction:row;padding-top:5px;">
<MudText Typo="Typo.body2">@wallet.Name</MudText>
</div>
</MudStack>
Expand All @@ -59,15 +59,15 @@

@if (!readOnly && !string.IsNullOrEmpty(selectedWallet))
{
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="Preview">Preview</MudButton>
<MudButton Color="Color.Primary" Variant="Variant.Filled" FullWidth="true" OnClick="Preview" Class="mt-8">Preview</MudButton>
<MudText Color="Color.Error">@validation</MudText>
}
else if (!started && !string.IsNullOrEmpty(selectedWallet) && string.IsNullOrEmpty(transactionService.LastTransaction.Data?.Id))
{
<SendTransactionProgress DataLoader="transactionService.DryRunResult.DataLoader" Title="Getting dry run result..." />
if (transactionService.DryRunResult.Data != null)
{
<MudCard Outlined="true">
<MudCard Outlined="true" Class="my-2">
<MudCardContent>
<MudText>Preview Result</MudText>
@foreach (var msg in transactionService.DryRunResult.Data.Messages)
Expand All @@ -85,8 +85,8 @@
</MudCard>
}

<MudButton Color="Color.Default" Variant="Variant.Filled" OnClick="Cancel">Cancel</MudButton>
<MudButton Color="Color.Primary" Variant="Variant.Filled" OnClick="Submit">Submit</MudButton>
<MudButton Class="px-12 mt-8 mr-2" Color="Color.Default" Variant="Variant.Filled" OnClick="Cancel">Cancel</MudButton>
<MudButton Class="px-12 mt-8" Color="Color.Primary" Variant="Variant.Filled" OnClick="Submit">Submit</MudButton>
}

@if (transactionService.LastTransaction.DataLoader != null)
Expand Down
4 changes: 2 additions & 2 deletions src/aoWebWallet/Shared/ActionEditor.razor
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@using aoWebWallet.Models

<MudItem>
<MudChip>Target</MudChip> <MudChip Color="Color.Primary">@AoAction.Target?.Value</MudChip>
<MudChip>Target</MudChip> <MudChip Style="border-radius:0; margin-top:0;" Variant="Variant.Text" Color="Color.Primary">@AoAction.Target?.Value</MudChip>
</MudItem>

<MudStack>
@foreach (var ActionParam in AoAction.Filled)
{
<MudItem>
<MudChip>@ActionParam.Key</MudChip> <MudChip Color="Color.Primary">@ActionParam.Value</MudChip>
<MudChip>@ActionParam.Key</MudChip> <MudChip Style="border-radius:0; margin-top:0;" Variant="Variant.Text" Color="Color.Primary">@ActionParam.Value</MudChip>
</MudItem>
}

Expand Down
33 changes: 17 additions & 16 deletions src/aoWebWallet/Shared/Components/ActionInputComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<MudItem>
@if(ReadOnly)
{
<MudChip>@ActionParam.Key</MudChip> <MudChip Color="Color.Primary">@ActionParam.Value</MudChip>
<MudChip>@ActionParam.Key</MudChip> <MudChip Style="border-radius:0; margin-top:0;" Variant="Variant.Text" Color="Color.Primary">@ActionParam.Value</MudChip>
}
else
{
Expand All @@ -17,25 +17,26 @@ else
{
<MudAutocomplete T="Wallet" @ref="mudProcessField" Label="@ActionParam.Key"
Validation="@(new Func<Wallet, IEnumerable<string>>(ValidateProcess))"
SearchFunc="@WalletSearch"
SearchFunc="@WalletSearch"
ValueChanged="UpdateWalletValue"
ToStringFunc="@(e=> e==null?null : e.ToAutocompleteDisplay())"
ResetValueOnEmptyText="true"
CoerceText="true" CoerceValue="true"
AdornmentIcon="@Icons.Material.Filled.Search"
AdornmentColor="Color.Primary">
<ItemTemplate Context="e">
<MudText>
@e.ToAutocompleteDisplay()
</MudText>
</ItemTemplate>
<ItemSelectedTemplate Context="e">
<MudText>
@e.ToAutocompleteDisplay()
</MudText>
</ItemSelectedTemplate>
</MudAutocomplete>
<MudChip Color="Color.Primary">@(ActionParam.Value ?? "Not selected")</MudChip>
AdornmentIcon="@Icons.Material.Filled.Search"
AdornmentColor="Color.Primary"
Class="my-4">
<ItemTemplate Context="e">
<MudText>
@e.ToAutocompleteDisplay()
</MudText>
</ItemTemplate>
<ItemSelectedTemplate Context="e">
<MudText>
@e.ToAutocompleteDisplay()
</MudText>
</ItemSelectedTemplate>
</MudAutocomplete>
<MudChip Style="border-radius:0; margin-top:0;" Variant="Variant.Text" Color="Color.Primary">@(ActionParam.Value ?? "Not selected")</MudChip>

@* <MudTextField @ref="mudProcessField" T="string" MaxLength=43 Label="@ActionParam.Key" Validation="@(new Func<string, IEnumerable<string>>(ValidateProcess))" Variant="Variant.Text" ValueChanged="UpdateStringValue" /> *@
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@

<MudStack Row="true">
<MudTextField @ref="mudTextField" T="decimal" Label="@label" Variant="Variant.Text" ValueChanged="UpdateDecimalValue" Format="@DenominationFormat" Validation="@(new Func<decimal, IEnumerable<string>>(ValidateBalance))"></MudTextField>
<MudText>@Token?.TokenData?.Ticker</MudText>
@*<MudText>@Token?.TokenData?.Ticker</MudText>*@
</MudStack>

if (ActionParam.ParamType == ActionParamType.Balance)
{
<MudChip Color="Color.Info">Balance available: @BalanceHelper.FormatBalance(BalanceData?.Balance, Token?.TokenData?.Denomination ?? 1) @Token?.TokenData?.Ticker</MudChip>
<MudChip style="border-radius:0;" Variant="Variant.Text" Color="Color.Success">Balance available: @BalanceHelper.FormatBalance(BalanceData?.Balance, Token?.TokenData?.Denomination ?? 1) @Token?.TokenData?.Ticker</MudChip>
}
}
}
Expand Down Expand Up @@ -86,7 +86,7 @@
if (token.TokenData?.Denomination != null)
Token = token;

if (ActionParam.ParamType == ActionParamType.Balance
if (ActionParam.ParamType == ActionParamType.Balance
&& !string.IsNullOrEmpty(Address)
&& !ReadOnly)
{
Expand Down Expand Up @@ -140,7 +140,7 @@
if (!(mudTextField?.ValidationErrors.Any() ?? false))
{
long amountLong = BalanceHelper.DecimalToTokenAmount(e, Token.TokenData.Denomination.Value);

ActionParam.Value = amountLong.ToString();
}
else
Expand Down
4 changes: 1 addition & 3 deletions src/aoWebWallet/Shared/Components/TransactionComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
else if(isReceive)
{
<MudText Typo="Typo.h6" style="color:green">+ @BalanceHelper.FormatBalance(transfer.Quantity, tokenData?.Denomination ?? 0)</MudText>

@if(transfer.TokenTransferType == aoww.Services.Enums.TokenTransferType.Mint)
{
<MudText Typo="Typo.h6" style="color:green">MINT</MudText>
Expand All @@ -66,9 +66,7 @@
<MudLink Class="KodeMono tx-wrap" Href="@detailUrlFrom" Typo="Typo.h6">
@transfer.From
</MudLink>
<br />
<MudIcon style="width:15px;" Icon="@Icons.Material.Filled.South" aria-label="Receive"></MudIcon>
<br />

<MudLink Class="KodeMono tx-wrap" Href="@detailUrlTo" Typo="Typo.h6">
@transfer.To
Expand Down
14 changes: 13 additions & 1 deletion src/aoWebWallet/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ body {
}

.trigger-transparency.mud-paper {
background-color: rgba(222,222,222,0);
background-color: rgba(222,222,222,0) !important;
}

.trigger-transparency {
Expand Down Expand Up @@ -405,3 +405,15 @@ body {
.mud-paper, .mud-tabs-toolbar {
background-color: rgba(16,16,67,0.33) !important;
}

.wallet-item-background {
background-color: rgba(16,16,67,1) !important;
}

.mud-primary-hover.wallet-item-background {
background-color: rgba(16,16,67,1) !important;
}

.mud-list.mud-list-padding {
background-color: rgba(16,16,67,1) !important;
}

0 comments on commit d71a0a1

Please sign in to comment.