diff --git a/SteUp.Maui/wwwroot/index.html b/SteUp.Maui/wwwroot/index.html index f60d2e2..af42dc4 100644 --- a/SteUp.Maui/wwwroot/index.html +++ b/SteUp.Maui/wwwroot/index.html @@ -18,6 +18,7 @@ + diff --git a/SteUp.Shared/Components/Layout/HeaderLayout.razor b/SteUp.Shared/Components/Layout/HeaderLayout.razor new file mode 100644 index 0000000..c8cc29f --- /dev/null +++ b/SteUp.Shared/Components/Layout/HeaderLayout.razor @@ -0,0 +1,79 @@ +@using SteUp.Shared.Core.Helpers +@inject IJSRuntime Js + +
+
+ @if (!SmallHeader) + { + if (Back) + { +
+ + @BackTo + +
+ } + +

@Title

+ +
+ @if (!LabelSave.IsNullOrEmpty()) + { + + @LabelSave + + } +
+ } + else + { +
+ + @Title + + +
+ } +
+
+ +@code{ + [Parameter] public string? Title { get; set; } + [Parameter] public bool Back { get; set; } + [Parameter] public bool BackOnTop { get; set; } + [Parameter] public string BackTo { get; set; } = ""; + + [Parameter] public EventCallback OnFilterToggle { get; set; } + + [Parameter] public bool Cancel { get; set; } + [Parameter] public EventCallback OnCancel { get; set; } + [Parameter] public string? LabelSave { get; set; } + [Parameter] public EventCallback OnSave { get; set; } + + [Parameter] public bool SmallHeader { get; set; } + + protected override void OnParametersSet() + { + Back = !Back ? !Back && Cancel : Back; + BackTo = Cancel ? "Annulla" : BackTo; + } + + private async Task GoBack() + { + if (Cancel) + { + await OnCancel.InvokeAsync(); + return; + } + + await Js.InvokeVoidAsync("goBack"); + } + +} \ No newline at end of file diff --git a/SteUp.Shared/Components/Layout/HeaderLayout.razor.css b/SteUp.Shared/Components/Layout/HeaderLayout.razor.css new file mode 100644 index 0000000..0cfbb55 --- /dev/null +++ b/SteUp.Shared/Components/Layout/HeaderLayout.razor.css @@ -0,0 +1,31 @@ +.header { + min-height: var(--mh-header); + width: 100%; + display: flex; + align-items: center; +} + +.header-content { + width: 100%; + line-height: normal; + display: flex; + justify-content: space-between; + align-items: center; + position: relative; +} + +.header-content > .title { width: 100%; } + +.header-content.with-back .page-title { + position: absolute; + left: 50%; + transform: translateX(-50%); + margin: 0; + font-size: larger; +} + +.left-section ::deep button, .right-section ::deep button { font-size: 1.1rem; } + +.left-section ::deep .mud-button-icon-start { margin-right: 3px !important; } + +.header-content.no-back .page-title { margin: 0; } \ No newline at end of file diff --git a/SteUp.Shared/Components/Layout/NavMenu.razor b/SteUp.Shared/Components/Layout/NavMenu.razor index 174c966..a71337d 100644 --- a/SteUp.Shared/Components/Layout/NavMenu.razor +++ b/SteUp.Shared/Components/Layout/NavMenu.razor @@ -1,28 +1,23 @@ +@using SteUp.Shared.Core.Interface.System.Network +@inject INetworkService NetworkService +