Skip to content

Commit 38151a0

Browse files
📝 added list of sites + typo
1 parent 0deeac0 commit 38151a0

File tree

4 files changed

+283
-181
lines changed

4 files changed

+283
-181
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Tiny [Web Share API](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/
88

99
[![Edit react-web-share](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-web-share-46skt?fontsize=14&hidenavigation=1&theme=dark)
1010

11-
> 💡 most browsers will restrict web share api only to https websites
11+
> 💡 most browsers restricts web share api only to https websites
1212
1313
## ✨ Features
1414

@@ -60,10 +60,21 @@ export default Example;
6060

6161
## 👀 Props
6262

63-
| Prop | Description | Type | Default |
64-
| --------- | ------------ | -------------------- | --------------------------------------------- |
65-
| `data` | Share Object | `{text, url, title}` | `{text: "", url: currentURL, title: "Share"}` |
66-
| `options` | sites | `string[]` | all available social sites |
63+
| Prop | Description | Type | Default |
64+
| ------- | ------------ | -------------------- | --------------------------------------------- |
65+
| `data` | Share Object | `{text, url, title}` | `{text: "", url: currentURL, title: "Share"}` |
66+
| `sites` | sites | `string[]` | all platforms (see list below for key list) |
67+
68+
## 🌎 Sites
69+
70+
- facebook
71+
- twitter
72+
- whatsapp
73+
- reddit
74+
- telegram
75+
- linkedin
76+
- mail
77+
- copy (Copy to Clipboard)
6778

6879
## 🤠 Credits
6980

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": "Harsh Zalavadiya",
4-
"version": "1.0.5",
4+
"version": "1.0.6",
55
"license": "MIT",
66
"repository": "harshzalavadiya/react-web-share",
77
"module": "dist/react-web-share.esm.js",
@@ -28,25 +28,25 @@
2828
},
2929
"devDependencies": {
3030
"@ampproject/filesize": "^4.2.0",
31-
"@babel/core": "^7.9.0",
32-
"@storybook/addon-actions": "^5.3.18",
33-
"@storybook/addon-docs": "^5.3.18",
34-
"@storybook/addon-info": "^5.3.18",
35-
"@storybook/addon-links": "^5.3.18",
36-
"@storybook/addons": "^5.3.18",
37-
"@storybook/react": "^5.3.18",
38-
"@types/react": "^16.9.34",
39-
"@types/react-dom": "^16.9.7",
31+
"@babel/core": "^7.9.6",
32+
"@storybook/addon-actions": "^5.3.19",
33+
"@storybook/addon-docs": "^5.3.19",
34+
"@storybook/addon-info": "^5.3.19",
35+
"@storybook/addon-links": "^5.3.19",
36+
"@storybook/addons": "^5.3.19",
37+
"@storybook/react": "^5.3.19",
38+
"@types/react": "^16.9.35",
39+
"@types/react-dom": "^16.9.8",
4040
"babel-loader": "^8.1.0",
4141
"husky": "^4.2.5",
4242
"react": "^16.13.1",
4343
"react-docgen-typescript-loader": "^3.7.2",
4444
"react-dom": "^16.13.1",
4545
"react-is": "^16.13.1",
46-
"ts-loader": "^7.0.1",
46+
"ts-loader": "^7.0.5",
4747
"tsdx": "^0.13.2",
48-
"tslib": "^1.11.1",
49-
"typescript": "^3.8.3"
48+
"tslib": "^2.0.0",
49+
"typescript": "^3.9.3"
5050
},
5151
"husky": {
5252
"hooks": {

src/components/portal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import React, { ReactPortal } from "react";
12
import { useEffect } from "react";
23
import { createPortal } from "react-dom";
34

4-
export default function Portal({ children }) {
5+
const PortalComponent: React.FC = ({ children }): ReactPortal => {
56
const el = document.createElement("div");
67

78
useEffect(() => {
@@ -12,4 +13,6 @@ export default function Portal({ children }) {
1213
}, [el]);
1314

1415
return createPortal(children, el);
15-
}
16+
};
17+
18+
export default PortalComponent;

0 commit comments

Comments
 (0)