移除天气市场新闻面板,市场列支持点击跳转 Polymarket
删除 WeatherNewsPanel 组件。GroupedMarketTable 市场价格列支持 ExternalLink 跳转到 Polymarket。城市数据去重,每城只保留排名最高的合约。
This commit is contained in:
@@ -886,8 +886,17 @@ function PolyWeatherTerminal({
|
|||||||
}, [isEn]);
|
}, [isEn]);
|
||||||
|
|
||||||
const filteredRegionRows = useMemo(() => {
|
const filteredRegionRows = useMemo(() => {
|
||||||
if (selectedRegionKey === "all") return rows;
|
const byRegion = selectedRegionKey === "all"
|
||||||
return rows.filter((row) => String(row.trading_region).toLowerCase() === selectedRegionKey);
|
? rows
|
||||||
|
: rows.filter((row) => String(row.trading_region).toLowerCase() === selectedRegionKey);
|
||||||
|
// Deduplicate: one row per city, keep the first (highest score from sorting)
|
||||||
|
const seen = new Set<string>();
|
||||||
|
return byRegion.filter((row) => {
|
||||||
|
const key = (row.city || "").toLowerCase();
|
||||||
|
if (seen.has(key)) return false;
|
||||||
|
seen.add(key);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}, [rows, selectedRegionKey]);
|
}, [rows, selectedRegionKey]);
|
||||||
|
|
||||||
const watchRows = useMemo(() => {
|
const watchRows = useMemo(() => {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { Fragment, useState } from "react";
|
import { Fragment, useState } from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { ChevronDown, ChevronRight } from "lucide-react";
|
import { ChevronDown, ChevronRight, ExternalLink } from "lucide-react";
|
||||||
import type { ScanOpportunityRow } from "@/lib/dashboard-types";
|
import type { ScanOpportunityRow } from "@/lib/dashboard-types";
|
||||||
import {
|
import {
|
||||||
type ContinentGroup,
|
type ContinentGroup,
|
||||||
@@ -125,7 +125,21 @@ export function GroupedMarketTable({
|
|||||||
{temp(row.signed_gap ?? row.gap_to_target, row.temp_symbol)}
|
{temp(row.signed_gap ?? row.gap_to_target, row.temp_symbol)}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-2 py-1.5 text-right font-mono">
|
<td className="px-2 py-1.5 text-right font-mono">
|
||||||
{formatPrice(row.midpoint, row.ask, row.bid)}
|
{row.market_url ? (
|
||||||
|
<a
|
||||||
|
href={row.market_url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
className="inline-flex items-center gap-0.5 text-blue-600 hover:text-blue-800 hover:underline"
|
||||||
|
title={row.market_question || "Polymarket"}
|
||||||
|
>
|
||||||
|
{formatPrice(row.midpoint, row.ask, row.bid)}
|
||||||
|
<ExternalLink size={10} />
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
formatPrice(row.midpoint, row.ask, row.bid)
|
||||||
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td className={clsx("px-2 py-1.5 text-right font-mono font-bold", edgeClass(row.edge_percent))}>
|
<td className={clsx("px-2 py-1.5 text-right font-mono font-bold", edgeClass(row.edge_percent))}>
|
||||||
{pct(row.edge_percent)}
|
{pct(row.edge_percent)}
|
||||||
|
|||||||
@@ -27,9 +27,6 @@ export function Panel({
|
|||||||
</h2>
|
</h2>
|
||||||
<div className="flex items-center gap-1.5">
|
<div className="flex items-center gap-1.5">
|
||||||
{actions}
|
{actions}
|
||||||
<span className="grid h-5 w-5 cursor-pointer place-items-center rounded border border-slate-300 bg-white text-[9px] text-slate-500 hover:bg-slate-50">
|
|
||||||
↗
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 min-h-0 overflow-auto">
|
<div className="flex-1 min-h-0 overflow-auto">
|
||||||
|
|||||||
Reference in New Issue
Block a user