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

Mastodon Icon Doesn't Render for sites other than mastodon.social #146

Open
macbraughton opened this issue May 7, 2024 · 1 comment
Open

Comments

@macbraughton
Copy link

macbraughton commented May 7, 2024

I've noticed that there is a function for rendering the icon for mastodon here:

function IconMastodon() {

However, when I add it to the links as shown in the readme, for example:

 links: [
    { title: "Email", url: "mailto:[email protected]" },
    { title: "GitHub", url: "https://github.com/denobot" },
    { title: "Twitter", url: "https://twitter.com/denobot" },
    { title: "Mastodon", url: "https://somethingotherthanmastodon.social/@denobot"},
  ],

It's not going to render.

This is a problem, in general, and for me personally because mastodon is a decentralized network and isn't owned by mastodon.social, and the icon will not render for a different url. This is because of the code snippet:

    const icon = socialAppIcons.get(
    url.hostname.replace(/^www\./, ""),);

In the source here:

const icon = socialAppIcons.get(

Which uses a regex to get the name of the social media site from the url to pass to the socialAppIcons function.

I can understand some possible reasons we want to use the url here, but couldn't we just use the title instead? I would issue a pull request but I wanted to understand the mainters' intention here before starting one.

@aryan02420
Copy link

aryan02420 commented Jul 3, 2024

@macbraughton you can use this link as a workaround:

https://mastodon.social/@[email protected]

or you can copy IconMastodon into your main.tsx file:

 { title: "Mastodon", url: "https://somethingotherthanmastodon.social/@denobot", icon: IconMastodon },

but couldn't we just use the title instead?

I think exporting the icon would be the best solution, since title can specific to a language eg "мастодон"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants