Skip to content

Commit e2d6e82

Browse files
authored
Merge pull request #245 from fedspendingtransparency/9693-share-icon
9693 - Removed feature specific code from share icon
2 parents 18c884f + 456e086 commit e2d6e82

File tree

143 files changed

+583
-603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+583
-603
lines changed

components/ShareIcon.jsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,17 @@ const ShareIcon = ({
6060
onShareOptionClick('copy');
6161
};
6262

63-
const copyLinkSecond = () => {
64-
Array
65-
.from(document.querySelectorAll('.js-dtui-url-for-share-icon'))
66-
// eslint-disable-next-line consistent-return
67-
.forEach((node) => {
68-
if (node.getAttribute('value').includes('about-the-data') || node.getAttribute('value').includes('glossary')) {
69-
return node.select();
70-
}
71-
});
72-
73-
document.execCommand("copy");
74-
setConfirmationText(true);
75-
onShareOptionClick('copy');
76-
};
77-
7863
const socialSharePickerOptions = socialShareOptions
7964
.filter(({ name }) => {
8065
if (!includedDropdownOptions.length) return true;
8166
return includedDropdownOptions.includes(name);
8267
})
8368
.map((option) => {
84-
if (option.name === 'copy' && !url.includes('about-the-data')) {
69+
if (option.name === 'copy') {
8570
return {
8671
...option,
8772
onClick: copyLink
8873
};
89-
} if (option.name === 'copy' && url.includes('about-the-data')) {
90-
return {
91-
...option,
92-
onClick: copyLinkSecond
93-
};
9474
}
9575
return {
9676
...option,
@@ -103,7 +83,7 @@ const ShareIcon = ({
10383
hideConfirmationText();
10484
}
10585
return hideConfirmationText.cancel;
106-
}, [showConfirmationText, setConfirmationText, hideConfirmationText]);
86+
}, []);
10787

10888
return (
10989
<div className={`${classNames ? `usda-share-icon${disabledClass} ${classNames}` : `usda-share-icon${disabledClass}`}`}>

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1051.4ffb149e.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1051.70b999ac.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/1057.bf076e2c.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/1057.ed445d75.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1294.0f4be67e.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/1294.13fcf4b4.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1575.8310a33d.iframe.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/1575.890320c9.iframe.bundle.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)