Skip to content

Commit

Permalink
feat: share episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid-80 committed Jul 4, 2024
1 parent 6c8c41f commit 0876036
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 12 deletions.
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/css/Home.css
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@
border-radius: 100%;
}


.shareButton{
border: none;
padding: 4px 14px;
outline: none;
border-radius: 20px;
background-color: #574B90;
color: white;
}

.gap-10{
gap: 40px;
Expand Down
38 changes: 27 additions & 11 deletions src/pages/resources/audio/ChanakyaAudio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ const ChanakyaAudio = ({ setProgress }) => {
setPlaybackRate(rate);
};

let shareData = {
title: "Chanakya's Story",
text: "Audio files on Chanakya's life and lessons!!",
url: window.location.href,
};


useEffect(() => {
const getData = async () => {
setProgress(50);
Expand Down Expand Up @@ -72,19 +79,28 @@ const ChanakyaAudio = ({ setProgress }) => {
}
};

const ShareHandler = async () => {
await navigator.share(shareData);
}

return (
<div className="container">
<div className="container">
<input
type="number"
placeholder="Enter episode number"
value={value}
onChange={handleChange}
onKeyDown={handleKeyPress}
/>
<button type="submit" className="btn btn-dark" onClick={handleClick}>
Enter
</button>
<div className="flex ">
<div className="container">
<input
type="number"
placeholder="Enter episode number"
value={value}
onChange={handleChange}
onKeyDown={handleKeyPress}
/>
<button type="submit" className="btn btn-dark" onClick={handleClick}>
Enter
</button>
</div>
<div>
<button onClick={()=>ShareHandler()} className="shareButton">Share</button>
</div>
</div>

<div className="card" style={{ width: "20rem" }}>
Expand Down

0 comments on commit 0876036

Please sign in to comment.