@Body diff --git a/src/Client/Core/Shared/MainLayout.razor.cs b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.cs similarity index 52% rename from src/Client/Core/Shared/MainLayout.razor.cs rename to src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.cs index 3739112..4246e25 100644 --- a/src/Client/Core/Shared/MainLayout.razor.cs +++ b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.cs @@ -1,19 +1,19 @@ using Microsoft.AspNetCore.Components.Web; -namespace Bit.TemplatePlayground.Client.Core.Shared; +namespace Bit.TemplatePlayground.Client.Core.Components.Layout; public partial class MainLayout : IDisposable { - private bool _disposed; - private bool _isMenuOpen; - private bool _isUserAuthenticated; - private ErrorBoundary ErrorBoundaryRef = default!; + private bool disposed; + private bool isMenuOpen; + private bool isUserAuthenticated; + private ErrorBoundary errorBoundaryRef = default!; - [AutoInject] private IPrerenderStateService _prerenderStateService = default!; + [AutoInject] private IPrerenderStateService prerenderStateService = default!; - [AutoInject] private IExceptionHandler _exceptionHandler = default!; + [AutoInject] private IExceptionHandler exceptionHandler = default!; - [AutoInject] private AppAuthenticationStateProvider _authStateProvider = default!; + [AutoInject] private AuthenticationManager authManager = default!; [CascadingParameter] public Task AuthenticationStateTask { get; set; } = default!; @@ -30,15 +30,15 @@ protected override async Task OnInitializedAsync() { try { - _authStateProvider.AuthenticationStateChanged += VerifyUserIsAuthenticatedOrNot; + authManager.AuthenticationStateChanged += VerifyUserIsAuthenticatedOrNot; - _isUserAuthenticated = await _prerenderStateService.GetValue($"{nameof(MainLayout)}-isUserAuthenticated", async () => (await AuthenticationStateTask).User.IsAuthenticated()); + isUserAuthenticated = await prerenderStateService.GetValue($"{nameof(MainLayout)}-isUserAuthenticated", async () => (await AuthenticationStateTask).User.IsAuthenticated()); await base.OnInitializedAsync(); } catch (Exception exp) { - _exceptionHandler.Handle(exp); + exceptionHandler.Handle(exp); } } @@ -46,11 +46,11 @@ async void VerifyUserIsAuthenticatedOrNot(Task task) { try { - _isUserAuthenticated = (await task).User.IsAuthenticated(); + isUserAuthenticated = (await task).User.IsAuthenticated(); } catch (Exception ex) { - _exceptionHandler.Handle(ex); + exceptionHandler.Handle(ex); } finally { @@ -60,7 +60,7 @@ async void VerifyUserIsAuthenticatedOrNot(Task task) private void ToggleMenuHandler() { - _isMenuOpen = !_isMenuOpen; + isMenuOpen = !isMenuOpen; } public void Dispose() @@ -71,10 +71,10 @@ public void Dispose() protected virtual void Dispose(bool disposing) { - if (_disposed) return; + if (disposed) return; - _authStateProvider.AuthenticationStateChanged -= VerifyUserIsAuthenticatedOrNot; + authManager.AuthenticationStateChanged -= VerifyUserIsAuthenticatedOrNot; - _disposed = true; + disposed = true; } } diff --git a/src/Client/Core/Shared/MainLayout.razor.scss b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.scss similarity index 92% rename from src/Client/Core/Shared/MainLayout.razor.scss rename to src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.scss index beea1a5..71491c4 100644 --- a/src/Client/Core/Shared/MainLayout.razor.scss +++ b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MainLayout.razor.scss @@ -1,7 +1,7 @@ -@import '../Styles/abstracts/_vars.scss'; -@import '../Styles/abstracts/_functions.scss'; -@import '../Styles/abstracts/_media-queries.scss'; -@import '../Styles/abstracts/_bit-css-variables.scss'; +@import '../../Styles/abstracts/_vars.scss'; +@import '../../Styles/abstracts/_functions.scss'; +@import '../../Styles/abstracts/_media-queries.scss'; +@import '../../Styles/abstracts/_bit-css-variables.scss'; .main { width: 100%; @@ -32,6 +32,8 @@ .main-content { flex-grow: 1; display: flex; + padding: 1rem; + flex-flow: column; align-items: center; justify-content: center; } diff --git a/src/Client/Core/Shared/MessageBox.razor b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MessageBox.razor similarity index 77% rename from src/Client/Core/Shared/MessageBox.razor rename to src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MessageBox.razor index 00e5aa1..2630a8b 100644 --- a/src/Client/Core/Shared/MessageBox.razor +++ b/src/Client/Bit.TemplatePlayground.Client.Core/Components/Layout/MessageBox.razor @@ -1,13 +1,13 @@ @inherits AppComponentBase - +
- @_title + @title
- @_body + @body