Skip to content

Commit

Permalink
whatsapp share message
Browse files Browse the repository at this point in the history
  • Loading branch information
Shriansh2002 committed Jun 7, 2022
1 parent 1a20045 commit a70c0c6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/Notepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ const Notepage = () => {
const [loading, setLoading] = useState(true);
const [showLess, setShowLess] = useState(true);
const [noteInfo, setNoteInfo] = useState([]);
const messageContent =
`Check Out This Blog Published on React-Notes-Shriansh Website ⬇️
${window.location.href}`;

useEffect(() => {
const q = query(collection(db, 'Notes'), where('id', '==', noteID));
Expand Down Expand Up @@ -112,7 +116,7 @@ const Notepage = () => {
</Popover>

<a
href={`https://wa.me/send?text=${window.location.href}`}
href={`https://wa.me/send?text=${messageContent}`}
data-action="share/whatsapp/share"
>
<IoLogoWhatsapp
Expand All @@ -129,10 +133,12 @@ const Notepage = () => {
src={noteInfo[0].noteImage}
alt="Default Image"
css={{
objectFit: 'cover',
margin: 'none',
marginTop: '$0',
borderRadius: '$lg',
width: '100vw',
height: 'auto'
}}
/>

Expand Down

0 comments on commit a70c0c6

Please sign in to comment.