sfc-utils 1.4.181 → 1.4.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/sharebuttons.mjs +18 -3
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import * as shareStyles from "../styles/modules/share.module.less";
|
|
3
3
|
import { appCheck } from "../appcheck.js";
|
|
4
|
+
import { trackEvent } from "../components/helpers/utilfunctions.mjs";
|
|
4
5
|
|
|
5
|
-
const ShareButtons = ({ meta, urlAdd }) => {
|
|
6
|
+
const ShareButtons = ({ meta, urlAdd, location = "Byline" }) => {
|
|
6
7
|
// We need to run appCheck in useEffect because we need to wait for the DOM to be ready
|
|
7
8
|
let [hideSocial, setHideSocial] = useState(false);
|
|
8
9
|
useEffect(() => {
|
|
@@ -37,7 +38,10 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
37
38
|
<a
|
|
38
39
|
href={`https://www.facebook.com/sharer/sharer.php?u=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
|
|
39
40
|
className={shareStyles.link}
|
|
40
|
-
onClick={
|
|
41
|
+
onClick={(e) => {
|
|
42
|
+
facebookClick(e);
|
|
43
|
+
trackEvent("Click", "Button", "Share", `Facebook|${location}`);
|
|
44
|
+
}}
|
|
41
45
|
>
|
|
42
46
|
<svg
|
|
43
47
|
className={shareStyles.svg}
|
|
@@ -59,6 +63,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
59
63
|
<a
|
|
60
64
|
href={`https://x.com/intent/post?url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}&text=${meta.PROJECT.TWITTER_TEXT}`}
|
|
61
65
|
className={shareStyles.link}
|
|
66
|
+
onClick={() => {
|
|
67
|
+
trackEvent("Click", "Button", "Share", `X|${location}`);
|
|
68
|
+
}}
|
|
62
69
|
>
|
|
63
70
|
{/* <svg
|
|
64
71
|
className={shareStyles.svg}
|
|
@@ -95,6 +102,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
95
102
|
<a
|
|
96
103
|
href={`https://bsky.app/intent/compose?text=${meta.PROJECT.TWITTER_TEXT}&url=${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%${urlAdd}`}
|
|
97
104
|
className={shareStyles.link}
|
|
105
|
+
onClick={() => {
|
|
106
|
+
trackEvent("Click", "Button", "Share", `Bluesky|${location}`);
|
|
107
|
+
}}
|
|
98
108
|
>
|
|
99
109
|
<svg
|
|
100
110
|
className={shareStyles.svg}
|
|
@@ -107,7 +117,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
107
117
|
>
|
|
108
118
|
<path
|
|
109
119
|
data-name="Bluesky Logo"
|
|
110
|
-
fill="currentColor"
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
d="M111.8 62.2C170.2 105.9 233 194.7 256 242.4c23-47.6 85.8-136.4 144.2-180.2c42.1-31.6 110.3-56 110.3 21.8c0 15.5-8.9 130.5-14.1 149.2C478.2 298 412 314.6 353.1 304.5c102.9 17.5 129.1 75.5 72.5 133.5c-107.4 110.2-154.3-27.6-166.3-62.9l0 0c-1.7-4.9-2.6-7.8-3.3-7.8s-1.6 3-3.3 7.8l0 0c-12 35.3-59 173.1-166.3 62.9c-56.5-58-30.4-116 72.5-133.5C100 314.6 33.8 298 15.7 233.1C10.4 214.4 1.5 99.4 1.5 83.9c0-77.8 68.2-53.4 110.3-21.8z"
|
|
122
|
+
/>
|
|
111
123
|
</svg>
|
|
112
124
|
</a>
|
|
113
125
|
</>
|
|
@@ -116,6 +128,9 @@ const ShareButtons = ({ meta, urlAdd }) => {
|
|
|
116
128
|
<a
|
|
117
129
|
href={`mailto:?subject=${meta.PROJECT.TITLE}&body=${meta.PROJECT.DESCRIPTION}%0A%0A${meta.MAIN_DOMAIN}%2F${subfolder}${meta.PROJECT.SLUG}%2F${urlAdd}`}
|
|
118
130
|
className={shareStyles.link}
|
|
131
|
+
onClick={() => {
|
|
132
|
+
trackEvent("Click", "Button", "Share", `Email|${location}`);
|
|
133
|
+
}}
|
|
119
134
|
>
|
|
120
135
|
<svg
|
|
121
136
|
className={shareStyles.svg}
|