mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-22 19:48:25 +00:00
Remove Counter and FetchData pages
This commit is contained in:
parent
89c5536610
commit
223520b590
20
NftFaucetRadzen/Extensions/NavigationManagerExtensions.cs
Normal file
20
NftFaucetRadzen/Extensions/NavigationManagerExtensions.cs
Normal file
@ -0,0 +1,20 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace NftFaucetRadzen.Extensions;
|
||||
|
||||
public static class NavigationManagerExtensions
|
||||
{
|
||||
public static void NavigateToRelative(this NavigationManager uriHelper, string relativePath)
|
||||
{
|
||||
var newUri = uriHelper.BaseUri;
|
||||
if (!newUri.EndsWith("/"))
|
||||
newUri += "/";
|
||||
|
||||
if (relativePath.StartsWith("/"))
|
||||
relativePath = relativePath.Substring(1);
|
||||
|
||||
newUri += relativePath;
|
||||
|
||||
uriHelper.NavigateTo(newUri);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
@page "/counter"
|
||||
|
||||
<PageTitle>Counter</PageTitle>
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
||||
<p role="status">Current count: @currentCount</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
<RadzenButton Text="Hello"></RadzenButton>
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
}
|
||||
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
@page "/fetchdata"
|
||||
@inject HttpClient Http
|
||||
|
||||
<PageTitle>Weather forecast</PageTitle>
|
||||
|
||||
<h1>Weather forecast</h1>
|
||||
|
||||
<p>This component demonstrates fetching data from the server.</p>
|
||||
|
||||
@if (forecasts == null)
|
||||
{
|
||||
<p>
|
||||
<em>Loading...</em>
|
||||
</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Temp. (C)</th>
|
||||
<th>Temp. (F)</th>
|
||||
<th>Summary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var forecast in forecasts)
|
||||
{
|
||||
<tr>
|
||||
<td>@forecast.Date.ToShortDateString()</td>
|
||||
<td>@forecast.TemperatureC</td>
|
||||
<td>@forecast.TemperatureF</td>
|
||||
<td>@forecast.Summary</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@code {
|
||||
private WeatherForecast[]? forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
|
||||
}
|
||||
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public string? Summary { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int) (TemperatureC / 0.5556);
|
||||
}
|
||||
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
@page "/"
|
||||
@page "/"
|
||||
@layout EmptyLayout
|
||||
@inherits IndexComponent
|
||||
|
||||
<PageTitle>Index</PageTitle>
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
||||
<SurveyPrompt Title="How is Blazor working for you?"/>
|
||||
<div>
|
||||
<div class="loading">Loading...</div>
|
||||
<link rel="stylesheet" href="data:text/css,.loading%7Bfont-family%3A'Franklin%20Gothic%20Medium'%2C'Arial%20Narrow'%2CArial%2Csans-serif%3Bcolor%3A%231890FF%3Bfont-size%3A18px%3Btext-align%3Acenter%3Bwidth%3A150px%3Bheight%3A150px%3Bposition%3Afixed%3Btop%3A0%3Bbottom%3A0%3Bleft%3A0%3Bright%3A0%3Bmargin%3Aauto%7D.loading%3A%3Aafter%7Bcontent%3A''%3Bborder%3Asolid%2010px%3Bborder-color%3A%231890FF%20%23eee%20%23eee%3Bborder-radius%3A60px%3Bposition%3Aabsolute%3Bwidth%3A60px%3Bheight%3A60px%3Btop%3A0%3Bbottom%3A0%3Bleft%3A0%3Bright%3A0%3Bmargin%3Aauto%3Banimation%3Arotation%201.5s%20linear%200s%20infinite%7D%40keyframes%20rotation%7B0%25%7Btransform%3Arotate(45deg)%7D100%25%7Btransform%3Arotate(405deg)%7D%7D" />
|
||||
</div>
|
||||
|
24
NftFaucetRadzen/Pages/Index.razor.cs
Normal file
24
NftFaucetRadzen/Pages/Index.razor.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using NftFaucetRadzen.Components;
|
||||
using NftFaucetRadzen.Extensions;
|
||||
|
||||
namespace NftFaucetRadzen.Pages;
|
||||
|
||||
public class IndexComponent : BasicComponent
|
||||
{
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
// if (!await Metamask.IsReady())
|
||||
// {
|
||||
// UriHelper.NavigateToRelative("/connect-metamask");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (!AppState.IpfsContext.IsInitialized)
|
||||
// {
|
||||
// UriHelper.NavigateToRelative("/connect-ipfs");
|
||||
// return;
|
||||
// }
|
||||
|
||||
UriHelper.NavigateToRelative("/network");
|
||||
}
|
||||
}
|
3
NftFaucetRadzen/Shared/EmptyLayout.razor
Normal file
3
NftFaucetRadzen/Shared/EmptyLayout.razor
Normal file
@ -0,0 +1,3 @@
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
@Body
|
@ -12,23 +12,13 @@
|
||||
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="network">
|
||||
<NavLink class="nav-link" href="network" Match="NavLinkMatch.All">
|
||||
<span class="oi oi-wifi" aria-hidden="true"></span> @("Network" + (SelectedNetworkName != null ? $" ({SelectedNetworkName})" : string.Empty))
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||
<span class="oi oi-home" aria-hidden="true"></span> Home
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="counter">
|
||||
<span class="oi oi-plus" aria-hidden="true"></span> Counter
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="fetchdata">
|
||||
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
|
||||
<NavLink class="nav-link" href="provider" >
|
||||
<span class="oi oi-home" aria-hidden="true"></span> Provider
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
|
Loading…
x
Reference in New Issue
Block a user