nft-faucet/NftFaucet/Pages/MintDialog.razor

97 lines
3.8 KiB
Plaintext
Raw Normal View History

2022-09-29 21:54:11 -05:00
@page "/mint/in-progress"
@inherits BasicComponent
<PageTitle>Minting...</PageTitle>
@if (!string.IsNullOrEmpty(ProgressBarText))
{
<RadzenText TextStyle="TextStyle.Subtitle2" TagName="TagName.H3">@ProgressBarText</RadzenText>
<RadzenProgressBar Value="100" ShowValue="false" Mode="ProgressBarMode.Indeterminate" />
}
else if (State == MintingState.CheckingNetwork)
{
<RadzenContent Container="main">
<h4>Network mismatch!</h4>
<p>
<text style="font-weight: bold;">Selected network: </text>
<text style="color: green;">@(AppState?.SelectedNetwork?.Name ?? "<unknown>")</text>
</p>
<p>
<text style="font-weight: bold;">Provider network: </text>
<text style="color: red;">@(ProviderNetwork?.Name ?? "<unknown>")</text>
</p>
<div style="display: flex; justify-content: end;">
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
</div>
</RadzenContent>
} else if (State == MintingState.CheckingAddress)
{
<RadzenContent Container="main">
<h3>Address is not available!</h3>
<p>
<text style="font-weight: bold;">Provider address: </text>
<text style="color: red;">&lt;null&gt;</text>
2022-09-29 21:54:11 -05:00
</p>
<div style="display: flex; justify-content: end;">
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
</div>
</RadzenContent>
} else if (State == MintingState.CheckingBalance)
{
<RadzenContent Container="main">
<h3>Not enough balance!</h3>
<p>
<text style="font-weight: bold;">Balance</text>
<text> (@SourceAddress)</text>
<text style="font-weight: bold;">: </text>
<text style="color: red;">
@if (Balance != null)
{
@(Balance.Amount + " " + Balance.Currency)
}
else if (!string.IsNullOrEmpty(GetBalanceError))
{
@GetBalanceError
}
else
{
@:&lt;unknown&gt;
}
</text>
2022-09-29 21:54:11 -05:00
</p>
<div style="display: flex; justify-content: end;">
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
</div>
</RadzenContent>
} else if (State == MintingState.SendingTransaction)
{
<RadzenContent Container="main">
<h3>Failed to send transaction!</h3>
<p>
<text>Error message:</text>
<br/>
<text style="font-weight: bold; color: red;">@SendTransactionError</text>
</p>
<div style="display: flex; justify-content: end;">
<RadzenButton Click="@(async (args) => await CheckNetwork())" Text="Try again" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
</div>
</RadzenContent>
} else if (State == MintingState.Done)
{
<RadzenContent Container="main">
<h3>Success</h3>
<p>
<text style="font-weight: bold;">Token minted!</text>
<br/>
2022-09-29 22:23:48 -05:00
<br/>
<br/>
2022-09-29 21:54:11 -05:00
<text style="font-weight: bold;">Transaction hash: </text>
2022-09-29 22:23:48 -05:00
<br/>
<RadzenLink Icon="open_in_new" Path="@(new Uri(AppState.SelectedNetwork.ExplorerUrl, "tx/" + TransactionHash).ToString())" Text="@TransactionHash" Target="_blank"/>
2022-09-29 21:54:11 -05:00
</p>
<div style="display: flex; justify-content: end;">
<RadzenButton Click="@(async (args) => await Close())" Text="Close" Disabled="@(!string.IsNullOrEmpty(ProgressBarText))" />
</div>
</RadzenContent>
}