Skip to content

Commit 57b4e4c

Browse files
committed
Added Footer
1 parent 2e9d31f commit 57b4e4c

File tree

4 files changed

+61
-6
lines changed

4 files changed

+61
-6
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@inject AppConfiguration appConfiguration
2+
3+
<div class="py-4">
4+
<footer class="text-center container">
5+
<span class="py-2 mb-0 text-muted"@DateTime.Now.Year @CopyrightName</span>
6+
</footer>
7+
</div>
8+
@code {
9+
private string CopyrightName => appConfiguration.IsAboutMeEnabled
10+
? appConfiguration.ProfileInformation.Name
11+
: string.Empty;
12+
}

src/LinkDotNet.Blog.Web/Shared/MainLayout.razor

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
<BlazoredToasts Position="ToastPosition.BottomRight" />
55
<div class="position-relative">
66
<NavMenu/>
7-
8-
<div class="page">
9-
@Body
10-
</div>
11-
</div>
7+
8+
<main>
9+
<div class="page">
10+
@Body
11+
</div>
12+
</main>
13+
</div>
14+
<Footer></Footer>

src/LinkDotNet.Blog.Web/wwwroot/css/basic.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
--big-stone: #193441;
1111

1212
--white: #ffffff;
13-
--wild-sand: #f4f4f4;
13+
--wild-sand: #f4f4f4;
1414

1515
/* Usages - this colors have to be defined in every theme */
1616
--active-link: var(--big-stone);
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using Bunit;
2+
using FluentAssertions;
3+
using LinkDotNet.Blog.Domain;
4+
using LinkDotNet.Blog.Web;
5+
using LinkDotNet.Blog.Web.Shared;
6+
using Microsoft.Extensions.DependencyInjection;
7+
using Xunit;
8+
9+
namespace LinkDotNet.Blog.UnitTests.Web.Shared;
10+
11+
public class FooterTests : TestContext
12+
{
13+
[Fact]
14+
public void ShouldSetCopyrightInformation()
15+
{
16+
var appConfig = new AppConfiguration
17+
{
18+
ProfileInformation = new ProfileInformation()
19+
{
20+
Name = "Steven",
21+
},
22+
};
23+
Services.AddScoped(_ => appConfig);
24+
25+
var cut = RenderComponent<Footer>();
26+
27+
cut.Find("span").TextContent.Should().Contain("Steven");
28+
}
29+
30+
[Fact]
31+
public void ShouldNotSetNameIfAboutMeIsNotEnabled()
32+
{
33+
var appConfig = new AppConfiguration();
34+
Services.AddScoped(_ => appConfig);
35+
36+
var cut = RenderComponent<Footer>();
37+
38+
cut.Find("span").TextContent.Should().Contain("©");
39+
}
40+
}

0 commit comments

Comments
 (0)