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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user