Skip to content

Commit 6004593

Browse files
committed
Added share on bluesky
1 parent 2c602bb commit 6004593

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/LinkDotNet.Blog.Web/Features/ShowBlogPost/Components/ShareBlogPost.razor

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@
1919
<i class="twitter me-3"></i>Share on X
2020
</a>
2121
</li>
22+
<li>
23+
<a id="share-bluesky" class="dropdown-item" href="@BlueskyShare" target="_blank" rel="noreferrer">
24+
<i class="bluesky me-3"></i>Share on Bluesky
25+
</a>
26+
</li>
2227
</ul>
2328
</div>
2429
@code {
2530
private string LinkedInShare => $"https://www.linkedin.com/shareArticle?mini=true&url={NavigationManager.Uri}";
2631
private string XShare => $"https://twitter.com/intent/tweet?url={NavigationManager.Uri}";
32+
private string BlueskyShare => $"https://bsky.app/intent/compose?text={NavigationManager.Uri}";
2733
}

tests/LinkDotNet.Blog.UnitTests/Web/Features/ShowBlogPost/Components/ShareBlogPostTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,15 @@ public void ShouldShareToX()
4343
var linkedInShare = (IHtmlAnchorElement)cut.Find("#share-x");
4444
linkedInShare.Href.ShouldBe("https://twitter.com/intent/tweet?url=http://localhost/blogPost/1");
4545
}
46+
47+
[Fact]
48+
public void ShouldShareToBluesky()
49+
{
50+
Services.GetRequiredService<BunitNavigationManager>().NavigateTo("blogPost/1");
51+
52+
var cut = Render<ShareBlogPost>();
53+
54+
var blueskyShare = (IHtmlAnchorElement)cut.Find("#share-bluesky");
55+
blueskyShare.Href.ShouldBe("https://bsky.app/intent/compose?text=http://localhost/blogPost/1");
56+
}
4657
}

0 commit comments

Comments
 (0)