Add home hero with intro and buttons from the body, next-event card and page tiles
This commit is contained in:
1 parent
b737f57ef7
commit
e51afeb34b
23 files changed
+1262
-65
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using System.Collections.Frozen;
|
||||
using Elternbeirat.Web.Shared;
|
||||
|
||||
namespace Elternbeirat.Web.Features.Home;
|
||||
|
||||
/// <summary>
|
||||
/// Chooses the icon of a home page tile from the page's slug.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Pure presentation, so it lives in code: the schema has no icon field, and adding
|
||||
/// one needs a schema change that cannot reach production yet. A page without an
|
||||
/// entry here (e.g. one an editor just created) gets <see cref="Default"/>, so a
|
||||
/// new page always shows up as a complete tile.
|
||||
/// </remarks>
|
||||
/// <seealso cref="IconSet"/>
|
||||
public static class TileIcons
|
||||
{
|
||||
/// <summary>
|
||||
/// The icon for a slug without its own entry: a generic page.
|
||||
/// </summary>
|
||||
public const string Default = "file-text";
|
||||
|
||||
/// <summary>
|
||||
/// Icon name per slug. Every value must be a name in <see cref="IconSet"/>.
|
||||
/// </summary>
|
||||
private static readonly FrozenDictionary<string, string> Icons =
|
||||
new Dictionary<string, string>
|
||||
{
|
||||
["board"] = "users",
|
||||
["patrons"] = "heart-handshake",
|
||||
["faqs"] = "help-circle",
|
||||
["downloads"] = "download",
|
||||
["posts"] = "newspaper",
|
||||
["events"] = "calendar",
|
||||
["contact"] = "mail",
|
||||
}.ToFrozenDictionary(StringComparer.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the icon name for a page.
|
||||
/// </summary>
|
||||
/// <param name="slug">The page's slug, e.g. <c>board</c>.</param>
|
||||
/// <returns>An icon name from <see cref="IconSet"/>; <see cref="Default"/> for an unknown slug.</returns>
|
||||
public static string For(string slug) =>
|
||||
Icons.GetValueOrDefault(slug, Default);
|
||||
}
|
||||
Reference in new issue
Block a user