diff --git a/.replit b/.replit index 8826cfc..1cda342 100644 --- a/.replit +++ b/.replit @@ -50,6 +50,10 @@ externalPort = 3000 localPort = 43777 externalPort = 4200 +[[ports]] +localPort = 45921 +externalPort = 6800 + [env] PORT = "5000" diff --git a/client/src/pages/Article.tsx b/client/src/pages/Article.tsx index adb0e94..00887b8 100644 --- a/client/src/pages/Article.tsx +++ b/client/src/pages/Article.tsx @@ -5,16 +5,18 @@ import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Input } from "@/components/ui/input"; -import { TrendingUp, TrendingDown, DollarSign, Clock } from "lucide-react"; +import { TrendingUp, TrendingDown, DollarSign, Clock, IdCard } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; import { apiRequest, queryClient } from "@/lib/queryClient"; import Footer from "@/components/Footer"; -import type { Article, PredictionMarket } from "@shared/schema"; +import { useAuth } from "@/hooks/useAuth"; +import type { Article, PredictionMarket, MediaOutlet } from "@shared/schema"; export default function Article() { const [, params] = useRoute("/articles/:slug"); const [, setLocation] = useLocation(); const { toast } = useToast(); + const { user } = useAuth(); const [betAmounts, setBetAmounts] = useState>({}); const { data: article, isLoading: articleLoading } = useQuery
({ @@ -22,6 +24,11 @@ export default function Article() { enabled: !!params?.slug }); + const { data: outlet, isLoading: outletLoading } = useQuery({ + queryKey: ["/api/media-outlets", article?.mediaOutletId], + enabled: !!article?.mediaOutletId + }); + const { data: markets = [], isLoading: marketsLoading } = useQuery({ queryKey: ["/api/articles", params?.slug, "markets"], enabled: !!params?.slug @@ -106,20 +113,17 @@ export default function Article() { return parts; }; - if (articleLoading) { + if (articleLoading || outletLoading) { return (
-
- SAPIENS setLocation("/")} - /> +
+
+
+
+
@@ -158,14 +162,55 @@ export default function Article() {
-
- SAPIENS setLocation("/")} - /> +
+ {outlet?.imageUrl ? ( + {outlet.name} setLocation(`/media/${outlet.slug}`)} + data-testid="img-outlet-profile" + /> + ) : ( +
outlet && setLocation(`/media/${outlet.slug}`)} + data-testid="img-outlet-profile-fallback" + > + + {outlet?.name.charAt(0)} + +
+ )} +
setLocation("/")}> + SAPIENS + {outlet && ( +
+ + {outlet.name} + + +
+ )} +