ant-design-blazor/site/AntDesign.Docs/Shared/HeaderMenu.razor
James Yeung 4d905cc4fa
docs: update docsearch 3 (#2446)
* docs: update docsearch 3

* fix hit conent style
2022-05-15 12:46:07 +08:00

60 lines
2.0 KiB
C#

<div id="search-box">
<div id="docsearch"></div>
</div>
<Menu Mode="@(IsMobile?MenuMode.Inline: MenuMode.Horizontal)" Id="nav" Class="menu-site">
@foreach (var item in _menuItems.OrderBy(x => x.Order))
{
<MenuItem Class="ant-menu-item-only-child" Key="@item.Url" RouterLink="@($"{CurrentLanguage}/{item.Url}")" RouterMatch="NavLinkMatch.Prefix">
<span>@item.Title</span>
</MenuItem>
}
@if (IsMobile)
{
<MenuItem><a href="https://github.com/ant-design-blazor/ant-design-blazor">Github</a></MenuItem>
@if (CurrentLanguage != "en-US")
{
<MenuItem Class="header-button header-lang-button" OnClick="@(_ => ChangeLanguage("en-US"))">English</MenuItem>
}
else
{
<MenuItem Class="header-button header-lang-button" OnClick="@(_ => ChangeLanguage("zh-CN"))"></MenuItem>
}
@if (Direction?.ToUpperInvariant() != "RTL")
{
<MenuItem Class="header-button" OnClick="@(()=>ConfigProvider?.ChangeDirection("rtl"))">RTL</MenuItem>
}
else
{
<MenuItem Class="header-button" OnClick="@(()=>ConfigProvider?.ChangeDirection("ltr"))">LTR</MenuItem>
}
}
</Menu>
@if (!IsMobile)
{
<Button Class="header-button" Size="small">{version}</Button>
@if (CurrentLanguage != "en-US")
{
<Button Class="header-button header-lang-button" Size="small" OnClick="@(_ => ChangeLanguage("en-US"))">English</Button>
}
else
{
<Button Class="header-button header-lang-button" Size="small" OnClick="@(_ => ChangeLanguage("zh-CN"))"></Button>
}
@if (Direction?.ToUpperInvariant() != "RTL")
{
<Button Class="header-button" Size="small" OnClick="@(()=>ConfigProvider?.ChangeDirection("rtl"))">RTL</Button>
}
else
{
<Button Class="header-button" Size="small" OnClick="@(()=>ConfigProvider?.ChangeDirection("ltr"))">LTR</Button>
}
<GithubButton />
}