feat: artwork share system with modal, native Web Share API, and tracking

- Add ArtworkShareModal with glassmorphism UI (Facebook, X, Pinterest, Email, Copy Link, Embed Code)
- Add ArtworkShareButton with lazy-loaded modal and native share fallback
- Add useWebShare hook abstracting navigator.share with AbortError handling
- Add ShareToast auto-dismissing notification component
- Add share() endpoint to ArtworkInteractionController (POST /api/artworks/{id}/share)
- Add artwork_shares migration for Phase 2 share tracking
- Refactor ArtworkActionBar to use new ArtworkShareButton component
This commit is contained in:
2026-02-28 15:29:45 +01:00
parent 568b3f3abb
commit 90f244f264
8 changed files with 569 additions and 38 deletions

View File

@@ -258,6 +258,13 @@ Route::middleware(['web', 'auth', 'normalize.username'])->group(function () {
->name('api.users.follow');
});
// ── Share tracking (public, throttled) ────────────────────────────────────────
// POST /api/artworks/{id}/share → record a share event
Route::middleware(['web', 'throttle:30,1'])
->post('artworks/{id}/share', [\App\Http\Controllers\Api\ArtworkInteractionController::class, 'share'])
->whereNumber('id')
->name('api.artworks.share');
// ── Comment CRUD ──────────────────────────────────────────────────────────────
// GET /api/artworks/{id}/comments list comments (public)
// POST /api/artworks/{id}/comments post a comment (auth)