From 2b60b7512893f09dbb9f11349727661022c2440e Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 10 Sep 2018 14:24:08 +0200 Subject: [PATCH] feat(cheatsheet): add facebook share --- components/BaseCheatsheet.vue | 6 ++++-- static/images/components/BaseShare/facebook.svg | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 static/images/components/BaseShare/facebook.svg diff --git a/components/BaseCheatsheet.vue b/components/BaseCheatsheet.vue index 82ea570..7419cb2 100644 --- a/components/BaseCheatsheet.vue +++ b/components/BaseCheatsheet.vue @@ -58,7 +58,7 @@ export default { baseUrl: process.env.baseUrl, // --> COMPONENTS <-- - networks: ["Telegram", "Twitter", "LinkedIn"] + networks: ["Facebook", "Telegram", "Twitter", "LinkedIn"] }; }, @@ -72,7 +72,9 @@ export default { `Check this awesome cheatsheet about ${technology}: ${link} #${technology.toLowerCase()} #cheatsheet` ); - if (socialNetwork === "telegram") { + if (socialNetwork === "facebook") { + url = `https://www.facebook.com/sharer/sharer.php?u=${link}`; + } else if (socialNetwork === "telegram") { url = `https://telegram.me/share/url?url=${link}&text=${message}`; } else if (socialNetwork === "twitter") { url = `https://twitter.com/intent/tweet?text=${message}`; diff --git a/static/images/components/BaseShare/facebook.svg b/static/images/components/BaseShare/facebook.svg new file mode 100644 index 0000000..9799e72 --- /dev/null +++ b/static/images/components/BaseShare/facebook.svg @@ -0,0 +1,17 @@ + + + + facebook + Created with Sketch. + + + + + + + + + + + + \ No newline at end of file