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,
|
|
|
|
EthereumNetwork.PolygonMainnet => PresetColor.Green,
|
|
|
|
EthereumNetwork.PolygonMumbai => PresetColor.Pink,
|
|
|
|
_ => PresetColor.Yellow,
|
|
|
|
};
|
|
|
|
|
2022-03-31 22:16:43 +02:00
|
|
|
}
|