Skip to content

Commit

Permalink
Frontend Cleanup (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaldoumas committed Dec 12, 2021
1 parent 922078e commit f131cfb
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 98 deletions.
4 changes: 2 additions & 2 deletions src/Coding.Blog/Client/Coding.Blog.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Net.Client.Web" Version="2.40.0" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.40.0" />
<PackageReference Include="Grpc.Net.Client.Web" Version="2.41.0" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.41.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="TaskTupleAwaiter" Version="2.0.0" />
Expand Down
9 changes: 0 additions & 9 deletions src/Coding.Blog/Client/Pages/About.razor

This file was deleted.

11 changes: 6 additions & 5 deletions src/Coding.Blog/Client/Pages/Blog.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<div class="container mb-3">
@if (!Posts.Any())
{
<p>
<strong>Loading...</strong>
</p>
<div class="d-flex align-items-center">
<strong class="ms-2">Loading...</strong>
<div class="spinner-border ms-auto me-2 mt-2" role="status" aria-hidden="true"></div>
</div>
}
else
{
<div class="row row-cols-sm-1 row-cols-md-2 row-cols-lg-3 g-3">
<div class="row g-3">
@foreach (var (slug, post) in Posts)
{
<div class="col">
<div class="col-12 col-lg-4">
<div class="card">
<a href="@($"post/{slug}")">
<img src=@post.Hero.ImgixUrl class="card-img-top" alt="hero"/>
Expand Down
11 changes: 9 additions & 2 deletions src/Coding.Blog/Client/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@page "/"

<h1>Hello!</h1>
<h1>Welcome!</h1>

<p>This site is currently under construction.</p>
<div>
<p>
I'm Will and I do tech and music stuff. This is a space for me to write about things I'm either reading or doing. Feel free to peruse!
</p>
<p>
Looking to connect? Find me on <a href="https://github.com/wbaldoumas" target="_blank">GitHub</a> or <a href="https://www.linkedin.com/in/williambaldoumas/" target="_blank">LinkedIn</a>. 😄
</p>
</div>
103 changes: 53 additions & 50 deletions src/Coding.Blog/Client/Pages/PostDetails.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,67 @@
@using Coding.Blog.Engine.Clients
@using Coding.Blog.Engine.Extensions

@if (_selectedPost is null)
{
<p>
<strong>Loading...</strong>
</p>
}
else
{
<div class="container">
<div class="row justify-content-center">
<div class="col col-auto">
<h1>@_selectedPost!.Title</h1>
</div>
<div class="container mb-3">
@if (_selectedPost is null)
{
<div class="d-flex align-items-center">
<strong class="ms-2">Loading...</strong>
<div class="spinner-border ms-auto me-2 mt-2" role="status" aria-hidden="true"></div>
</div>
<div class="row justify-content-center">
<div class="col col-auto">
<p class="text-muted">@_selectedPost!.DatePublished.ToShortDateString()</p>
}
else
{
<div class="container">
<div class="row justify-content-center">
<div class="col col-auto">
<h1>@_selectedPost!.Title</h1>
</div>
</div>
</div>
</div>
<div class="container overflow-hidden mb-3">
<div class="row justify-content-center">
<div class="col col-auto">
<img class="rounded mx-auto d-block img-fluid" src="@_selectedPost!.Hero.ImgixUrl" alt="hero">
<div class="row justify-content-center">
<div class="col col-auto">
<p class="text-muted">@_selectedPost!.DatePublished.ToShortDateString()</p>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div>@(new MarkupString(_selectedPost!.Content))</div>
<div class="container overflow-hidden">
<div class="row justify-content-center">
<div class="col col-auto">
<img class="rounded mx-auto d-block img-fluid" src="@_selectedPost!.Hero.ImgixUrl" alt="hero">
</div>
</div>
</div>
<div class="row justify-content-between">
<div class="col col-auto">
@if (_selectedPost.Next is not null)
{
<h6 class="text-muted">Next</h6>
<a href="@($"post/{_selectedPost.Next.Slug}")">
<h5>@_selectedPost.Next.Title</h5>
</a>
}
</div >
<div class="col col-auto">
@if (_selectedPost.Previous is not null)
{
<h6 class="text-muted">Previous</h6>
<a href="@($"post/{_selectedPost.Previous.Slug}")">
<h5>@_selectedPost.Previous.Title</h5>
</a>
}
<div class="row">
<div class="col">
<div>@(new MarkupString(_selectedPost!.Content))</div>
</div>
</div>
</div>
<div class="row justify-content-center">
<div class="col col-auto">
<button class="btn btn-secondary btn-lg" @onclick="NavigateToMain">Back</button>
<div class="row justify-content-between">
<div class="col col-auto">
@if (_selectedPost.Next is not null)
{
<h6 class="text-muted">Next</h6>
<a href="@($"post/{_selectedPost.Next.Slug}")">
<h5>@_selectedPost.Next.Title</h5>
</a>
}
</div >
<div class="col col-auto">
@if (_selectedPost.Previous is not null)
{
<h6 class="text-muted">Previous</h6>
<a href="@($"post/{_selectedPost.Previous.Slug}")">
<h5>@_selectedPost.Previous.Title</h5>
</a>
}
</div>
</div>
<div class="row justify-content-center">
<div class="col col-auto">
<button class="btn btn-secondary btn-lg" @onclick="NavigateToMain">Back</button>
</div>
</div>
</div>
</div>
}
}
</div>

@code {

Expand Down
9 changes: 0 additions & 9 deletions src/Coding.Blog/Client/Pages/Projects.razor

This file was deleted.

2 changes: 1 addition & 1 deletion src/Coding.Blog/Client/Pages/Reading.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</p>
</div>

<div class="container">
<div class="container mb-3">
@if (!Books.Any())
{
<p>
Expand Down
1 change: 0 additions & 1 deletion src/Coding.Blog/Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@
posts.ToDictionary(post => post.Slug, post => post)
);
}

}
10 changes: 0 additions & 10 deletions src/Coding.Blog/Client/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
<span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="about">
<span class="oi oi-person" aria-hidden="true"></span> About
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="blog">
<span class="oi oi-pencil" aria-hidden="true"></span> Blog
Expand All @@ -29,11 +24,6 @@
<span class="oi oi-book" aria-hidden="true"></span> Reading
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="projects">
<span class="oi oi-wrench" aria-hidden="true"></span> Projects
</NavLink>
</div>
</nav>
</div>

Expand Down
8 changes: 5 additions & 3 deletions src/Coding.Blog/Client/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
</head>

<body>
<div id="app" class="d-flex align-items-center">
<strong class="ms-2">Loading...</strong>
<div class="spinner-border ms-auto me-2 mt-2" role="status" aria-hidden="true"></div>
<div id="app">
<div class="d-flex align-items-center">
<strong class="ms-2">Loading...</strong>
<div class="spinner-border ms-auto me-2 mt-2" role="status" aria-hidden="true"></div>
</div>
</div>

<div id="blazor-error-ui">
Expand Down
2 changes: 1 addition & 1 deletion src/Coding.Blog/Engine/Coding.Blog.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="Flurl.Http" Version="3.2.0" />
<PackageReference Include="Google.Protobuf" Version="3.19.1" />
<PackageReference Include="Grpc.Net.Client" Version="2.40.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.41.0" />
<PackageReference Include="Grpc.Tools" Version="2.42.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 1 addition & 3 deletions src/Coding.Blog/Engine/Mappers/IPostLinker.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Collections.Generic;

namespace Coding.Blog.Engine.Mappers;
namespace Coding.Blog.Engine.Mappers;

/// <summary>
/// Sorts posts by creation date, then links posts to their "previous" and "next" posts.
Expand Down
4 changes: 2 additions & 2 deletions src/Coding.Blog/Server/Coding.Blog.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.AspNetCore" Version="2.40.0" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.40.0" />
<PackageReference Include="Grpc.AspNetCore" Version="2.41.0" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.41.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
</ItemGroup>
Expand Down

0 comments on commit f131cfb

Please sign in to comment.