Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed 'Report' and 'Follow' button from user profile and Added share profile functionality #1191

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 17 additions & 5 deletions src/components/ProfileBanner/profile/ProfileCardOne/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ export default function ProfileCardOne({
const handleClose = () => {
setAnchorEl(null);
};

const handleShare = () => {
if (navigator.share) {
navigator.share({
title: document.title,
text: `Check out ${name}'s profile on our platform!`,
url: window.location.href
})
.then(() => console.log("Share successful"))
.catch((error) => console.error("Share failed", error));
} else {
alert("Web Share API is not supported in your browser.");
}
};

return (
<>
<div
Expand Down Expand Up @@ -87,12 +102,9 @@ export default function ProfileCardOne({
<button
className={classes.profileSubscribeButton}
data-testId="user_profile_card_one_buttonGroup_followButton"
onClick={handleShare}
>
Follow
</button>
<button className={classes.profileShareButton}>Share</button>
<button className={classes.profileReportButton}>
Report
Share
</button>
<button
className={classes.profileIconButton}
Expand Down
Loading