From 74bb6870b75fedfded791a2c2d9548b2aea7bfd6 Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Fri, 13 Dec 2024 10:02:35 -0500 Subject: [PATCH] add social icons for mastodon and bluesky --- .../src/theme-classic.d.ts | 16 ++++++++++ .../Blog/Components/Author/Socials/index.tsx | 4 +++ .../src/theme/Icon/Socials/Bluesky/index.tsx | 25 ++++++++++++++++ .../src/theme/Icon/Socials/GitHub/index.tsx | 2 +- .../src/theme/Icon/Socials/Mastodon/index.tsx | 29 +++++++++++++++++++ project-words.txt | 2 ++ .../2024-07-03-multiple-authors.mdx | 2 ++ website/_dogfooding/_blog tests/authors.yml | 1 + 8 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx create mode 100644 packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx diff --git a/packages/docusaurus-theme-classic/src/theme-classic.d.ts b/packages/docusaurus-theme-classic/src/theme-classic.d.ts index 6b5c40d730473..efc8edbe38f57 100644 --- a/packages/docusaurus-theme-classic/src/theme-classic.d.ts +++ b/packages/docusaurus-theme-classic/src/theme-classic.d.ts @@ -1708,6 +1708,22 @@ declare module '@theme/Icon/Socials/StackOverflow' { export default function StackOverflow(props: Props): ReactNode; } +declare module '@theme/Icon/Socials/Mastodon' { + import type {ComponentProps, ReactNode} from 'react'; + + export interface Props extends ComponentProps<'svg'> {} + + export default function Mastodon(props: Props): ReactNode; +} + +declare module '@theme/Icon/Socials/Bluesky' { + import type {ComponentProps, ReactNode} from 'react'; + + export interface Props extends ComponentProps<'svg'> {} + + export default function Bluesky(props: Props): ReactNode; +} + declare module '@theme/TagsListByLetter' { import type {ReactNode} from 'react'; import type {TagsListItem} from '@docusaurus/utils'; diff --git a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx index a632bd62addd9..a75efc67aca31 100644 --- a/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Blog/Components/Author/Socials/index.tsx @@ -16,6 +16,8 @@ import GitHub from '@theme/Icon/Socials/GitHub'; import X from '@theme/Icon/Socials/X'; import StackOverflow from '@theme/Icon/Socials/StackOverflow'; import LinkedIn from '@theme/Icon/Socials/LinkedIn'; +import Mastodon from '@theme/Icon/Socials/Mastodon'; +import Bluesky from '@theme/Icon/Socials/Bluesky'; import DefaultSocialIcon from '@theme/Icon/Socials/Default'; import styles from './styles.module.css'; @@ -30,6 +32,8 @@ const SocialPlatformConfigs: Record = { stackoverflow: {Icon: StackOverflow, label: 'Stack Overflow'}, linkedin: {Icon: LinkedIn, label: 'LinkedIn'}, x: {Icon: X, label: 'X'}, + mastodon: { Icon: Mastodon, label: "Mastodon" }, + bluesky: { Icon: Bluesky, label: "Bluesky" }, }; function getSocialPlatformConfig(platformKey: string): SocialPlatformConfig { diff --git a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx new file mode 100644 index 0000000000000..b80af31678bff --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Bluesky/index.tsx @@ -0,0 +1,25 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {ReactNode, SVGProps} from 'react'; + +// SVG Source: https://svgl.app/ +function Bluesky(props: SVGProps): ReactNode { + return + + +}; +export default Bluesky; diff --git a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/GitHub/index.tsx b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/GitHub/index.tsx index 2fee4037a0126..d629aabc1c476 100644 --- a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/GitHub/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/GitHub/index.tsx @@ -26,4 +26,4 @@ function GitHub(props: SVGProps): ReactNode { ); } -export default GitHub; +export default GitHub; \ No newline at end of file diff --git a/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx new file mode 100644 index 0000000000000..6f511acdcdcbc --- /dev/null +++ b/packages/docusaurus-theme-classic/src/theme/Icon/Socials/Mastodon/index.tsx @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import type {ReactNode, SVGProps} from 'react'; + +// SVG Source: https://svgl.app/ +function Mastodon(props: SVGProps): ReactNode { + return + + + +}; +export default Mastodon; diff --git a/project-words.txt b/project-words.txt index 9cef579226d0b..e758a89ee4385 100644 --- a/project-words.txt +++ b/project-words.txt @@ -25,6 +25,7 @@ beforeinstallprompt Bhatt blockquotes Blockquotes +bluesky Bokmål bunx caabernathy @@ -155,6 +156,7 @@ Marcey's markprompt Markprompt Massoud +mastodon mathjax maxlynch maxresdefault diff --git a/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx b/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx index eaf0b91ec48fe..03420a6dc85b0 100644 --- a/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx +++ b/website/_dogfooding/_blog tests/2024-07-03-multiple-authors.mdx @@ -10,6 +10,8 @@ authors: stackoverflow: https://stackoverflow.com/users/82609/sebastien-lorber linkedin: https://www.linkedin.com/in/sebastienlorber/ newsletter: https://thisweekinreact.com/newsletter + bluesky: https://bsky.app/profile/sebastienlorber.com + mastodon: https://mastodon.social/@sebastienlorber - name: Sébastien Lorber imageURL: https://github.com/slorber.png socials: diff --git a/website/_dogfooding/_blog tests/authors.yml b/website/_dogfooding/_blog tests/authors.yml index a7dac6a959acc..ff320f9b122ed 100644 --- a/website/_dogfooding/_blog tests/authors.yml +++ b/website/_dogfooding/_blog tests/authors.yml @@ -6,6 +6,7 @@ slorber: page: true socials: x: sebastienlorber + bluesky: https://bsky.app/profile/sebastienlorber.com ozaki: name: ozaki