From 8786057d5993310ef0ba6a1a40afbdaa372c311d Mon Sep 17 00:00:00 2001 From: MiguelEncina Date: Tue, 6 Jan 2026 19:52:42 +0100 Subject: [PATCH] fix: minnor changes and upgrades on beats and pricing --- src/components/forms/BeatForm.jsx | 2 +- src/pages/Pricing.jsx | 39 +++++++++++++------ src/pages/app/explore/components/BeatCard.tsx | 18 ++++----- .../components/BeatsExploreSection.css | 20 ++++++---- src/services/beatsService.js | 13 ------- 5 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/components/forms/BeatForm.jsx b/src/components/forms/BeatForm.jsx index 1149cb1..10a8e33 100644 --- a/src/components/forms/BeatForm.jsx +++ b/src/components/forms/BeatForm.jsx @@ -226,7 +226,7 @@ const BeatForm = ({ )} {/* Cover Art Section */} - +
diff --git a/src/pages/Pricing.jsx b/src/pages/Pricing.jsx index 04b296f..553a090 100644 --- a/src/pages/Pricing.jsx +++ b/src/pages/Pricing.jsx @@ -13,7 +13,7 @@ import { logger } from '../logger'; import PricingConfirmModal from './pricing/PricingConfirmModal'; import './Pricing.css'; -// Plan configuration - matches backend plans.config.js +// Plan configuration - matches backend plans.config.js and SocialBeats-1.1.yaml const plans = [ { name: 'FREE', @@ -27,11 +27,16 @@ const plans = [ features: [ { text: 'Escucha beats ilimitados', included: true }, { text: 'Máximo 3 beats subidos', included: true }, - { text: 'Perfil básico de artista', included: true }, - { text: 'Estadísticas básicas', included: true }, + { text: 'Tamaño máximo por beat: 10MB', included: true }, + { text: 'Almacenamiento: 30MB', included: true }, + { text: 'Hasta 5 certificaciones', included: true }, + { text: '1 playlist', included: true }, + { text: '3 dashboards de analíticas', included: true }, + { text: 'Perfil avanzado de artista', included: true }, { text: 'Banner personalizado', included: false }, { text: 'Cover de perfil', included: false }, - { text: 'Beats destacados', included: false }, + { text: 'Decorativos de perfil', included: false }, + { text: 'Descarga de beats', included: false }, ], }, { @@ -45,12 +50,17 @@ const plans = [ popular: true, features: [ { text: 'Escucha beats ilimitados', included: true }, - { text: 'Máximo 25 beats subidos', included: true }, - { text: 'Perfil verificado de artista', included: true }, - { text: 'Estadísticas avanzadas', included: true }, + { text: 'Máximo 30 beats subidos', included: true }, + { text: 'Tamaño máximo por beat: 25MB', included: true }, + { text: 'Almacenamiento: 750MB', included: true }, + { text: 'Hasta 10 certificaciones', included: true }, + { text: '3 playlists', included: true }, + { text: '30 dashboards de analíticas', included: true }, + { text: 'Perfil avanzado de artista', included: true }, { text: 'Banner personalizado', included: true }, { text: 'Cover de perfil', included: true }, - { text: 'Hasta 3 beats destacados', included: true }, + { text: 'Decorativos de perfil', included: false }, + { text: 'Descarga de beats', included: false }, ], }, { @@ -64,12 +74,17 @@ const plans = [ popular: false, features: [ { text: 'Escucha beats ilimitados', included: true }, - { text: 'Beats ilimitados subidos', included: true }, - { text: 'Perfil verificado premium', included: true }, - { text: 'Estadísticas completas + insights', included: true }, + { text: 'Beats ilimitados', included: true }, + { text: 'Tamaño máximo por beat: 50MB', included: true }, + { text: 'Almacenamiento: 1GB', included: true }, + { text: 'Certificaciones ilimitadas', included: true }, + { text: '30 playlists', included: true }, + { text: 'Dashboards ilimitados', included: true }, + { text: 'Perfil avanzado de artista', included: true }, { text: 'Banner personalizado', included: true }, { text: 'Cover de perfil', included: true }, - { text: 'Beats destacados ilimitados', included: true }, + { text: 'Decorativos de perfil', included: true }, + { text: 'Descarga de beats', included: true }, ], } ]; diff --git a/src/pages/app/explore/components/BeatCard.tsx b/src/pages/app/explore/components/BeatCard.tsx index 662c0ef..e960e6e 100644 --- a/src/pages/app/explore/components/BeatCard.tsx +++ b/src/pages/app/explore/components/BeatCard.tsx @@ -4,6 +4,7 @@ import './BeatCard.css'; import { usePlayerStore } from '../../../../store/usePlayerStore'; import { Beat } from '../../../../store/usePlayerStore'; import { getAudioStreamUrl } from '../../../../services/beatsService'; +import logo from '../../../../assets/logo-dark-no-fondo.png'; /** * BeatCard - Tarjeta de beat para la vista de exploración @@ -80,14 +81,17 @@ export default function BeatCard({ beat, variant = 'default', onClick }: BeatCar const beatId = beat._id || beat.id; const { streamUrl, coverUrl } = await getAudioStreamUrl(beatId); + // Usar defaultCover como fallback si no hay cover disponible + const finalCover = coverUrl || coverImageUrl || defaultCover; + const beatForStore: Beat = { ...beat, id: beatId, author: beat.createdBy?.username || 'Unknown', - cover: coverUrl || coverImageUrl || undefined, + cover: finalCover, audio: { url: streamUrl, - coverUrl: coverUrl || coverImageUrl || undefined, + coverUrl: finalCover, duration: beat.duration } }; @@ -100,14 +104,8 @@ export default function BeatCard({ beat, variant = 'default', onClick }: BeatCar } }; - // Imagen por defecto si no hay cover - const defaultCover = 'data:image/svg+xml,' + encodeURIComponent(` - - - - - - `); + // Imagen por defecto si no hay cover (mismo logo que en BeatDetailPage y PlaylistDetails) + const defaultCover = logo; return (
{ // 👇 CAMBIAR AQUÍ: QUITAR /api/v1 export const getMyBeats = async (params = {}) => { try { - console.log('📡 Fetching my beats with params:', params); - console.log('🔑 Token presente:', localStorage.getItem('accessToken') ? 'SÍ' : 'NO'); - console.log('🔗 Base URL:', client.defaults.baseURL); - const { data } = await client.get('/beats/my-beats'); - console.log('📦 My beats response:', data); - console.log('📊 data.data value:', data.data); - console.log('📊 data.data length:', data.data?.length); - console.log('📊 data.data is Array?:', Array.isArray(data.data)); - console.log('📊 First beat if any:', data.data?.[0]); - if (data.success && data.data) { const beatsArray = data.data; - console.log('✅ Returning my beats count:', beatsArray.length); - console.log('✅ Returning my beats:', beatsArray); return beatsArray; } else { - console.warn('⚠️ Unexpected API response structure:', data); return data; } } catch (error) {