Skip to content

Commit ef19d11

Browse files
✨ added linkedin
1 parent 34343ac commit ef19d11

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
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.3",
4+
"version": "1.0.4",
55
"license": "MIT",
66
"repository": "harshzalavadiya/react-web-share",
77
"module": "dist/react-web-share.esm.js",

src/components/icon/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Icon({ name, data, onClose }: IconProps) {
1818
const { path, viewBox = "0 0 24 24", color, e } = iconList[name];
1919
return (
2020
<button
21-
onClick={() => e(data.url, data.text) && onClose()}
21+
onClick={() => e(data.url, data.text, data.title) && onClose()}
2222
aria-label={name}
2323
style={{ ...SocialIconStyle, background: color }}
2424
>

src/components/icon/list.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ const iconList: IconListType = {
4040
color: "#0088CC",
4141
e: (l, t) => window.open(`https://telegram.me/share/msg?url=${l}&text=${t}`),
4242
},
43+
linkedin: {
44+
path: (
45+
<path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z" />
46+
),
47+
color: "#0073b1",
48+
e: (l, t, ti) =>
49+
window.open(
50+
`https://www.linkedin.com/shareArticle?mini=true&url=${l}&title=${ti}&summary=${t}`
51+
),
52+
},
4353
mail: {
4454
path: (
4555
<path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" />

0 commit comments

Comments
 (0)