feat: ship creator journey v2 and profile updates

This commit is contained in:
2026-04-12 21:42:07 +02:00
parent a2457f4e49
commit d5cff21ea2
335 changed files with 20147 additions and 1545 deletions

View File

@@ -34,12 +34,21 @@ export default function ArtworkShareButton({ artwork, shareUrl, size = 'default'
const { share } = useWebShare({ onFallback: openModal })
const handleClick = () => {
share({
const handleClick = async () => {
const result = await share({
title: artwork?.title || 'Artwork',
text: artwork?.description?.substring(0, 120) || '',
url: shareUrl || artwork?.canonical_url || window.location.href,
})
if (result?.shared && result?.native && artwork?.id) {
const csrfToken = document.head.querySelector('meta[name="csrf-token"]')?.content
fetch(`/api/artworks/${artwork.id}/share`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': csrfToken || '' },
credentials: 'same-origin',
body: JSON.stringify({ platform: 'native' }),
}).catch(() => {})
}
}
const isSmall = size === 'small'