diff --git a/src/CraftSharp/Pages/Shop.razor.css b/src/CraftSharp/Pages/Shop.razor.css index 25988d6..902378d 100644 --- a/src/CraftSharp/Pages/Shop.razor.css +++ b/src/CraftSharp/Pages/Shop.razor.css @@ -32,10 +32,11 @@ .shopPanel{ display:flex; + justify-content: center; } .offers { - width: 100%; + width: 50%; display: flex; flex-direction: column; justify-content: space-evenly; diff --git a/src/CraftSharp/Services/CustomStateProvider.cs b/src/CraftSharp/Services/CustomStateProvider.cs index bedf535..059cab0 100644 --- a/src/CraftSharp/Services/CustomStateProvider.cs +++ b/src/CraftSharp/Services/CustomStateProvider.cs @@ -14,8 +14,7 @@ namespace CraftSharp.Services { private readonly IAuthService _authService; - [CascadingParameter] - public CurrentUser UserObject { get; set; } + private CurrentUser _currentUser { get; set; } public CustomStateProvider(IAuthService authService) { @@ -30,7 +29,7 @@ namespace CraftSharp.Services var userInfo = GetCurrentUser(); if (userInfo.IsAuthenticated) { - var claims = new[] { new Claim(ClaimTypes.Name, UserObject.UserName) }.Concat(UserObject.Claims.Select(c => new Claim(c.Key, c.Value))); + var claims = new[] { new Claim(ClaimTypes.Name, _currentUser.UserName) }.Concat(_currentUser.Claims.Select(c => new Claim(c.Key, c.Value))); identity = new ClaimsIdentity(claims, "Server authentication"); } } @@ -48,15 +47,14 @@ namespace CraftSharp.Services // No error - Login the user CurrentUser user; user = _authService.GetUser(loginParameters.UserName); - UserObject = user; - Console.WriteLine("\t\tLOGIN: " + UserObject.UserName); + _currentUser = user; NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } public async Task Logout() { - UserObject = new CurrentUser(); + _currentUser = new CurrentUser(); NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } @@ -66,7 +64,7 @@ namespace CraftSharp.Services // No error - Login the user var user = _authService.GetUser(registerParameters.UserName); - UserObject = user; + _currentUser = user; NotifyAuthenticationStateChanged(GetAuthenticationStateAsync()); } @@ -74,10 +72,9 @@ namespace CraftSharp.Services { CurrentUser cacheUser; - if (UserObject != null && UserObject.IsAuthenticated) + if (_currentUser != null && _currentUser.IsAuthenticated) { - Console.WriteLine("Return user"); - return UserObject; + return _currentUser; } return new CurrentUser(); } diff --git a/src/CraftSharp/Shared/CultureSelector.razor.cs b/src/CraftSharp/Shared/CultureSelector.razor.cs index b343a6c..3437287 100644 --- a/src/CraftSharp/Shared/CultureSelector.razor.cs +++ b/src/CraftSharp/Shared/CultureSelector.razor.cs @@ -30,6 +30,7 @@ namespace CraftSharp.Shared // Redirect the user to the culture controller to set the cookie this.NavigationManager.NavigateTo("/Culture/SetCulture" + query, forceLoad: true); + } } } diff --git a/src/CraftSharp/Shared/HeaderLayout.razor.css b/src/CraftSharp/Shared/HeaderLayout.razor.css index 8b8413b..606c267 100644 --- a/src/CraftSharp/Shared/HeaderLayout.razor.css +++ b/src/CraftSharp/Shared/HeaderLayout.razor.css @@ -98,7 +98,7 @@ button:hover { .nav-item { font-size: 1.1rem; padding-bottom: 0.5rem; - font-family: SuperDario; + font-family: Minecraft; } .nav-item:first-of-type {