From 76f430775e2fbdbce759864872f514e421e3bba3 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Mon, 4 Aug 2025 20:37:56 +0000 Subject: [PATCH] Restored to 'da5c38c23546b6ac8177dac9774fb40023d30283' Replit-Restored-To: da5c38c23546b6ac8177dac9774fb40023d30283 --- .replit | 3 - client/src/components/social-share.tsx | 154 ------------------- client/src/components/video-card.tsx | 40 +---- client/src/components/video-modal.tsx | 26 ++-- client/src/pages/home.tsx | 32 ---- package-lock.json | 198 ------------------------- package.json | 3 - server/db.ts | 15 -- shared/schema.ts | 80 +--------- 9 files changed, 13 insertions(+), 538 deletions(-) delete mode 100644 client/src/components/social-share.tsx delete mode 100644 server/db.ts diff --git a/.replit b/.replit index 43f049b..adcfadc 100644 --- a/.replit +++ b/.replit @@ -37,6 +37,3 @@ author = "agent" task = "shell.exec" args = "npm run dev" waitForPort = 5000 - -[agent] -integrations = ["javascript_database==1.0.0", "javascript_log_in_with_replit==1.0.0"] diff --git a/client/src/components/social-share.tsx b/client/src/components/social-share.tsx deleted file mode 100644 index 7331942..0000000 --- a/client/src/components/social-share.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { useState } from "react"; -import { Copy, Check, Share2 } from "lucide-react"; -import { - SiX, - SiFacebook, - SiLinkedin, - SiWhatsapp, - SiTelegram, - SiReddit -} from "react-icons/si"; -import { Button } from "@/components/ui/button"; -import { type Video } from "@shared/schema"; - -interface SocialShareProps { - video: Video; - className?: string; -} - -export function SocialShare({ video, className = "" }: SocialShareProps) { - const [copied, setCopied] = useState(false); - const [shareOpen, setShareOpen] = useState(false); - - // Generate shareable URL (in production, this would be your actual domain) - const shareUrl = `${window.location.origin}/?video=${video.id}`; - const shareText = `Check out this video: ${video.title}`; - const shareTextEncoded = encodeURIComponent(shareText); - const shareUrlEncoded = encodeURIComponent(shareUrl); - - const handleCopyLink = async () => { - try { - await navigator.clipboard.writeText(shareUrl); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - } catch (err) { - console.error('Failed to copy link:', err); - } - }; - - const socialPlatforms = [ - { - name: "X", - icon: SiX, - url: `https://twitter.com/intent/tweet?text=${shareTextEncoded}&url=${shareUrlEncoded}`, - color: "hover:bg-gray-900 hover:text-white", - }, - { - name: "Facebook", - icon: SiFacebook, - url: `https://www.facebook.com/sharer/sharer.php?u=${shareUrlEncoded}`, - color: "hover:bg-blue-600 hover:text-white", - }, - { - name: "LinkedIn", - icon: SiLinkedin, - url: `https://www.linkedin.com/sharing/share-offsite/?url=${shareUrlEncoded}`, - color: "hover:bg-blue-700 hover:text-white", - }, - { - name: "WhatsApp", - icon: SiWhatsapp, - url: `https://wa.me/?text=${shareTextEncoded}%20${shareUrlEncoded}`, - color: "hover:bg-green-500 hover:text-white", - }, - { - name: "Telegram", - icon: SiTelegram, - url: `https://t.me/share/url?url=${shareUrlEncoded}&text=${shareTextEncoded}`, - color: "hover:bg-blue-400 hover:text-white", - }, - { - name: "Reddit", - icon: SiReddit, - url: `https://reddit.com/submit?url=${shareUrlEncoded}&title=${shareTextEncoded}`, - color: "hover:bg-orange-500 hover:text-white", - }, - ]; - - const handlePlatformShare = (platform: typeof socialPlatforms[0]) => { - window.open(platform.url, '_blank', 'width=600,height=400'); - }; - - return ( -
- - - {shareOpen && ( - <> - {/* Backdrop */} -
setShareOpen(false)} - /> - - {/* Share Menu */} -
-

Share this video

- - {/* Copy Link */} -
- -
- - {/* Social Platforms */} -
- {socialPlatforms.map((platform) => { - const IconComponent = platform.icon; - return ( - - ); - })} -
-
- - )} -
- ); -} \ No newline at end of file diff --git a/client/src/components/video-card.tsx b/client/src/components/video-card.tsx index c15c3a9..73d9866 100644 --- a/client/src/components/video-card.tsx +++ b/client/src/components/video-card.tsx @@ -1,6 +1,5 @@ -import { Play, Share2 } from "lucide-react"; +import { Play } from "lucide-react"; import { type Video } from "@shared/schema"; -import { Button } from "@/components/ui/button"; interface VideoCardProps { video: Video; @@ -41,30 +40,6 @@ function formatDate(date: Date | string): string { } export default function VideoCard({ video, onClick }: VideoCardProps) { - const handleShare = async (e: React.MouseEvent) => { - e.stopPropagation(); // Prevent video modal from opening - - const shareUrl = `${window.location.origin}/?video=${video.id}`; - const shareData = { - title: video.title, - text: `Check out this video: ${video.title}`, - url: shareUrl, - }; - - try { - if (navigator.share) { - // Use native share API if available (mobile devices) - await navigator.share(shareData); - } else { - // Fallback: copy to clipboard - await navigator.clipboard.writeText(shareUrl); - alert('Video link copied to clipboard!'); - } - } catch (err) { - console.error('Error sharing:', err); - } - }; - return (
- - {/* Share button */} -
- -
diff --git a/client/src/components/video-modal.tsx b/client/src/components/video-modal.tsx index 6922ba3..e27a24f 100644 --- a/client/src/components/video-modal.tsx +++ b/client/src/components/video-modal.tsx @@ -1,10 +1,9 @@ import { useEffect, useRef } from "react"; -import { X, Share2, Copy, Check } from "lucide-react"; +import { X } from "lucide-react"; import { type Video } from "@shared/schema"; import { Button } from "@/components/ui/button"; import { apiRequest } from "@/lib/queryClient"; import Hls from "hls.js"; -import { SocialShare } from "@/components/social-share"; interface VideoModalProps { video: Video | null; @@ -213,19 +212,16 @@ export default function VideoModal({ video, isOpen, onClose }: VideoModalProps) > {video.title} -
-
- - {formatViews(video.views)} - - - {formatDate(video.createdAt)} - - - {formatDuration(video.duration)} - -
- +
+ + {formatViews(video.views)} + + + {formatDate(video.createdAt)} + + + {formatDuration(video.duration)} +
{video.description && (

diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 60d58e5..af9c65e 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -3,7 +3,6 @@ import { useQuery } from "@tanstack/react-query"; import { type Video } from "@shared/schema"; import SearchHeader from "@/components/search-header"; import VideoGrid from "@/components/video-grid"; -import VideoModal from "@/components/video-modal"; interface VideosResponse { videos: Video[]; @@ -16,23 +15,6 @@ export default function Home() { const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); const [offset, setOffset] = useState(0); const [allVideos, setAllVideos] = useState([]); - const [selectedVideo, setSelectedVideo] = useState

- {/* Shared video modal - handles deep links */} - {selectedVideo && isVideoModalOpen && ( - - )} - {/* Footer */}