-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathSocialAccounts.razor
More file actions
26 lines (23 loc) · 1.17 KB
/
Copy pathSocialAccounts.razor
File metadata and controls
26 lines (23 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@using LinkDotNet.Blog.Domain
<div class="d-flex flex-row justify-content-center h3 gap-4 py-2">
@foreach (var account in AllSocialAccounts.Where(a => a.HasAccount))
{
<a id="@account.Id" class="nav-link" target="_blank" href="@account.Url" aria-label="@account.Name" rel="noreferrer">
<i class="@account.Icon"></i>
</a>
}
</div>
@code {
private List<SocialAccount> AllSocialAccounts =>
[
// Icons have to be defined in the icons.css or basic.css as a class
new("linkedin", Social.HasLinkedinAccount, Social.LinkedInAccountUrl, "LinkedIn", "linkedin"),
new("github", Social.HasGithubAccount, Social.GithubAccountUrl, "Github", "github"),
new("twitter", Social.HasTwitterAccount, Social.TwitterAccountUrl, "Twitter", "twitter"),
new("youtube", Social.HasYoutubeAccount, Social.YoutubeAccountUrl, "Youtube", "youtube"),
new("bluesky", Social.HasBlueSkyHandle, $"https://bsky.app/profile/{Social.BlueSkyHandle}", "Bluesky", "bluesky"),
];
[Parameter, EditorRequired]
public required Social Social { get; set; }
private sealed record SocialAccount(string Id, bool HasAccount, string? Url, string Name, string Icon);
}