Adding ErrorLayout

arthur_errorview
Arthur VALIN 2 years ago
parent ab45651328
commit 7abf0c6240

@ -8,8 +8,12 @@
</Found> </Found>
<NotFound> <NotFound>
<CascadingAuthenticationState> <CascadingAuthenticationState>
<LayoutView Layout="@typeof(CraftLayout)"> <LayoutView Layout="@typeof(ErrorLayout)">
<p>Sorry, there's nothing at this address.</p> <div style="width: 100%;">
<br /><br />
<strong>Oups, la page que à laquelle vous essayez d'accéder n'existe pas !</strong>
<br /><br />
</div>
</LayoutView> </LayoutView>
</CascadingAuthenticationState> </CascadingAuthenticationState>
</NotFound> </NotFound>

@ -8,13 +8,9 @@
pointer-events: none; pointer-events: none;
} }
.spacer{
height: 300px;
}
.main_div { .main_div {
background: url("../Images/blur_background.jpg") center center/cover no-repeat fixed; background: url("../Images/blur_background.jpg") center center/cover no-repeat fixed;
color: white; color: white;
min-height: 100vh;
position: relative; position: relative;
} }

@ -0,0 +1,21 @@
@inherits LayoutComponentBase
<PageTitle>CraftSharp</PageTitle>
<div class="main_div">
<HeaderLayout />
<article class="content px-4">
@Body
</article>
<div class="bedrock_footer">
<img class="bedrock_footer_img" src="/Images/bedrock_footer.png" />
<div class="px-4 culture">
<CultureSelector />
</div>
</div>
</div>

@ -0,0 +1,20 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using System.Net.Http;
namespace CraftSharp.Shared
{
public partial class ErrorLayout
{
[Inject]
public ILogger<ErrorLayout> Logger { get; set; }
[Inject]
public NavigationManager NavigationManager { get; set; }
protected override async Task OnInitializedAsync()
{
Logger.Log(LogLevel.Error, $"Navigating to unknown page : {NavigationManager.Uri}");
}
}
}

@ -0,0 +1,20 @@
.bedrock_footer {
width: 100%;
position: relative;
}
.bedrock_footer_img {
width: 100%;
pointer-events: none;
}
.main_div {
background: url("../Images/error_background.jpg") center center/cover no-repeat fixed;
color: white;
position: relative;
}
.culture {
position: absolute;
bottom: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 KiB

Loading…
Cancel
Save