这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/app/landing/components/ShareJobOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useState } from "react";
import { Instagram, Facebook, X, Youtube, Linkedin } from "lucide-react";

export default function ShareJobPostOverlay() {
const [copied, setCopied] = useState(false);
const [jobLink, setJobLink] = useState("https://www.prosple.com");
const handleCopy = () => {
{
/*when copy link is clicked*/
}
navigator.clipboard.writeText(jobLink);
{
/*copies the link*/
}
setCopied(true);
setTimeout(() => setCopied(false), 2000);
{
/*delay*/
}
};
{
/*platform is when the social media button is clicked it will redirect to the link */
}
const handleShare = (
platform: "Facebook" | "X" | "linkedin" | "Youtube" | "Instagram"
) => {
let shareUrl = "";
const encodedLink = encodeURIComponent(jobLink);

switch (platform) {
case "Instagram":
alert("Instagram does not support web link sharing. Share manually.");
return;
break;
case "Facebook":
shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodedLink}`;
break;
case "X":
shareUrl = `https://twitter.com/intent/tweet?url=${encodedLink}`;
break;
case "Youtube":
alert("YouTube does not support direct link sharing. Share manually.");
break;
case "linkedin":
shareUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodedLink}`;
break;
default:
return;
}
window.open(shareUrl, "_blank");
{
/*opens a new browser*/
}
};
return (
<div className="max-w-md mx-auto p-5 rounded-2xl shadow-lg bg-white border"></div>
);
}