mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-05 03:02:56 +00:00
dev day #89
This commit is contained in:
@@ -28,6 +28,7 @@ import { getCachedYouTube, YouTubeVideo } from '../services/youtube';
|
||||
import { FaPlay, FaExternalLinkAlt, FaYoutube } from 'react-icons/fa';
|
||||
import NewsletterCTA from '../components/common/NewsletterCTA';
|
||||
import CommentsSection from '../components/comments/CommentsSection';
|
||||
import { Helmet } from 'react-helmet-async';
|
||||
|
||||
type RenderItem = {
|
||||
key: string;
|
||||
@@ -79,6 +80,7 @@ const VideosPage: React.FC = () => {
|
||||
|
||||
const source = settings?.videos_source || 'auto';
|
||||
const youtubeUrl = (settings as any)?.youtube_url || (settings as any)?.social_youtube || null;
|
||||
const titleOverrides: Record<string, string> = (settings as any)?.videos_title_overrides || {};
|
||||
|
||||
useEffect(() => {
|
||||
let canceled = false;
|
||||
@@ -113,7 +115,7 @@ const VideosPage: React.FC = () => {
|
||||
if (source === 'auto') {
|
||||
return (yt || []).map((v) => ({
|
||||
key: v.video_id,
|
||||
title: v.title,
|
||||
title: (titleOverrides?.[v.video_id]?.trim()) || v.title,
|
||||
embedUrl: toEmbed(v.video_id),
|
||||
thumbnail: v.thumbnail_url,
|
||||
date: v.published_date,
|
||||
@@ -142,7 +144,7 @@ const VideosPage: React.FC = () => {
|
||||
};
|
||||
});
|
||||
return manual.length ? manual : legacy;
|
||||
}, [source, yt, settings?.videos_items, settings]);
|
||||
}, [source, yt, settings?.videos_items, settings, titleOverrides]);
|
||||
|
||||
const openVideo = (item: RenderItem) => {
|
||||
setSelectedVideo(item);
|
||||
@@ -267,6 +269,10 @@ const VideosPage: React.FC = () => {
|
||||
|
||||
return (
|
||||
<MainLayout>
|
||||
<Helmet>
|
||||
<title>Videa</title>
|
||||
<meta name="description" content="Sledujte naše nejnovější videa a zápasy." />
|
||||
</Helmet>
|
||||
<Container maxW="7xl" py={{ base: 6, md: 10 }}>
|
||||
<Box mb={6}>
|
||||
<HStack justify="space-between" mb={2} flexWrap="wrap">
|
||||
|
||||
Reference in New Issue
Block a user