Skip to content

Commit

Permalink
Add current version
Browse files Browse the repository at this point in the history
  • Loading branch information
dangershony committed Oct 19, 2023
1 parent 9c5f226 commit 98d31bb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Angor/Client/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using Angor.Client.Storage
@using System.Reflection
@inject IWalletStorage _walletStorage;
@inject NavMenuState NavMenuState;

Expand Down Expand Up @@ -52,20 +53,29 @@
</NavLink>
</div>

@* <div class="nav-item px-3">
@* <div class="nav-item px-3">
<NavLink class="nav-link" href="CheckTransactionCode">
<span class="oi oi-plus" aria-hidden="true"></span> CheckTransactionCode
</NavLink>
</div>*@
</nav>

<div class="nav-footer">
<div class="text-muted small">Version: @softwareVersion</div>
</div>

</div>



@code {
private bool collapseNavMenu = true;
private bool hasWallet;

private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;

private string softwareVersion = "0.0.0";

private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
Expand All @@ -76,6 +86,15 @@
hasWallet = _walletStorage.HasWallet();

NavMenuState.OnChange += NavMenuStateOnOnChange;

// Get the current assembly (the assembly of your Blazor app)
Assembly assembly = Assembly.GetEntryAssembly();

// Get the assembly's version information
Version version = assembly.GetName().Version;

// Convert the version to a string
softwareVersion = version.ToString();
}

private void NavMenuStateOnOnChange()
Expand Down
10 changes: 10 additions & 0 deletions src/Angor/Client/Shared/NavMenu.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@
overflow-y: auto;
}
}

.nav-footer {
/* Footer styles */
position: absolute;
bottom: 0;
left: 0;
right: 0;
color: #d7d7d7;
padding: 10px;
}

0 comments on commit 98d31bb

Please sign in to comment.