-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88c2a64
commit bdb0f81
Showing
3 changed files
with
83 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/aoWebWallet/Shared/Components/TransactionComponent.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
@using aoWebWallet.Models | ||
@inherits MvvmComponentBase<MainViewModel> | ||
|
||
@if (transfer != null) | ||
{ | ||
var tokenData = BindingContext.TokenList.Data?.Where(x => x.TokenId == transfer.TokenId).Select(x => x.TokenData).FirstOrDefault(); | ||
var isSend = SelectedAddress == transfer.From; | ||
var isReceive = SelectedAddress == transfer.To; | ||
string txUrl = $"transaction/{transfer.Id}"; | ||
<MudTimelineItem> | ||
<ItemDot> | ||
<MudAvatar Image="@UrlHelper.GetArweaveUrl(tokenData?.Logo)" Size="Size.Medium" title="@tokenData?.TokenId" /> | ||
</ItemDot> | ||
<ItemContent> | ||
@if (transfer.BlockHeight.HasValue) | ||
{ | ||
<MudText Typo="Typo.caption">@transfer.Timestamp.ToString("s")</MudText> | ||
} | ||
else | ||
{ | ||
<MudText Typo="Typo.caption">unconfirmed</MudText> | ||
} | ||
@*<MudText Typo="Typo.body1">@tokenData.Name</MudText>*@ | ||
<MudText style="font-weight:500;" Typo="Typo.body2">@tokenData?.Ticker</MudText> | ||
<MudStack Row=true> | ||
<MudText>txId: </MudText> | ||
<MudLink Class="KodeMono" style="text-overflow: ellipsis; white-space: nowrap;overflow: hidden;" Href="@txUrl" Typo="Typo.body1"> | ||
@transfer.Id | ||
</MudLink> | ||
</MudStack> | ||
|
||
@{ | ||
string detailUrlFrom = $"wallet/{transfer.From}"; | ||
string detailUrlTo = $"wallet/{transfer.To}"; | ||
} | ||
|
||
|
||
@if (isSend) | ||
{ | ||
<MudText Typo="Typo.h6" style="color:red">- @BalanceHelper.FormatBalance(transfer.Quantity, tokenData?.Denomination ?? 0)</MudText> | ||
<MudIcon Icon="@Icons.Material.Filled.ArrowOutward" aria-label="Receive"></MudIcon> | ||
<MudLink Class="KodeMono" style="text-overflow: ellipsis; white-space: nowrap;overflow: hidden;" Href="@detailUrlTo" Typo="Typo.h6"> | ||
@transfer.To | ||
</MudLink> | ||
} | ||
else if(isReceive) | ||
{ | ||
<MudText Typo="Typo.h6" style="color:green">+ @BalanceHelper.FormatBalance(transfer.Quantity, tokenData?.Denomination ?? 0)</MudText> | ||
<MudIcon Icon="@Icons.Material.Filled.South" aria-label="Receive"></MudIcon> | ||
<MudLink Class="KodeMono" style="text-overflow: ellipsis; white-space: nowrap;overflow: hidden;" Href="@detailUrlFrom" Typo="Typo.h6"> | ||
@transfer.From | ||
</MudLink> | ||
} | ||
else | ||
{ | ||
<MudLink Class="KodeMono" style="text-overflow: ellipsis; white-space: nowrap;overflow: hidden;" 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" style="text-overflow: ellipsis; white-space: nowrap;overflow: hidden;" Href="@detailUrlTo" Typo="Typo.h6"> | ||
@transfer.To | ||
</MudLink> | ||
|
||
<MudText Typo="Typo.h4">@BalanceHelper.FormatBalance(transfer.Quantity, tokenData?.Denomination ?? 0)</MudText> | ||
} | ||
</ItemContent> | ||
</MudTimelineItem> | ||
} | ||
|
||
|
||
@code { | ||
[Parameter] | ||
public TokenTransfer? transfer { get; set; } | ||
|
||
[Parameter] | ||
public string? SelectedAddress { get; set; } | ||
|
||
} |