about summary refs log tree commit diff
path: root/BugMine.Web/Layout/NavMenu.razor
blob: 4174dfdf86e44db283c2c9951548a48d7befd77e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<div class="top-row ps-3 navbar navbar-dark">
    <div class="container-fluid">
        <a class="navbar-brand" href="">BugMine</a>
        <button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
            <span class="navbar-toggler-icon"></span>
        </button>
    </div>
</div>

<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
    <nav class="flex-column">
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
                <span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
            </NavLink>
        </div>
        <div class="nav-item px-3">
            <NavLink class="nav-link" href="Projects">
                <span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Projects
            </NavLink>
        </div>
        @if (Constants.Debug) {
            <div class="nav-item px-3">
                <NavLink class="nav-link" href="/DevTools">
                    <span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Devtools
                </NavLink>
            </div>
        }
    </nav>
</div>

@code {
    private bool collapseNavMenu = true;

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

    private void ToggleNavMenu()
    {
        collapseNavMenu = !collapseNavMenu;
    }

}