2026-01-07 09:31:02 +00:00
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
|
import { Card } from '../ui/card';
|
|
|
|
|
import { Button } from '../ui/button';
|
|
|
|
|
import { TrendingUp, Users, Hash, MoreHorizontal, Play } from 'lucide-react';
|
feat: Visual masterpiece - true light mode & premium UI
🎨 **True Light/Dark Mode**
- Implemented proper light mode with inverted color scheme
- Smooth theme transitions (0.3s ease)
- Light mode colors: white backgrounds, dark text, vibrant accents
- System theme detection with proper class application
🌈 **Enhanced Theme System**
- 4 color themes work in both light and dark modes
- Cyber (cyan/magenta), Ocean (blue/teal), Forest (green/lime), Sunset (orange/purple)
- Theme-specific glassmorphism effects
- Proper contrast in light mode
✨ **Premium Animations**
- Float, glow-pulse, slide-in, scale-in, rotate-in animations
- Smooth page transitions
- Hover effects with depth (lift, glow, scale)
- Micro-interactions on all interactive elements
🎯 **Visual Polish**
- Enhanced glassmorphism for light/dark modes
- Custom scrollbar with theme colors
- Beautiful text selection
- Focus indicators for accessibility
- Premium utility classes
🔧 **Technical Improvements**
- Updated UIStore to properly apply light/dark classes
- Added data-theme attribute for CSS targeting
- Smooth scroll behavior
- Optimized transitions
The app is now a visual masterpiece with perfect light/dark mode support!
2026-01-11 01:32:21 +00:00
|
|
|
import { trackService } from '@/services/trackService';
|
|
|
|
|
import { useToast } from '@/context/ToastContext';
|
|
|
|
|
import { useAudio } from '@/context/AudioContext';
|
|
|
|
|
import { Track } from '@/types/api';
|
2026-01-07 09:31:02 +00:00
|
|
|
import { logger } from '@/utils/logger';
|
|
|
|
|
|
|
|
|
|
interface SocialViewProps {
|
2026-01-13 18:47:57 +00:00
|
|
|
onViewProfile: (userId: string | null) => void;
|
2026-01-07 09:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const SocialView: React.FC<SocialViewProps> = ({ onViewProfile }) => {
|
2026-01-13 18:47:57 +00:00
|
|
|
const { addToast: _addToast } = useToast();
|
|
|
|
|
const { playTrack } = useAudio();
|
|
|
|
|
const [activeTab, setActiveTab] = useState('feed');
|
|
|
|
|
const [feedTracks, setFeedTracks] = useState<Track[]>([]);
|
|
|
|
|
const [loading, setLoading] = useState(true);
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
const loadFeed = async () => {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
try {
|
|
|
|
|
// Using recent tracks as the "Feed"
|
|
|
|
|
const res = await trackService.list({
|
|
|
|
|
limit: 10,
|
|
|
|
|
sort_by: 'created_at',
|
|
|
|
|
});
|
|
|
|
|
setFeedTracks(res.tracks);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
logger.error('Error loading feed tracks', {
|
|
|
|
|
error: e instanceof Error ? e.message : String(e),
|
|
|
|
|
stack: e instanceof Error ? e.stack : undefined,
|
|
|
|
|
});
|
|
|
|
|
} finally {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
loadFeed();
|
|
|
|
|
}, []);
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
return (
|
aesthetic-improvements: apply design direction to pages batch 3 (Action 11.5.1.5)
- Pages: Updated remaining spacing issues (p-6 → p-8, space-y-6 → space-y-8, gap-6 → gap-8)
- DashboardPage, DeveloperPage, GearPage, DesignSystemDemoPage, MarketplaceHome
- Views: Updated spacing (space-y-6 → space-y-8, gap-6 → gap-8, p-6 → p-8)
- FileManagerView, NotificationsView, SocialView, FileDetailsView, UploadView, MarketplaceView, GearView, LiveView, ProfileView
- Action 11.5.1.5: Apply direction to all pages - Batch 3 complete (5 pages + 9 views = 14 files)
2026-01-16 11:00:50 +00:00
|
|
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 animate-fadeIn pb-20">
|
2026-01-13 18:47:57 +00:00
|
|
|
{/* Sidebar */}
|
aesthetic-improvements: apply design direction to pages batch 3 (Action 11.5.1.5)
- Pages: Updated remaining spacing issues (p-6 → p-8, space-y-6 → space-y-8, gap-6 → gap-8)
- DashboardPage, DeveloperPage, GearPage, DesignSystemDemoPage, MarketplaceHome
- Views: Updated spacing (space-y-6 → space-y-8, gap-6 → gap-8, p-6 → p-8)
- FileManagerView, NotificationsView, SocialView, FileDetailsView, UploadView, MarketplaceView, GearView, LiveView, ProfileView
- Action 11.5.1.5: Apply direction to all pages - Batch 3 complete (5 pages + 9 views = 14 files)
2026-01-16 11:00:50 +00:00
|
|
|
<div className="hidden lg:block lg:col-span-3 space-y-8">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Card variant="glass" className="p-0 overflow-hidden">
|
|
|
|
|
<div className="h-20 bg-gradient-gaming"></div>
|
|
|
|
|
<div className="px-4 pb-4">
|
|
|
|
|
<div
|
|
|
|
|
className="relative -mt-10 mb-3 cursor-pointer"
|
|
|
|
|
onClick={() => onViewProfile(null)}
|
|
|
|
|
>
|
|
|
|
|
<div className="w-20 h-20 rounded-full border-4 border-kodo-graphite overflow-hidden bg-black">
|
|
|
|
|
<img
|
|
|
|
|
src="https://picsum.photos/id/237/200/200"
|
|
|
|
|
className="w-full h-full object-cover"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<h3 className="font-bold text-white text-lg">My Profile</h3>
|
2026-01-16 00:45:00 +00:00
|
|
|
<p className="text-sm text-kodo-content-dim mb-4">View your stats</p>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</Card>
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
<Card variant="default" className="p-2">
|
|
|
|
|
<nav className="space-y-1">
|
consistency: replace custom buttons with Button component (partial)
- Replaced custom button implementations with Button component in 14 files
- Files updated: LiveStreamDetailView, DashboardPage, CommentItem, PostCard, SocialPage, SocialView, AdminUsersView, UserTableRow, ProjectsManager, CloudFileBrowser, FileManagerView, CreatorModal, ImageCropper, BulkUploadModal
- ~31 buttons replaced across high-priority files
- Used appropriate Button variants: ghost, outline, default, secondary, link
- Preserved visual appearance with className overrides where needed
- Action 9.2.1.2 in progress (partial completion)
2026-01-16 01:06:14 +00:00
|
|
|
<Button
|
|
|
|
|
variant={activeTab === 'feed' ? 'outline' : 'ghost'}
|
|
|
|
|
size="sm"
|
|
|
|
|
className="w-full justify-start"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() => setActiveTab('feed')}
|
|
|
|
|
>
|
|
|
|
|
<TrendingUp className="w-4 h-4" /> Fresh Tracks
|
consistency: replace custom buttons with Button component (partial)
- Replaced custom button implementations with Button component in 14 files
- Files updated: LiveStreamDetailView, DashboardPage, CommentItem, PostCard, SocialPage, SocialView, AdminUsersView, UserTableRow, ProjectsManager, CloudFileBrowser, FileManagerView, CreatorModal, ImageCropper, BulkUploadModal
- ~31 buttons replaced across high-priority files
- Used appropriate Button variants: ghost, outline, default, secondary, link
- Preserved visual appearance with className overrides where needed
- Action 9.2.1.2 in progress (partial completion)
2026-01-16 01:06:14 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button variant="ghost" size="sm" className="w-full justify-start">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Users className="w-4 h-4" /> Communities
|
consistency: replace custom buttons with Button component (partial)
- Replaced custom button implementations with Button component in 14 files
- Files updated: LiveStreamDetailView, DashboardPage, CommentItem, PostCard, SocialPage, SocialView, AdminUsersView, UserTableRow, ProjectsManager, CloudFileBrowser, FileManagerView, CreatorModal, ImageCropper, BulkUploadModal
- ~31 buttons replaced across high-priority files
- Used appropriate Button variants: ghost, outline, default, secondary, link
- Preserved visual appearance with className overrides where needed
- Action 9.2.1.2 in progress (partial completion)
2026-01-16 01:06:14 +00:00
|
|
|
</Button>
|
2026-01-13 18:47:57 +00:00
|
|
|
</nav>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{/* Feed Content */}
|
aesthetic-improvements: apply design direction to pages batch 3 (Action 11.5.1.5)
- Pages: Updated remaining spacing issues (p-6 → p-8, space-y-6 → space-y-8, gap-6 → gap-8)
- DashboardPage, DeveloperPage, GearPage, DesignSystemDemoPage, MarketplaceHome
- Views: Updated spacing (space-y-6 → space-y-8, gap-6 → gap-8, p-6 → p-8)
- FileManagerView, NotificationsView, SocialView, FileDetailsView, UploadView, MarketplaceView, GearView, LiveView, ProfileView
- Action 11.5.1.5: Apply direction to all pages - Batch 3 complete (5 pages + 9 views = 14 files)
2026-01-16 11:00:50 +00:00
|
|
|
<div className="col-span-1 lg:col-span-6 space-y-8">
|
2026-01-13 18:47:57 +00:00
|
|
|
<div className="mb-4">
|
|
|
|
|
<h2 className="text-2xl font-bold text-white mb-1">Community Feed</h2>
|
2026-01-16 00:45:00 +00:00
|
|
|
<p className="text-kodo-content-dim text-xs">New uploads from the network</p>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{loading ? (
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="text-center py-12">Loading feed...</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
) : (
|
|
|
|
|
feedTracks.map((track) => (
|
|
|
|
|
<Card
|
|
|
|
|
key={track.id}
|
|
|
|
|
variant="default"
|
|
|
|
|
className="p-0 overflow-hidden mb-4 border-transparent hover:border-kodo-steel/50"
|
|
|
|
|
>
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="p-4 flex items-center gap-4">
|
2026-01-16 00:45:00 +00:00
|
|
|
<div className="w-10 h-10 rounded-full bg-kodo-steel overflow-hidden">
|
2026-01-13 18:47:57 +00:00
|
|
|
<img
|
|
|
|
|
src={track.coverUrl}
|
|
|
|
|
className="w-full h-full object-cover"
|
|
|
|
|
/>
|
2026-01-07 09:31:02 +00:00
|
|
|
</div>
|
2026-01-13 18:47:57 +00:00
|
|
|
<div>
|
|
|
|
|
<div className="font-bold text-white text-sm">
|
|
|
|
|
{track.artist}
|
|
|
|
|
</div>
|
2026-01-16 00:45:00 +00:00
|
|
|
<div className="text-xs text-kodo-content-dim">
|
2026-01-13 18:47:57 +00:00
|
|
|
uploaded a new track
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<Button variant="ghost" size="sm" className="ml-auto">
|
|
|
|
|
<MoreHorizontal className="w-4 h-4" />
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{/* Track Embed Look */}
|
|
|
|
|
<div className="px-4 pb-4">
|
|
|
|
|
<div
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
className="bg-kodo-ink p-4 rounded-xl flex items-center gap-4 border border-kodo-steel group cursor-pointer"
|
2026-01-13 18:47:57 +00:00
|
|
|
onClick={() => playTrack(track)}
|
|
|
|
|
>
|
|
|
|
|
<div className="w-16 h-16 rounded overflow-hidden relative">
|
|
|
|
|
<img
|
|
|
|
|
src={track.coverUrl}
|
|
|
|
|
className="w-full h-full object-cover"
|
|
|
|
|
/>
|
|
|
|
|
<div className="absolute inset-0 bg-black/30 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity">
|
|
|
|
|
<Play className="w-6 h-6 text-white fill-current" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex-1">
|
|
|
|
|
<h4 className="font-bold text-white">{track.title}</h4>
|
2026-01-16 00:45:00 +00:00
|
|
|
<p className="text-xs text-kodo-content-dim">
|
2026-01-13 18:47:57 +00:00
|
|
|
{track.genre || 'Electronic'}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-01-16 00:45:00 +00:00
|
|
|
<div className="text-xs text-kodo-content-dim font-mono pr-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
{track.duration}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-01-07 09:31:02 +00:00
|
|
|
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="px-4 py-4 border-t border-kodo-steel/30 flex gap-4 text-xs text-kodo-content-dim">
|
consistency: replace custom buttons with Button component (partial)
- Replaced custom button implementations with Button component in 14 files
- Files updated: LiveStreamDetailView, DashboardPage, CommentItem, PostCard, SocialPage, SocialView, AdminUsersView, UserTableRow, ProjectsManager, CloudFileBrowser, FileManagerView, CreatorModal, ImageCropper, BulkUploadModal
- ~31 buttons replaced across high-priority files
- Used appropriate Button variants: ghost, outline, default, secondary, link
- Preserved visual appearance with className overrides where needed
- Action 9.2.1.2 in progress (partial completion)
2026-01-16 01:06:14 +00:00
|
|
|
<Button variant="ghost" size="sm" className="text-xs h-auto py-0">
|
2026-01-13 18:47:57 +00:00
|
|
|
Like ({track.like_count})
|
consistency: replace custom buttons with Button component (partial)
- Replaced custom button implementations with Button component in 14 files
- Files updated: LiveStreamDetailView, DashboardPage, CommentItem, PostCard, SocialPage, SocialView, AdminUsersView, UserTableRow, ProjectsManager, CloudFileBrowser, FileManagerView, CreatorModal, ImageCropper, BulkUploadModal
- ~31 buttons replaced across high-priority files
- Used appropriate Button variants: ghost, outline, default, secondary, link
- Preserved visual appearance with className overrides where needed
- Action 9.2.1.2 in progress (partial completion)
2026-01-16 01:06:14 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button variant="ghost" size="sm" className="text-xs h-auto py-0">
|
|
|
|
|
Comment
|
|
|
|
|
</Button>
|
|
|
|
|
<Button variant="ghost" size="sm" className="text-xs h-auto py-0">
|
|
|
|
|
Share
|
|
|
|
|
</Button>
|
2026-01-13 18:47:57 +00:00
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
))
|
|
|
|
|
)}
|
2026-01-07 09:31:02 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{feedTracks.length === 0 && !loading && (
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="text-center py-24 text-kodo-content-dim">
|
2026-01-13 18:47:57 +00:00
|
|
|
No recent activity.
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2026-01-07 18:39:21 +00:00
|
|
|
|
2026-01-13 18:47:57 +00:00
|
|
|
{/* Right Sidebar */}
|
aesthetic-improvements: apply design direction to pages batch 3 (Action 11.5.1.5)
- Pages: Updated remaining spacing issues (p-6 → p-8, space-y-6 → space-y-8, gap-6 → gap-8)
- DashboardPage, DeveloperPage, GearPage, DesignSystemDemoPage, MarketplaceHome
- Views: Updated spacing (space-y-6 → space-y-8, gap-6 → gap-8, p-6 → p-8)
- FileManagerView, NotificationsView, SocialView, FileDetailsView, UploadView, MarketplaceView, GearView, LiveView, ProfileView
- Action 11.5.1.5: Apply direction to all pages - Batch 3 complete (5 pages + 9 views = 14 files)
2026-01-16 11:00:50 +00:00
|
|
|
<div className="hidden lg:block lg:col-span-3 space-y-8">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Card variant="manga">
|
2026-01-16 00:45:00 +00:00
|
|
|
<h3 className="font-bold text-sm text-kodo-text-main uppercase tracking-wider mb-4 flex items-center gap-2">
|
2026-01-13 18:47:57 +00:00
|
|
|
<Hash className="w-4 h-4 text-kodo-magenta" /> Trending Tags
|
|
|
|
|
</h3>
|
|
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
|
|
{['#Techno', '#Synthwave', '#NewGear', '#Tutorial'].map((t) => (
|
|
|
|
|
<span
|
|
|
|
|
key={t}
|
2026-01-16 00:45:00 +00:00
|
|
|
className="text-xs bg-black/20 px-2 py-1 rounded text-kodo-content-dim cursor-pointer hover:text-white hover:bg-black/40"
|
2026-01-13 18:47:57 +00:00
|
|
|
>
|
|
|
|
|
{t}
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2026-01-07 09:31:02 +00:00
|
|
|
};
|