From d2f9b7586a225684a548eccadafeafd59320baba Mon Sep 17 00:00:00 2001 From: AdityasahuX07 Date: Tue, 23 Dec 2025 15:24:02 +0530 Subject: [PATCH] Refactor SourcesModal component styling and layout Refactor QualityBadge component for improved styling and readability. Update source selection UI for better user experience. --- src/components/player/modals/SourcesModal.tsx | 191 ++++++++---------- 1 file changed, 80 insertions(+), 111 deletions(-) diff --git a/src/components/player/modals/SourcesModal.tsx b/src/components/player/modals/SourcesModal.tsx index 6bfac5d..4cef29e 100644 --- a/src/components/player/modals/SourcesModal.tsx +++ b/src/components/player/modals/SourcesModal.tsx @@ -22,41 +22,29 @@ const QualityBadge = ({ quality }: { quality: string | null }) => { if (!quality) return null; const qualityNum = parseInt(quality); - let color = '#8B5CF6'; // Default purple + let color = '#8B5CF6'; let label = `${quality}p`; if (qualityNum >= 2160) { - color = '#F59E0B'; // Gold for 4K + color = '#F59E0B'; label = '4K'; } else if (qualityNum >= 1080) { - color = '#EF4444'; // Red for 1080p - label = 'FHD'; + color = '#3B82F6'; + label = '1080p'; } else if (qualityNum >= 720) { - color = '#10B981'; // Green for 720p - label = 'HD'; + color = '#10B981'; + label = '720p'; } return ( - - - {label} - + + {label} ); }; @@ -97,9 +85,18 @@ export const SourcesModal: React.FC = ({ }; return ( - - - + + {/* Backdrop */} + + = ({ borderColor: 'rgba(255,255,255,0.1)', }} > - - - Change Source - + {/* Header */} + + + Change Source + {isChangingSource && ( - + Switching source... @@ -149,14 +149,15 @@ export const SourcesModal: React.FC = ({ {sortedProviders.length > 0 ? ( sortedProviders.map(([providerId, providerData]) => ( - + {providerData.addonName} ({providerData.streams.length}) @@ -170,12 +171,12 @@ export const SourcesModal: React.FC = ({ handleStreamSelect(stream)} activeOpacity={0.7} @@ -183,60 +184,46 @@ export const SourcesModal: React.FC = ({ > - + + }} numberOfLines={1}> {stream.title || stream.name || `Stream ${index + 1}`} - {quality && } + {(stream.size || stream.lang) && ( - + {stream.size && ( - - - - {(stream.size / (1024 * 1024 * 1024)).toFixed(1)} GB - - + + {(stream.size / (1024 * 1024 * 1024)).toFixed(1)} GB + )} {stream.lang && ( - - - - {stream.lang.toUpperCase()} - - + + {stream.lang.toUpperCase()} + )} )} - + {isSelected ? ( - + ) : ( - + )} @@ -247,28 +234,10 @@ export const SourcesModal: React.FC = ({ )) ) : ( - - - - No sources available - - - Try searching for different content + + + + No sources found )} @@ -276,4 +245,4 @@ export const SourcesModal: React.FC = ({ ); -}; \ No newline at end of file +};