From e9a0ffdb7a8cadb6b391a6fee748a56afdd3537f Mon Sep 17 00:00:00 2001 From: MarcoE Date: Tue, 16 Sep 2025 10:46:56 +0200 Subject: [PATCH] Fix ui --- .../Components/Layout/ConnectionState.razor | 26 ++++++++++++++++++ .../Components/Layout/MainLayout.razor | 27 +++---------------- .../SingleElements/Modal/ActivityForm.razor | 1 - salesbook.Shared/wwwroot/css/app.css | 4 +-- 4 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 salesbook.Shared/Components/Layout/ConnectionState.razor diff --git a/salesbook.Shared/Components/Layout/ConnectionState.razor b/salesbook.Shared/Components/Layout/ConnectionState.razor new file mode 100644 index 0000000..6ec018c --- /dev/null +++ b/salesbook.Shared/Components/Layout/ConnectionState.razor @@ -0,0 +1,26 @@ +
+ @if (IsNetworkAvailable) + { + if(ServicesIsDown) + { + + Servizi offline + } + else + { + + Online + } + } + else + { + + Nessuna connessione + } +
+ +@code{ + [Parameter] public bool IsNetworkAvailable { get; set; } + [Parameter] public bool ServicesIsDown { get; set; } + [Parameter] public bool ShowWarning { get; set; } +} \ No newline at end of file diff --git a/salesbook.Shared/Components/Layout/MainLayout.razor b/salesbook.Shared/Components/Layout/MainLayout.razor index 514030f..362c8be 100644 --- a/salesbook.Shared/Components/Layout/MainLayout.razor +++ b/salesbook.Shared/Components/Layout/MainLayout.razor @@ -1,5 +1,4 @@ @using System.Globalization -@using salesbook.Shared.Core.Interface @using salesbook.Shared.Core.Interface.IntegryApi @using salesbook.Shared.Core.Interface.System.Network @using salesbook.Shared.Core.Messages.Back @@ -14,29 +13,10 @@ + +
- -
- @if (IsNetworkAvailable) - { - if(ServicesIsDown) - { - - Servizi offline - } - else - { - - Online - } - } - else - { - - Nessuna connessione - } -
@@ -51,13 +31,12 @@ private string _mainContentClass = ""; //Connection state - private bool FirstCheck { get; set; } = true; private bool _isNetworkAvailable; private bool _servicesIsDown; private bool _showWarning; private DateTime _lastApiCheck = DateTime.MinValue; - private const int DelaySeconds = 180; + private const int DelaySeconds = 90; private CancellationTokenSource? _cts; diff --git a/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor b/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor index 4689b9a..c52854c 100644 --- a/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor +++ b/salesbook.Shared/Components/SingleElements/Modal/ActivityForm.razor @@ -1,5 +1,4 @@ @using System.Globalization -@using System.Text.RegularExpressions @using CommunityToolkit.Mvvm.Messaging @using salesbook.Shared.Components.Layout @using salesbook.Shared.Components.Layout.Overlay diff --git a/salesbook.Shared/wwwroot/css/app.css b/salesbook.Shared/wwwroot/css/app.css index f45ed64..48c33c0 100644 --- a/salesbook.Shared/wwwroot/css/app.css +++ b/salesbook.Shared/wwwroot/css/app.css @@ -1,6 +1,6 @@ html { overflow: hidden; } -.page, article, main { height: 100% !important; } +.page, article, main { height: 100% !important; overflow: hidden; } #app { height: 100vh; } @@ -58,7 +58,7 @@ article { transform: translateY(0); } -.page > .Connection.Hide ~ main { +.Connection.Hide ~ .page { transition: all 0.5s ease; transform: translateY(-35px); }