-
-
Notifications
You must be signed in to change notification settings - Fork 533
/
Sidebar.razor
52 lines (52 loc) · 2.2 KB
/
Sidebar.razor
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
43
44
45
46
47
48
49
50
51
52
@inherits BaseComponent
<nav class="@ClassNames" style="@StyleNames" @attributes="@Attributes">
@if ( Data != null )
{
<SidebarContent>
@if ( Data.Brand?.Text != null || Data.Brand?.To != null )
{
<SidebarBrand>
<a href="@(Data.Brand?.To ?? string.Empty)">@Data.Brand?.Text</a>
</SidebarBrand>
}
@if ( Data.Items != null )
{
<SidebarNavigation>
@foreach ( var item in Data.Items )
{
<SidebarItem @key="@item">
<SidebarLink To="@item.To" Title="@item.Tooltip" Visible="@item.Visible" Toggled="@(( isOpen ) => { item.Visible = isOpen; })">
@if ( item.Icon != null )
{
<Icon Name="item.Icon" />
}
@item.Text
</SidebarLink>
@if ( item.SubItems != null )
{
<SidebarSubItem @ref="item.SubItemReference" Visible="@item.Visible">
@foreach ( var subItem in item.SubItems )
{
<SidebarItem @key="@subItem">
<SidebarLink To="@subItem.To">
@if ( subItem.Icon != null )
{
<Icon Name="subItem.Icon" />
}
@subItem.Text
</SidebarLink>
</SidebarItem>
}
</SidebarSubItem>
}
</SidebarItem>
}
</SidebarNavigation>
}
</SidebarContent>
}
else
{
@ChildContent
}
</nav>