Skip to content

Commit

Permalink
add threads logo
Browse files Browse the repository at this point in the history
  • Loading branch information
parker23b committed Sep 23, 2024
1 parent 24af9ac commit 45a3dc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/assets/icons/threads.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 3 additions & 26 deletions src/components/sections/SocialsSharing.astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const links = [
name: "Mastodon",
baseUrl: "test",
},
{ name: 'Threads',
baseUrl: `https://www.threads.net/intent/post?url=${encodedUrl}`
}
];
const iconMap = icons.reduce(
Expand Down Expand Up @@ -122,32 +125,6 @@ const borderColor = color ? `border-${color}` : `border-white`;
submit.setAttribute('href', `https://${instance}/share?text=${encodeURIComponent(description)}%20${encodeURIComponent(url)}`);
};
});
{/* const button = document.querySelector(".mastodon-share-");
if (button) {
button.addEventListener("click", (e) => {
// if (
// localStorage.getItem("mastodon-instance") &&
// localStorage.getItem("mastodon-instance") !== null
// ) {
// button.setAttribute(
// "href",
// `https://${localStorage.getItem("mastodon-instance")}/share?text=${encodeURIComponent(description)}%20${encodeURIComponent(url)}`
// );
// localStorage.removeItem("mastodon-instance");
// } else {
e.preventDefault();
const dialog = document.getElementById("mastodon-modal");
console.log(dialog);
dialog.showModal();
// let instance = window.prompt("Please enter your Mastodon instance");
// if (!instance) {
// instance = "mastodon.social";
// }
// localStorage.setItem("mastodon-instance", instance);
// } */}
{/* });
} */}
</script>


Expand Down
2 changes: 2 additions & 0 deletions src/content/data/socialsSharing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
icon: linkedin
- label: Mastodon
icon: mastodon
- label: Threads
icon: threads

0 comments on commit 45a3dc6

Please sign in to comment.