Add support for bluesky urls with one test case

This commit is contained in:
Salma Alam-Naylor 2024-11-15 12:23:39 +00:00
parent d5e96dfec6
commit 03c74f4732
2 changed files with 16 additions and 5 deletions

View file

@ -96,16 +96,26 @@ export default function Person({ person }) {
{/* If they have a mastodon, and no twitter, show that */} {/* If they have a mastodon, and no twitter, show that */}
{person.mastodon && !person.twitter && ( {person.mastodon && !person.twitter && (
<div className="SocialHandle"> <div className="SocialHandle">
<a <a href={`https://${mastodonServer}/@${mastodonHandle}`}
href={`https://${mastodonServer}/@${mastodonHandle}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer">
>
<span className="at">@</span> <span className="at">@</span>
{mastodonHandle} {mastodonHandle}
</a> </a>
</div> </div>
)} )}
{/* If they have a bluesky, and no mastodon and no twitter, show that */}
{person.bluesky && !person.mastodon && !person.twitter && (
<div className="SocialHandle">
<a href={`https://bsky.app/profile/${person.bluesky}`}
target="_blank"
rel="noopener noreferrer">
<span className="at">@</span>
{person.bluesky}
</a>
</div>
)}
</div> </div>
</div> </div>
); );

View file

@ -8,6 +8,7 @@
* @property {string} country - flag emoji for contributor's country * @property {string} country - flag emoji for contributor's country
* @property {string} [twitter] - optional Twitter username (beginning with `@`) * @property {string} [twitter] - optional Twitter username (beginning with `@`)
* @property {string} [mastodon] - optional Mastodon username & server (beginning with `@`, ex: `@hello@mastodon.social`) * @property {string} [mastodon] - optional Mastodon username & server (beginning with `@`, ex: `@hello@mastodon.social`)
* @property {string} [bluesky] - optional Bluesky (bsky.app) handle (do not use `@`)
* @property {string} [emoji] - some emoji corresponding to the contributor * @property {string} [emoji] - some emoji corresponding to the contributor
* @property {'apple' | 'windows' | 'linux' | 'bsd'} [computer] * @property {'apple' | 'windows' | 'linux' | 'bsd'} [computer]
* @property {'iphone' | 'android' | 'windowsphone' | 'flipphone'} [phone] * @property {'iphone' | 'android' | 'windowsphone' | 'flipphone'} [phone]
@ -3844,7 +3845,7 @@ module.exports = [
name: 'Salma Alam-Naylor', name: 'Salma Alam-Naylor',
description: 'I write code for your entertainment.', description: 'I write code for your entertainment.',
url: 'https://whitep4nth3r.com/uses', url: 'https://whitep4nth3r.com/uses',
twitter: '@whitep4nth3r', bluesky: 'whitep4nth3r.com',
emoji: '⚡️', emoji: '⚡️',
country: '🇬🇧', country: '🇬🇧',
computer: 'apple', computer: 'apple',