diff --git a/.replit b/.replit index e53b196..f0f9acb 100644 --- a/.replit +++ b/.replit @@ -18,6 +18,10 @@ externalPort = 80 localPort = 34047 externalPort = 3002 +[[ports]] +localPort = 35303 +externalPort = 4200 + [[ports]] localPort = 37531 externalPort = 3001 diff --git a/attached_assets/chayan asli slides_1759213492580.pptx b/attached_assets/chayan asli slides_1759213492580.pptx new file mode 100644 index 0000000..61751a0 Binary files /dev/null and b/attached_assets/chayan asli slides_1759213492580.pptx differ diff --git a/client/src/pages/MediaOutlet.tsx b/client/src/pages/MediaOutlet.tsx index 5f2ce07..edf5cbd 100644 --- a/client/src/pages/MediaOutlet.tsx +++ b/client/src/pages/MediaOutlet.tsx @@ -1,22 +1,20 @@ import { useState } from "react"; -import { useQuery, useMutation } from "@tanstack/react-query"; +import { useQuery } from "@tanstack/react-query"; import { useRoute, useLocation } from "wouter"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card, CardContent } from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; -import { Textarea } from "@/components/ui/textarea"; -import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog"; +import { Dialog, DialogContent } from "@/components/ui/dialog"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip"; -import { Gavel, Clock, TrendingUp, Search, Settings, User, LogOut, Grid, List, Edit, Info } from "lucide-react"; +import { Search, Settings, User, LogOut, Grid, List, Info } from "lucide-react"; import { useAuth } from "@/hooks/useAuth"; import { useToast } from "@/hooks/use-toast"; -import { queryClient, apiRequest } from "@/lib/queryClient"; +import { queryClient } from "@/lib/queryClient"; import ArticleCard from "@/components/ArticleCard"; import Footer from "@/components/Footer"; import LoginModal from "@/components/LoginModal"; import SearchModal from "@/components/SearchModal"; -import type { MediaOutlet, Article, Auction } from "@shared/schema"; +import type { MediaOutlet, Article } from "@shared/schema"; export default function MediaOutlet() { const [, params] = useRoute("/media/:slug"); @@ -24,10 +22,7 @@ export default function MediaOutlet() { const [viewMode, setViewMode] = useState<"grid" | "list">("grid"); const [isLoginModalOpen, setIsLoginModalOpen] = useState(false); const [isSearchModalOpen, setIsSearchModalOpen] = useState(false); - const [isEditDescModalOpen, setIsEditDescModalOpen] = useState(false); const [enlargedImage, setEnlargedImage] = useState(null); - const [newDescription, setNewDescription] = useState(""); - const [alternativeDescription, setAlternativeDescription] = useState("Partner at Type3 Capital and Non-Executive Director at TrueFi DAO with a strong background in fund management, venture capital, and digital assets"); const { user, isAuthenticated } = useAuth(); const { toast } = useToast(); @@ -41,11 +36,6 @@ export default function MediaOutlet() { enabled: !!params?.slug }); - const { data: auction, isLoading: auctionLoading } = useQuery({ - queryKey: ["/api/media-outlets", params?.slug, "auction"], - enabled: !!params?.slug - }); - const handleLogout = async () => { try { const response = await fetch("/api/logout", { @@ -74,60 +64,6 @@ export default function MediaOutlet() { setLocation("/admin"); }; - const updateDescriptionMutation = useMutation({ - mutationFn: async (description: string) => { - await apiRequest("PATCH", `/api/media-outlets/${params?.slug}`, { description }); - }, - onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ["/api/media-outlets", params?.slug] }); - toast({ - title: "Success", - description: "Description updated successfully", - }); - setIsEditDescModalOpen(false); - }, - onError: () => { - toast({ - title: "Error", - description: "Failed to update description", - variant: "destructive", - }); - }, - }); - - const handleEditDescription = () => { - setNewDescription(outlet?.description || ""); - setIsEditDescModalOpen(true); - }; - - const handleSaveDescription = (useAlternative: boolean = false) => { - const descToSave = useAlternative ? alternativeDescription : newDescription; - updateDescriptionMutation.mutate(descToSave); - }; - - const formatCurrency = (amount: string | null) => { - if (!amount) return "$0"; - return new Intl.NumberFormat('en-US', { - style: 'currency', - currency: 'USD' - }).format(parseFloat(amount)); - }; - - const formatTimeRemaining = (endDate: Date | string) => { - const end = new Date(endDate); - const now = new Date(); - const diff = end.getTime() - now.getTime(); - - if (diff <= 0) return "Auction Ended"; - - const days = Math.floor(diff / (1000 * 60 * 60 * 24)); - const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); - - if (days > 0) return `${days}d ${hours}h remaining`; - if (hours > 0) return `${hours}h remaining`; - return "Less than 1h remaining"; - }; - if (outletLoading) { return (
@@ -381,129 +317,6 @@ export default function MediaOutlet() {
- {/* Outlet Header */} -
-
- {outlet.imageUrl ? ( - {outlet.name} setEnlargedImage(outlet.imageUrl!)} - data-testid="image-outlet-profile" - /> - ) : ( -
- - {outlet.name.charAt(0)} - -
- )} - -
-
-

{outlet.name}

- - - {outlet.category} - -
-
-

{outlet.description}

- {user && (user.role === 'admin' || user.role === 'superadmin') && ( - - )} -
- {outlet.tags && outlet.tags.length > 0 && ( -
- {outlet.tags.map((tag) => ( - - {tag} - - ))} -
- )} - - {/* Auction Section */} - {!auctionLoading && auction ? ( - - -
-
-
- - Management Rights Auction -
-
- - Current Highest Bid: {formatCurrency(auction.currentBid)} -
-
- - {formatTimeRemaining(auction.endDate)} -
-
- -
-
-
- ) : !auctionLoading && !auction ? ( - - -
-
- - No active auction currently -
- -
-
-
- ) : ( - - -
-
-
-
-
-
-
-
- )} -
-
-
- {/* Articles Section */}
@@ -612,63 +425,6 @@ export default function MediaOutlet() { )} - - {/* Edit Description Modal */} - - - - Edit Description - - Update the description for {outlet?.name} - - -
-
- -