Skip to content

Commit c2f9108

Browse files
refactor: ♻️ type callback on share (#47)
1 parent 241adb8 commit c2f9108

File tree

4 files changed

+445
-396
lines changed

4 files changed

+445
-396
lines changed

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-web-share",
33
"author": "harshzalavadiya",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"description": "Tiny Web Share API Wrapper with fallback for unsupported browsers",
66
"license": "MIT",
77
"repository": "https://github.com/hc-oss/react-web-share",
@@ -25,27 +25,27 @@
2525
},
2626
"devDependencies": {
2727
"@size-limit/preset-small-lib": "^8.1.0",
28-
"@storybook/addon-actions": "^6.5.10",
29-
"@storybook/addon-essentials": "^6.5.10",
28+
"@storybook/addon-actions": "^6.5.12",
29+
"@storybook/addon-essentials": "^6.5.12",
3030
"@storybook/addon-knobs": "^6.4.0",
31-
"@storybook/addon-links": "^6.5.10",
32-
"@storybook/react": "^6.5.10",
33-
"@types/react": "^18.0.18",
31+
"@storybook/addon-links": "^6.5.12",
32+
"@storybook/react": "^6.5.12",
33+
"@types/react": "^18.0.21",
3434
"@types/react-dom": "^18.0.6",
35-
"@typescript-eslint/eslint-plugin": "^5.36.2",
36-
"@typescript-eslint/parser": "^5.36.2",
37-
"eslint": "8.23.0",
35+
"@typescript-eslint/eslint-plugin": "^5.40.0",
36+
"@typescript-eslint/parser": "^5.40.0",
37+
"eslint": "8.25.0",
3838
"eslint-plugin-prettier": "^4.2.1",
39-
"eslint-plugin-react": "^7.31.7",
40-
"eslint-plugin-storybook": "^0.6.4",
41-
"postcss": "^8.4.16",
39+
"eslint-plugin-react": "^7.31.10",
40+
"eslint-plugin-storybook": "^0.6.6",
41+
"postcss": "^8.4.17",
4242
"prettier": "^2.7.1",
4343
"react": "^18.2.0",
4444
"react-dom": "^18.2.0",
4545
"size-limit": "^8.1.0",
4646
"storybook-addon-turbo-build": "^1.1.0",
4747
"tsup": "^6.2.3",
48-
"typescript": "^4.8.2"
48+
"typescript": "^4.8.4"
4949
},
5050
"browserslist": [
5151
"defaults",

src/components/icon/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Icon({ name, data, onClose, onClick }: IconProps) {
77
const { path, viewBox = "0 0 24 24", color, e } = IconList[name];
88

99
const handleOnButtonClicked = () => {
10-
onClick && onClick(); // callback
10+
onClick && onClick(name); // callback
1111
e(encodeURIComponent(data.url), data.text, data.title);
1212
onClose();
1313
};

stories/web-share-component.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Default = () => (
1515
url: "https://on.natgeo.com/2zHaNup",
1616
title: "Flamingos",
1717
}}
18-
onClick={() => console.log("share successful!")}
18+
onClick={(name) => console.log(`${name} share successful!`)}
1919
>
2020
<button>Share 🔗</button>
2121
</RWebShare>

0 commit comments

Comments
 (0)