diff --git a/src/components/Chapter.js b/src/components/Chapter.js index d3c8b63..e3205f0 100644 --- a/src/components/Chapter.js +++ b/src/components/Chapter.js @@ -11,11 +11,29 @@ import TableOfContents from "./TableOfContents"; import Footer from "./Footer"; const Chapter = ({ children: chapter }) => { + console.log(chapter) const Content = chapter.content; + function handleShare() { + if (!navigator.share) { + // should be impossible + alert("Sorry, Sharing links are not supported on your device.", chapter.path); + return; + } + navigator.share && navigator.share({ + title: chapter.frontMatter.title + " | LingDocs Pashto Grammar", + url: "https://grammar.lingdocs.com" + chapter.path, + }); + } return <>
-

{chapter.frontMatter.title}

+
+

{chapter.frontMatter.title}

+ {navigator.share &&
+ +
} +
+