Remove view-all links and preserve manual map zoom
This commit is contained in:
@@ -2131,12 +2131,6 @@
|
|||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.root :global(.home-summary-card-head span) {
|
|
||||||
color: #60a5fa;
|
|
||||||
font-size: 10px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root :global(.home-summary-card-body) {
|
.root :global(.home-summary-card-body) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
@@ -2197,13 +2191,6 @@
|
|||||||
line-height: 1.25;
|
line-height: 1.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
.root :global(.opportunity-view-all) {
|
|
||||||
color: #60a5fa;
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root :global(.opportunity-card-grid) {
|
.root :global(.opportunity-card-grid) {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||||
|
|||||||
@@ -1153,7 +1153,6 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) {
|
|||||||
<div key={card.key} className="home-summary-card">
|
<div key={card.key} className="home-summary-card">
|
||||||
<div className="home-summary-card-head">
|
<div className="home-summary-card-head">
|
||||||
<strong>{card.title}</strong>
|
<strong>{card.title}</strong>
|
||||||
<span>{locale === "en-US" ? "View all" : "查看全部"}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="home-summary-card-body">
|
<div className="home-summary-card-body">
|
||||||
{card.items.map((item) => (
|
{card.items.map((item) => (
|
||||||
@@ -1189,9 +1188,6 @@ function OpportunityStrip({ snapshots }: { snapshots: CitySnapshot[] }) {
|
|||||||
: "当前市场问题 · YES/NO 价格 · Edge · 小趋势线"}
|
: "当前市场问题 · YES/NO 价格 · Edge · 小趋势线"}
|
||||||
</strong>
|
</strong>
|
||||||
</div>
|
</div>
|
||||||
<Link href="/docs/intraday-signal" className="opportunity-view-all">
|
|
||||||
{locale === "en-US" ? "View all" : "查看全部"}
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
{items.length > 0 ? (
|
{items.length > 0 ? (
|
||||||
<div className="opportunity-card-grid top-opportunities">
|
<div className="opportunity-card-grid top-opportunities">
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const AUTO_NEARBY_MIN_ZOOM = 8;
|
|||||||
const AUTO_NEARBY_MAX_DISTANCE_M = 120000;
|
const AUTO_NEARBY_MAX_DISTANCE_M = 120000;
|
||||||
const AUTO_NEARBY_IDLE_REFRESH_DELAY_MS = 10_000;
|
const AUTO_NEARBY_IDLE_REFRESH_DELAY_MS = 10_000;
|
||||||
const AUTO_NEARBY_MIN_REFRESH_INTERVAL_MS = 60_000;
|
const AUTO_NEARBY_MIN_REFRESH_INTERVAL_MS = 60_000;
|
||||||
|
const USER_CAMERA_OVERRIDE_MS = 10 * 60_000;
|
||||||
const MAP_MAX_ZOOM = 19;
|
const MAP_MAX_ZOOM = 19;
|
||||||
const MAP_TILE_URLS = {
|
const MAP_TILE_URLS = {
|
||||||
dark: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
|
dark: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
|
||||||
@@ -405,6 +406,8 @@ export function useLeafletMap({
|
|||||||
const loadingAutoNearbyRef = useRef(false);
|
const loadingAutoNearbyRef = useRef(false);
|
||||||
const handlingAutoNearbyRef = useRef(false);
|
const handlingAutoNearbyRef = useRef(false);
|
||||||
const lastMovedCityRef = useRef<string | null>(null);
|
const lastMovedCityRef = useRef<string | null>(null);
|
||||||
|
const lastCameraSelectionRef = useRef<string | null>(null);
|
||||||
|
const lastUserCameraInteractionAtRef = useRef(0);
|
||||||
const suspendMotionRef = useRef(suspendMotion);
|
const suspendMotionRef = useRef(suspendMotion);
|
||||||
const hasFittedInitialBoundsRef = useRef(false);
|
const hasFittedInitialBoundsRef = useRef(false);
|
||||||
const onClosePanelRef = useRef(onClosePanel);
|
const onClosePanelRef = useRef(onClosePanel);
|
||||||
@@ -482,6 +485,7 @@ export function useLeafletMap({
|
|||||||
map.on("click", handleMapClick);
|
map.on("click", handleMapClick);
|
||||||
|
|
||||||
const markInteracting = () => {
|
const markInteracting = () => {
|
||||||
|
lastUserCameraInteractionAtRef.current = Date.now();
|
||||||
if (interactionIdleTimerRef.current) {
|
if (interactionIdleTimerRef.current) {
|
||||||
clearTimeout(interactionIdleTimerRef.current);
|
clearTimeout(interactionIdleTimerRef.current);
|
||||||
interactionIdleTimerRef.current = null;
|
interactionIdleTimerRef.current = null;
|
||||||
@@ -887,6 +891,7 @@ export function useLeafletMap({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!selectedCity) {
|
if (!selectedCity) {
|
||||||
lastMovedCityRef.current = null;
|
lastMovedCityRef.current = null;
|
||||||
|
lastCameraSelectionRef.current = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,6 +908,17 @@ export function useLeafletMap({
|
|||||||
const entry = markersRef.current[selectedCity];
|
const entry = markersRef.current[selectedCity];
|
||||||
if (!entry) return;
|
if (!entry) return;
|
||||||
|
|
||||||
|
const selectionChanged = lastCameraSelectionRef.current !== selectedCity;
|
||||||
|
lastCameraSelectionRef.current = selectedCity;
|
||||||
|
|
||||||
|
if (
|
||||||
|
!selectionChanged &&
|
||||||
|
Date.now() - lastUserCameraInteractionAtRef.current < USER_CAMERA_OVERRIDE_MS
|
||||||
|
) {
|
||||||
|
lastMovedCityRef.current = selectedCity;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Lock the move
|
// Lock the move
|
||||||
lastMovedCityRef.current = selectedCity;
|
lastMovedCityRef.current = selectedCity;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user