Refine sharing and cookie consent button styles

This commit is contained in:
nmemmert
2026-04-12 19:03:07 -04:00
parent 770d2357ac
commit 6e8b360398
2 changed files with 73 additions and 2 deletions
+38
View File
@@ -240,6 +240,43 @@ function AnalyticsConsentBanner() {
)
}
function ShareShowButton() {
const [feedback, setFeedback] = useState('')
async function handleShare() {
const shareUrl = window.location.origin
const shareTitle = 'Verse by Verse with Nate'
const shareText = 'Check out Verse by Verse with Nate.'
try {
if (navigator.share) {
await navigator.share({ title: shareTitle, text: shareText, url: shareUrl })
setFeedback('Shared successfully.')
return
}
if (navigator.clipboard?.writeText) {
await navigator.clipboard.writeText(shareUrl)
setFeedback('Link copied. Share it with a friend.')
return
}
setFeedback(`Copy this link: ${shareUrl}`)
} catch {
setFeedback('Share canceled.')
}
}
return (
<div className="share-show-wrap">
<button type="button" className="btn-primary btn-share-show" onClick={handleShare}>
Share the Show
</button>
{feedback && <p className="share-feedback">{feedback}</p>}
</div>
)
}
function LandingPage({ content }: { content: SiteContent }) {
return (
<div className="site">
@@ -446,6 +483,7 @@ function LandingPage({ content }: { content: SiteContent }) {
>
creators.spotify.com/pod/profile/nmemmert
</a>
<ShareShowButton />
</div>
<div className="qr-code-wrap">
<div className="qr-frame">