diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..66623acc --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "excubo.webcompiler": { + "version": "3.8.15", + "commands": [ + "webcompiler" + ] + } + } +} \ No newline at end of file diff --git a/src/Money.Blazor.Host/Bootstrap/BootstrapTask.cs b/src/Money.Blazor.Host/Bootstrap/BootstrapTask.cs index fbd6f554..4f7f5d4f 100644 --- a/src/Money.Blazor.Host/Bootstrap/BootstrapTask.cs +++ b/src/Money.Blazor.Host/Bootstrap/BootstrapTask.cs @@ -86,7 +86,7 @@ public void Initialize() .AddTransient() .AddTransient() .AddSingleton() - .AddSingleton() + .AddTransient() .AddSingleton() .AddTransient() .AddTransient() diff --git a/src/Money.Blazor.Host/Layouts/BottomMenu.razor b/src/Money.Blazor.Host/Layouts/BottomMenu.razor index c4730782..1ad5d051 100644 --- a/src/Money.Blazor.Host/Layouts/BottomMenu.razor +++ b/src/Money.Blazor.Host/Layouts/BottomMenu.razor @@ -17,6 +17,15 @@ } + else if (item.Text == "Main menu") + { + + } else { + +
+ @if (MainMenu != null) + { +
+ @foreach (var item in MainMenu.Views) + @MainMenuItem(item) + @foreach (var item in MainMenu.More.Where(i => i.Text != "About")) + @MainMenuItem(item) +
+
+
+ @foreach (var item in MainMenu.User) + @MainMenuItem(item) +
+ } +
+ } + +@code +{ + RenderFragment MainMenuItem(MenuItemModel item) + { + var isLogout = item.Text == "Logout"; + return + @
+ @if (item.Url != null) + { + + + + + @item.Text + + + + } + else + { + + } +
+ ; + } +} \ No newline at end of file diff --git a/src/Money.Blazor.Host/Layouts/BottomMenu.razor.cs b/src/Money.Blazor.Host/Layouts/BottomMenu.razor.cs index 66ae9e87..ea9f09b8 100644 --- a/src/Money.Blazor.Host/Layouts/BottomMenu.razor.cs +++ b/src/Money.Blazor.Host/Layouts/BottomMenu.razor.cs @@ -32,6 +32,7 @@ public partial class BottomMenu : IDisposable, protected Interop Interop { get; set; } protected List Items { get; set; } + protected MainMenuItems MainMenu { get; set; } protected async override Task OnInitializedAsync() { @@ -39,6 +40,7 @@ protected async override Task OnInitializedAsync() await base.OnInitializedAsync(); await LoadAsync(); + MainMenu = await Queries.QueryAsync(new ListMainMenuItem()); } public void Dispose() diff --git a/src/Money.Blazor.Host/Layouts/Layout.razor b/src/Money.Blazor.Host/Layouts/Layout.razor index cbc45685..4884cec4 100644 --- a/src/Money.Blazor.Host/Layouts/Layout.razor +++ b/src/Money.Blazor.Host/Layouts/Layout.razor @@ -2,7 +2,7 @@ @inject Navigator Navigator
-