diff --git a/src/MASA.OfficialWebsite.WebApp/Components/Layout/DesktopAppBar.razor b/src/MASA.OfficialWebsite.WebApp/Components/Layout/DesktopAppBar.razor index 669493c..cfa9ecb 100644 --- a/src/MASA.OfficialWebsite.WebApp/Components/Layout/DesktopAppBar.razor +++ b/src/MASA.OfficialWebsite.WebApp/Components/Layout/DesktopAppBar.razor @@ -1,14 +1,16 @@  - + @(context switch { @@ -17,7 +19,7 @@ _ => context }) - + 关于我们 @@ -33,16 +35,15 @@ [SupplyParameterFromQuery(Name = "nav-menu")] private string? QueryValue { get; set; } - private static string[] navMenuQueryOptions = { "product", "study" }; + private static string[] navMenuInteractiveValues = { "product", "study" }; private bool IsProductNavMenu => QueryValue?.Equals("product", StringComparison.OrdinalIgnoreCase) is true; private Dictionary ProductNavMenuParameters => new() { { nameof(NavMenu.Items), IsProductNavMenu ? ProductNavItems : StudyNavItems }, - { nameof(NavMenu.Style), IsProductNavMenu ? "transform: translateX(-388px);" : "transform: translateX(-286px);" }, - { nameof(NavMenu.ActivatorSelectors), navMenuQueryOptions.Select(s => $"#{s}-nav-menu").ToArray() }, - { nameof(NavMenu.QueryName), "nav-menu" } }; + private int NavMenuLeft => IsProductNavMenu ? -388 : -286; + } diff --git a/src/MASA.OfficialWebsite.WebApp/Components/Layout/FollowUsBtn.razor b/src/MASA.OfficialWebsite.WebApp/Components/Layout/FollowUsBtn.razor new file mode 100644 index 0000000..bc4f9ad --- /dev/null +++ b/src/MASA.OfficialWebsite.WebApp/Components/Layout/FollowUsBtn.razor @@ -0,0 +1,16 @@ +@rendermode InteractiveServer +@inherits MInteractivePopup + +
+ +
+ +@code { + + [Parameter] [EditorRequired] public string Image { get; set; } = null!; + + [Parameter] public string? Style { get; set; } + + [Parameter] public string? Class { get; set; } + +} diff --git a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveKeyTrigger.razor b/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveKeyTrigger.razor deleted file mode 100644 index fd8b47c..0000000 --- a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveKeyTrigger.razor +++ /dev/null @@ -1,65 +0,0 @@ -@namespace Masa.Blazor -@using Microsoft.AspNetCore.Components.Rendering -@inject NavigationManager NavigationManager - -@if (WithWrapper) -{ -
- @RenderContent -
-} -else -{ - @RenderContent -} - -@code { - - private void RenderContent(RenderTreeBuilder __builder) - { - @foreach (var option in QueryOptions) - { - var value = option == QueryValue ? null : option; - - - @ChildContent?.Invoke(option) - - } - - @if (QueryValue != null) - { - - } - } - - [Parameter] public string? Class { get; set; } - - [Parameter] public string? Style { get; set; } - - [Parameter] [EditorRequired] public string QueryName { get; set; } = null!; - - [Parameter] [EditorRequired] public IEnumerable QueryOptions { get; set; } = null!; - - [Parameter] public string? QueryValue { get; set; } - - [Parameter] [EditorRequired] public Type InteractiveComponentType { get; set; } = null!; - - [Parameter] public IDictionary? InteractiveParameters { get; set; } - - [Parameter] public RenderFragment? ChildContent { get; set; } - - [Parameter] public bool WithWrapper { get; set; } - - protected override void OnInitialized() - { - base.OnInitialized(); - - QueryName.ThrowIfNull(nameof(MInteractiveKeyTrigger)); - QueryOptions.ThrowIfNull(nameof(MInteractiveKeyTrigger)); - InteractiveComponentType.ThrowIfNull(nameof(MInteractiveKeyTrigger)); - } - -} diff --git a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveTrigger.razor b/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveTrigger.razor deleted file mode 100644 index d634e56..0000000 --- a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MInteractiveTrigger.razor +++ /dev/null @@ -1,58 +0,0 @@ -@namespace Masa.Blazor -@using Microsoft.AspNetCore.Components.Rendering -@inject NavigationManager NavigationManager - -@if (WithWrapper) -{ -
- @RenderContent -
-} -else -{ - @RenderContent -} - -@code { - - private void RenderContent(RenderTreeBuilder __builder) - { - - @ChildContent - - - @if (QueryValue is true) - { - - } - } - - [Parameter] public string? Class { get; set; } - - [Parameter] public string? Style { get; set; } - - [Parameter] [EditorRequired] public string QueryName { get; set; } = null!; - - [Parameter] public bool? QueryValue { get; set; } - - [Parameter] [EditorRequired] public Type InteractiveComponentType { get; set; } = null!; - - [Parameter] public IDictionary? InteractiveParameters { get; set; } - - [Parameter] public RenderFragment? ChildContent { get; set; } - - [Parameter] public bool WithWrapper { get; set; } - - protected override void OnInitialized() - { - base.OnInitialized(); - - QueryName.ThrowIfNull(nameof(MInteractiveTrigger)); - InteractiveComponentType.ThrowIfNull(nameof(MInteractiveTrigger)); - } - -} diff --git a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MainLayout.razor b/src/MASA.OfficialWebsite.WebApp/Components/Layout/MainLayout.razor index 300579b..8c17629 100644 --- a/src/MASA.OfficialWebsite.WebApp/Components/Layout/MainLayout.razor +++ b/src/MASA.OfficialWebsite.WebApp/Components/Layout/MainLayout.razor @@ -11,9 +11,9 @@
- + - + @@ -128,8 +128,20 @@ 关注我们 - @* *@ - @* *@ + + + +