mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
feat: optimize bundle size and improve image loading
- Unify video page components into single VideoPageContent component
- Reduces ~2300 lines of duplicated code between dashboard and watch pages
- Uses mode prop ('dashboard' | 'watch') to handle differences
- Move shadcn to devDependencies (CLI tool, not needed at runtime)
- Remove radix-ui meta-package (components already imported individually)
- Replace <img> tags with next/image for automatic optimization
- Add remotePatterns config for YouTube, Vimeo, Unsplash domains
- Update video-card.tsx, videos/new/page.tsx, component-example.tsx
- Add next/dynamic for KeyboardShortcutsModal (lazy load on demand)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useRouter, useParams } from 'next/navigation';
|
||||
import Link from 'next/link';
|
||||
import Image from 'next/image';
|
||||
import { ArrowLeft, Loader2, Link as LinkIcon, AlertCircle, CheckCircle2 } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
@@ -177,10 +178,12 @@ export default function NewVideoPage() {
|
||||
<div className="space-y-2">
|
||||
<Label>Preview</Label>
|
||||
<div className="relative aspect-video rounded-lg overflow-hidden bg-muted">
|
||||
<img
|
||||
<Image
|
||||
src={thumbnailUrl}
|
||||
alt="Video thumbnail"
|
||||
className="object-cover w-full h-full"
|
||||
fill
|
||||
sizes="(max-width: 768px) 100vw, 600px"
|
||||
className="object-cover"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user