Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mastodon as option for member accounts #1040

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/components/MemberCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Polywork from '~/svg/Polywork';
import Medium from '~/svg/Medium';
import HashNode from '~/svg/HashNode';
import YouTube from '~/svg/YouTube';
import Mastodon from '~/svg/Mastodon';
import Website from '~/svg/Website';
import type { MemberList } from 'members/types';

Expand All @@ -27,6 +28,7 @@ export default function MemberCards({ data }: { data: MemberList }) {
Medium,
HashNode,
YouTube,
Mastodon,
Website,
};

Expand Down
25 changes: 25 additions & 0 deletions app/svg/Mastodon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { IconProps } from 'members/types';

export default function Mastodon({
ariaHidden,
title = 'Mastodon',
}: IconProps): JSX.Element {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
{...(ariaHidden
? {
'aria-hidden': 'true',
}
: {
role: 'img',
'aria-labelledby': 'mastodonSvgTitle',
})}
>
{!ariaHidden && <title id="mastodonSvgTitle">{title || 'Website'}</title>}
<path d="M22.793 7.895c0-4.911-3.22-6.349-3.22-6.349C17.948.8 15.161.488 12.264.463h-.07C9.298.488 6.513.8 4.89 1.546c0 0-3.221 1.438-3.221 6.349 0 1.127-.022 2.47.014 3.896.118 4.803.881 9.536 5.325 10.711 2.047.542 3.806.655 5.223.577 2.57-.14 4.01-.916 4.01-.916l-.086-1.861s-1.835.577-3.898.507c-2.041-.07-4.197-.221-4.527-2.728a4.972 4.972 0 0 1-.046-.701 26.35 26.35 0 0 0 4.546.606c1.554.07 3.01-.092 4.491-.269 2.838-.337 5.308-2.086 5.619-3.682.491-2.516.453-6.14.453-6.14Zm-3.8 6.328h-2.357V8.452c0-1.217-.513-1.834-1.537-1.834-1.132 0-1.701.731-1.701 2.18v3.161h-2.343V8.798c0-1.449-.565-2.18-1.699-2.18-1.025 0-1.537.617-1.537 1.834v5.771H5.46V8.276c0-1.215.31-2.18.931-2.895.641-.714 1.482-1.08 2.524-1.08 1.207 0 2.12.463 2.724 1.39l.59.982.585-.982c.604-.927 1.518-1.39 2.724-1.39 1.043 0 1.883.366 2.524 1.08.622.715.933 1.68.931 2.895v5.947Z" />
</svg>
);
}
1 change: 1 addition & 0 deletions members/members/_EXAMPLE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const _EXAMPLE: MemberObject = {
// { type: 'polywork', username: 'yourUserName' },
// { type: 'medium', username: 'yourUserName' },
// { type: 'hashnode', username: 'yourUserName' },
// { type: 'mastodon', url: 'https://mastodon.server/@username' },
// { type: 'website', url: 'https://virtualcoffee.io', title: 'Title of link' },
],
badges: [],
Expand Down
5 changes: 3 additions & 2 deletions members/members/mikestreety.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const mikestreety: MemberObject = {
// Links - You can add one of each type, except website - you can add as many `website` accounts as you wish.
accounts: [
{ type: 'linkedin', username: 'mikestreety' },
{ type: 'mastodon', url: 'https://hachyderm.io/@mikestreety' },
// { type: 'dev', username: 'yourUserName' },
// { type: 'codenewbie', username: 'yourUserName' },
// { type: 'twitter', username: 'yourUserName' },
Expand All @@ -42,8 +43,8 @@ export const mikestreety: MemberObject = {
// { type: 'hashnode', username: 'yourUserName' },
{
type: 'website',
url: 'https://hachyderm.io/@mikestreety',
title: 'Mastodon',
url: 'https://www.mikestreety.co.uk/',
title: 'Mikestreety',
},
],
badges: ['Hacktoberfest2023'],
Expand Down
8 changes: 8 additions & 0 deletions netlify/functions/data-members/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ async function loadUserData() {

return null;

case 'mastodon':
return {
...account,
Icon: 'Mastodon',
type: 'mastodon',
title: account.title || account.url,
};

case 'website':
return {
...account,
Expand Down