Skip to content

Commit

Permalink
Make nav menu order configurable (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypt0hunter authored Jul 10, 2020
1 parent 581caa5 commit f408324
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Blockcore/Interfaces/UI/INavigationItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public interface INavigationItem
public string Navigation { get; }
public string Icon { get; }
public bool IsVisible {get; }
public int NavOrder {get; }

}
}
1 change: 1 addition & 0 deletions src/Features/Blockcore.Features.ColdStaking/UI/NavItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public ColdStakingNavigationItem(IWalletManager WalletManager)
public string Navigation => "ColdStaking";
public string Icon => "oi-pulse";
public bool IsVisible => this.WalletManager?.ContainsWallets ?? false;
public int NavOrder => 30;

}
}
1 change: 1 addition & 0 deletions src/Features/Blockcore.Features.Miner/UI/NavItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ public StakeNavigationItem(IWalletManager WalletManager)
public string Navigation => "Stake";
public string Icon => "oi-bolt";
public bool IsVisible => this.WalletManager?.ContainsWallets ?? false;
public int NavOrder => 20;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

@{
var items = fullnode.NodeService<IEnumerable<INavigationItem>>();
foreach (var item in items)
foreach (var item in items.OrderBy(i => i.NavOrder))
{
if (item.IsVisible) {
<li class="nav-item px-3">
Expand Down
2 changes: 1 addition & 1 deletion src/Features/Blockcore.Features.Wallet/UI/NavItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Blockcore.Features.Wallet.UI
public class WalletNavigationItem : INavigationItem
{
public string Name => "Wallets";

public string Navigation => "Wallets";
public string Icon => "oi-folder";
public bool IsVisible => true;
public int NavOrder => 10;
}
}

0 comments on commit f408324

Please sign in to comment.