Skip to content

Commit 7e8bee5

Browse files
committed
fix url
1 parent b2b8b6b commit 7e8bee5

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/pages/JobPost/viewSingleJob.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,35 @@ const SingleJobPostDetails = (props: any) => {
1919
dispatch(fetchSingleJobPost(jobPostId));
2020
}, [jobPostId]);
2121

22-
const shareMessage = `Check out this job opportunity: ${fetchSingleJobPostStates?.data?.title}\n${window.location.href}`;
22+
const clickableText = "Click here to view the job post";
23+
const shareMessage = `Check out this job opportunity: ${fetchSingleJobPostStates?.data?.title}\n${clickableText}`;
2324

2425
const shareOnTwitterDM = () => {
25-
const url = `https://twitter.com/messages/compose?text=${encodeURIComponent(
26-
shareMessage
27-
)}`;
26+
const url = `https://twitter.com/messages/compose?text=${encodeURIComponent(shareMessage)}&url=${encodeURIComponent(window.location.href)}`;
2827
window.open(url, "_blank", "width=600,height=400");
2928
};
3029

3130
const shareOnWhatsApp = () => {
32-
const url = `https://api.whatsapp.com/send?text=${encodeURIComponent(
33-
shareMessage
34-
)}`;
31+
const url = `https://api.whatsapp.com/send?text=${encodeURIComponent(shareMessage)}&url=${encodeURIComponent(window.location.href)}`;
3532
window.open(url, "_blank", "width=600,height=400");
3633
};
3734

3835
const shareOnTelegram = () => {
39-
const url = `https://t.me/share/url?url=${encodeURIComponent(window.location.href)}`;
36+
const url = `https://t.me/share/url?url=${encodeURIComponent(window.location.href)}&text=${encodeURIComponent(shareMessage)}`;
4037
window.open(url, "_blank", "width=600,height=400");
4138
};
4239

4340
const shareOnLinkedIn = () => {
44-
const url = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(
45-
window.location.href
46-
)}`;
41+
const url = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(window.location.href)}`;
4742
window.open(url, "_blank");
4843
};
4944

5045
const shareOnGmail = () => {
5146
const subject = encodeURIComponent("Interesting Job Opportunity");
52-
const body = encodeURIComponent(shareMessage);
47+
const body = encodeURIComponent(
48+
`Check out this job opportunity: ${fetchSingleJobPostStates?.data?.title}\n\n` +
49+
`Click here to view the job post: ${window.location.href}`
50+
);
5351
const url = `https://mail.google.com/mail/?view=cm&fs=1&to=&su=${subject}&body=${body}`;
5452
window.open(url, "_blank");
5553
}

0 commit comments

Comments
 (0)