Skip to content

Commit

Permalink
remove sharing buttong when share is unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
skedwards88 committed May 2, 2024
1 parent 3133571 commit 8a8f017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Heart.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function Heart({setDisplay, appName, shareText, repoName, url}) {
<div className="infoText">
{"Like this game? Share it with your friends.\n\n"}
{<Share appName={appName} text={shareText} url={url}></Share>}
{`\n\n`}
{`\n`}
{<hr></hr>}
{`\n`}
{`Want more games? Check out `}
Expand Down
6 changes: 2 additions & 4 deletions src/components/Share.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import {handleShare, handleCopy} from "../common/handleShare";
import {handleShare} from "../common/handleShare";

export default function Share({appName, text, url, seed}) {
if (navigator.canShare) {
Expand All @@ -10,9 +10,7 @@ export default function Share({appName, text, url, seed}) {
);
} else {
return (
<button onClick={() => handleCopy({text, url, seed})}>
Copy sharing link
</button>
<></>
);
}
}

0 comments on commit 8a8f017

Please sign in to comment.