Skip to content

Commit

Permalink
Merge pull request #48 from Divyanshgarg-04/feat/sharePost
Browse files Browse the repository at this point in the history
Added a feature to share the post using the share button
  • Loading branch information
JiyaGupta-cs authored Jan 28, 2024
2 parents 6f46a6c + b696730 commit 5afeae1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"react-router-dom": "^6.20.0",
"react-scripts": "5.0.1",
"react-twitter-embed": "^4.0.4",
"react-web-share": "^2.0.2",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions src/Post.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import './Post.css'
import { RWebShare } from "react-web-share";

const Post = ({displayName, userName, verified, text, image, avatar,location}) => {
return (
Expand All @@ -23,7 +24,18 @@ const Post = ({displayName, userName, verified, text, image, avatar,location}) =
<div className="post_footer">
<img width={'30px'} src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAe1BMVEUAAAD///+cnJzg4OA7Ozvn5+eYmJgxMTH7+/vy8vLq6ur19fWwsLClpaXl5eXBwcEkJCTX19e3t7eMjIx3d3dkZGTLy8tfX19/f39MTEwsLCwbGxvS0tJDQ0MPDw8XFxdxcXFZWVlGRkaRkZFRUVFqamogICB8fHwoKCimJa4pAAAFsUlEQVR4nO3dC5uxQBgG4EF0ICkkWpZd7P7/X/gpPhudzHibZp6r5wc07ks1h2pe1kMPa/sHNJ5OqH86of7phPqnE+qfTqh/OqH+aU9oOcH8YGzM7X7kOVZz7bQmDH9Mdo/x442baqgl4WARs4fsjIndTFPtCMMNy+cYNHKutiKcnAuAl0RN/I1tCMNiX3KuhvSttSAcGKVCNpuQNydfaC3LgZeMqC9G+UK/EkhPlC90a4SsT9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0euND0wYXn+3YMqMJDD1147IRvpn3hGl6I/x/i32lO8MIFvHAEL5zAC0N44QBdmKkQCSrMbEcIKszssYIpzJZvwRSuHXRhtsQnpnCALjz20IUeunBpowsf940DFD7VSsYTnmxw4fp5wzg04Ta3eSOY8JQvpgAmLNjkE0t4zgPBhAa8sGh7bCzhHF4YoAvjwl12kYSHoh2hoYRFlyGWsLAcBpKwqL/HEhaXUkASFu+XDiQsKZ2EIywru4MjXBYDgYRldYVghIW9PZIwtwAFJ3yuiNC0UPouu6NSYI8JVrmpjitZGFVUEWR2E3v7e3KFp6oyiUygOmh9fKnCeWUdSCZaqqgqsS1T6FYXumQ9n77Qzd8gv3nhvq6wFxOrTFidvxGifWq01lMcebWVSplYdcnKrLLPt+yPQKgK2AsJPl4pF8wEK4RWhaK2Jl2SOjMhbQ2PskF+S0mrIbmUwPIRYjtJhRZh1alPiuqolLnW7LJGVEBDNeC9slw/JgGeSMpOkuZeHdBfvd/zGzXDi1aSqfDoRe/Vlzv0FbvHXJOt0mkNvPlqawrEWC/cD4ryxA1EXm31ttIJ9U8n1D+dUP90Qv3TCfVPJ9Q/+MJ/n9yDbnjHQvUAAAAASUVORK5CYII=" alt="" />
<img width={'30px'} src="https://static.vecteezy.com/system/resources/thumbnails/000/284/988/small/a19.jpg" alt="" />
<RWebShare
data={{
text: "Share Post",
url: "https://mytwit.vercel.app/",
title: "Capabilix",
}}
onClick={() =>
console.log("shared successfully!")
}
>
<img width={'30px'} src="https://static.vecteezy.com/system/resources/previews/014/455/886/original/share-icon-on-transparent-background-free-png.png" alt="" />
</RWebShare>
<img width={'30px'} src="https://cdn-icons-png.flaticon.com/512/786/786352.png" alt="" />

</div>
Expand Down

0 comments on commit 5afeae1

Please sign in to comment.