Skip to content

Commit

Permalink
Added share on bluesky
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Nov 15, 2024
1 parent 2c602bb commit 6004593
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@
<i class="twitter me-3"></i>Share on X
</a>
</li>
<li>
<a id="share-bluesky" class="dropdown-item" href="@BlueskyShare" target="_blank" rel="noreferrer">
<i class="bluesky me-3"></i>Share on Bluesky
</a>
</li>
</ul>
</div>
@code {
private string LinkedInShare => $"https://www.linkedin.com/shareArticle?mini=true&url={NavigationManager.Uri}";
private string XShare => $"https://twitter.com/intent/tweet?url={NavigationManager.Uri}";
private string BlueskyShare => $"https://bsky.app/intent/compose?text={NavigationManager.Uri}";
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,15 @@ public void ShouldShareToX()
var linkedInShare = (IHtmlAnchorElement)cut.Find("#share-x");
linkedInShare.Href.ShouldBe("https://twitter.com/intent/tweet?url=http://localhost/blogPost/1");
}

[Fact]
public void ShouldShareToBluesky()
{
Services.GetRequiredService<BunitNavigationManager>().NavigateTo("blogPost/1");

var cut = Render<ShareBlogPost>();

var blueskyShare = (IHtmlAnchorElement)cut.Find("#share-bluesky");
blueskyShare.Href.ShouldBe("https://bsky.app/intent/compose?text=http://localhost/blogPost/1");
}
}

0 comments on commit 6004593

Please sign in to comment.