nft-faucet/NftFaucet/Shared/MainLayout.razor.cs

45 lines
1.5 KiB
C#
Raw Normal View History

2022-04-04 01:10:20 +02:00
using AntDesign;
2022-03-31 22:16:43 +02:00
using NftFaucet.Components;
2022-04-04 01:10:20 +02:00
using NftFaucet.Models.Enums;
2022-03-31 22:16:43 +02:00
namespace NftFaucet.Shared;
public class MainLayoutComponent : LayoutBasicComponent
{
private const int StepsCount = 4;
protected bool IsFirstStep => AppState.Navigation.CurrentStep == 1;
protected bool IsLastStep => AppState.Navigation.CurrentStep == StepsCount;
protected string BackButtonStyle => $"visibility: {(IsFirstStep || IsLastStep ? "hidden" : "visible")}";
protected string ForwardButtonStyle => $"visibility: {(IsLastStep ? "hidden" : "visible")}";
protected string ForwardButtonText => AppState.Navigation.CurrentStep switch
{
1 => "Review NFT",
2 => "Review mint",
3 => "Send me this NFT!",
_ => "Next"
};
protected string ForwardButtonIcon => AppState.Navigation.CurrentStep switch
{
3 => "send",
_ => "arrow-right",
};
2022-04-04 01:10:20 +02:00
protected PresetColor ChainColor => AppState?.Metamask?.Network switch
{
EthereumNetwork.EthereumMainnet => PresetColor.Cyan,
EthereumNetwork.Ropsten => PresetColor.Volcano,
EthereumNetwork.Rinkeby => PresetColor.Gold,
EthereumNetwork.Goerli => PresetColor.GeekBlue,
EthereumNetwork.Kovan => PresetColor.Purple,
2022-04-17 15:04:56 +02:00
EthereumNetwork.OptimismMainnet => PresetColor.Cyan,
EthereumNetwork.OptimismKovan => PresetColor.Red,
EthereumNetwork.PolygonMainnet => PresetColor.Cyan,
2022-04-04 01:10:20 +02:00
EthereumNetwork.PolygonMumbai => PresetColor.Pink,
_ => PresetColor.Yellow,
};
2022-03-31 22:16:43 +02:00
}