mirror of
https://github.com/zvx-echo6/navi.git
synced 2026-05-20 14:44:51 +02:00
fix: restore Get Directions text, fix button sizing, filter raw category labels
This commit is contained in:
parent
31d1ef07dd
commit
1afd12f1b0
2 changed files with 10 additions and 10 deletions
|
|
@ -396,7 +396,7 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
|
||||||
<div className="flex flex-col min-w-0">
|
<div className="flex flex-col min-w-0">
|
||||||
<span className="text-sm font-medium truncate" style={{ color: "var(--text-primary)" }}>{(place.raw?.name || place.name) || "Unknown place"}</span>
|
<span className="text-sm font-medium truncate" style={{ color: "var(--text-primary)" }}>{(place.raw?.name || place.name) || "Unknown place"}</span>
|
||||||
<div className="flex items-center gap-1.5 text-[11px]" style={{ color: "var(--text-tertiary)" }}>
|
<div className="flex items-center gap-1.5 text-[11px]" style={{ color: "var(--text-tertiary)" }}>
|
||||||
{place.type && !["poi", "unknown", ""].includes(place.type.toLowerCase()) && <span className="capitalize">{place.type}</span>}
|
{place.type && !place.type.includes("_") && !["poi", "unknown", "yes", "no", "other", ""].includes(place.type.toLowerCase()) && <span className="capitalize">{place.type}</span>}
|
||||||
{driveTime != null && <><span>{"\u00b7"}</span><span>{formatDriveTime(driveTime)} drive</span></>}
|
{driveTime != null && <><span>{"\u00b7"}</span><span>{formatDriveTime(driveTime)} drive</span></>}
|
||||||
{nearbyLabel && <><span>{"\u00b7"}</span><span>Near {nearbyLabel}</span></>}
|
{nearbyLabel && <><span>{"\u00b7"}</span><span>Near {nearbyLabel}</span></>}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -420,15 +420,15 @@ export function PlaceCard({ place, variant = "preview", expanded = true, onToggl
|
||||||
<div className="mt-3 pt-3 flex gap-2" style={{ borderTop: "1px solid var(--border)" }}>
|
<div className="mt-3 pt-3 flex gap-2" style={{ borderTop: "1px solid var(--border)" }}>
|
||||||
{variant === "preview" && (
|
{variant === "preview" && (
|
||||||
<>
|
<>
|
||||||
{stops.length < 2 && <button onClick={handleDirections} className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium" style={{ background: "var(--accent)", color: "var(--text-inverse)" }}><Navigation size={13} />Directions</button>}
|
{stops.length < 2 && <button onClick={handleDirections} className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium" style={{ background: "var(--accent)", color: "var(--text-inverse)" }}><Navigation size={13} />Get Directions</button>}
|
||||||
{existingStopIndex >= 0 ? (
|
{existingStopIndex >= 0 ? (
|
||||||
<span className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium" style={{ background: "var(--accent-muted)", color: "var(--accent)" }}>Stop {String.fromCharCode(65 + existingStopIndex)}</span>
|
<span className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium" style={{ background: "var(--accent-muted)", color: "var(--accent)" }}>Stop {String.fromCharCode(65 + existingStopIndex)}</span>
|
||||||
) : (
|
) : (
|
||||||
<button onClick={handleAddStop} className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }}><Plus size={13} />Add stop</button>
|
<button onClick={handleAddStop} className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }}><Plus size={13} />Add stop</button>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{variant === "stop" && onRemove && <button onClick={onRemove} className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }}><X size={13} />Remove</button>}
|
{variant === "stop" && onRemove && <button onClick={onRemove} className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium" style={{ background: "var(--tan-muted)", color: "var(--tan)", border: "1px solid var(--border)" }}><X size={13} />Remove</button>}
|
||||||
{auth.authenticated ? (
|
{auth.authenticated ? (
|
||||||
<button onClick={handleSave} className="p-2 rounded-lg" style={{ background: savedContact ? "var(--accent-muted)" : "var(--tan-muted)", color: savedContact ? "var(--accent)" : "var(--tan)", border: "1px solid var(--border)" }} aria-label={savedContact ? "Edit saved contact" : "Save place"}><Bookmark size={14} fill={savedContact ? "currentColor" : "none"} /></button>
|
<button onClick={handleSave} className="p-2 rounded-lg" style={{ background: savedContact ? "var(--accent-muted)" : "var(--tan-muted)", color: savedContact ? "var(--accent)" : "var(--tan)", border: "1px solid var(--border)" }} aria-label={savedContact ? "Edit saved contact" : "Save place"}><Bookmark size={14} fill={savedContact ? "currentColor" : "none"} /></button>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
|
|
@ -677,7 +677,7 @@ export default function PlaceDetail() {
|
||||||
{(() => {
|
{(() => {
|
||||||
const cat = placeDetails && placeDetails !== 'loading' ? placeDetails.category : null
|
const cat = placeDetails && placeDetails !== 'loading' ? placeDetails.category : null
|
||||||
const parts = []
|
const parts = []
|
||||||
if (cat && !["poi", "unknown", ""].includes(cat.toLowerCase())) parts.push(cat)
|
if (cat && !cat.includes("_") && !["poi", "unknown", "yes", "no", "other", ""].includes(cat.toLowerCase())) parts.push(cat)
|
||||||
if (nearbyLabel) parts.push(`near ${nearbyLabel}`)
|
if (nearbyLabel) parts.push(`near ${nearbyLabel}`)
|
||||||
if (driveTime != null) parts.push(formatDriveTime(driveTime))
|
if (driveTime != null) parts.push(formatDriveTime(driveTime))
|
||||||
if (parts.length === 0) return null
|
if (parts.length === 0) return null
|
||||||
|
|
@ -718,16 +718,16 @@ export default function PlaceDetail() {
|
||||||
<div className="mt-auto pt-4 flex gap-2">
|
<div className="mt-auto pt-4 flex gap-2">
|
||||||
<button
|
<button
|
||||||
onClick={handleDirections}
|
onClick={handleDirections}
|
||||||
className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium"
|
className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium"
|
||||||
style={{ background: 'var(--accent)', color: 'var(--text-inverse)' }}
|
style={{ background: 'var(--accent)', color: 'var(--text-inverse)' }}
|
||||||
>
|
>
|
||||||
<Navigation size={13} />
|
<Navigation size={13} />
|
||||||
Directions
|
Get Directions
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{existingStopIndex >= 0 ? (
|
{existingStopIndex >= 0 ? (
|
||||||
<span
|
<span
|
||||||
className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium"
|
className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium"
|
||||||
style={{ background: 'var(--accent-muted)', color: 'var(--accent)' }}
|
style={{ background: 'var(--accent-muted)', color: 'var(--accent)' }}
|
||||||
>
|
>
|
||||||
Added as stop {String.fromCharCode(65 + existingStopIndex)}
|
Added as stop {String.fromCharCode(65 + existingStopIndex)}
|
||||||
|
|
@ -735,7 +735,7 @@ export default function PlaceDetail() {
|
||||||
) : (
|
) : (
|
||||||
<button
|
<button
|
||||||
onClick={handleAddStop}
|
onClick={handleAddStop}
|
||||||
className="flex-1 flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg text-xs font-medium"
|
className="flex-1 flex items-center justify-center gap-1.5 py-1.5 px-2 rounded-lg text-[11px] font-medium"
|
||||||
style={{ background: 'var(--tan-muted)', color: 'var(--tan)', border: '1px solid var(--border)' }}
|
style={{ background: 'var(--tan-muted)', color: 'var(--tan)', border: '1px solid var(--border)' }}
|
||||||
>
|
>
|
||||||
<Plus size={13} />
|
<Plus size={13} />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue