forked from OurHike/OurHike
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrongWayCue.tsx
More file actions
46 lines (42 loc) · 1.47 KB
/
Copy pathWrongWayCue.tsx
File metadata and controls
46 lines (42 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// The in-app wrong-way cue (WIREFRAMES.md §9, beat 1).
//
// The hedge in "You may be off the trail" is deliberate. GPS under tree
// canopy is not reliable enough to justify certainty, and telling someone
// standing squarely on the trail that they are off it is precisely the false
// positive that spends this feature's entire trust budget - the cost
// HIKER_SAFETY.md singles out as mattering more here than almost anywhere
// else in the project. "May be" is the strongest claim the data supports.
//
// "Show me the way back" points; it does not route. Same position the closure
// sheet takes - OurHike does not work out detours.
export interface WrongWayCueProps {
open: boolean
distanceFt: number
minutes: number
onShowWayBack: () => void
onDismiss: () => void
}
export function WrongWayCue({
open,
distanceFt,
minutes,
onShowWayBack,
onDismiss,
}: WrongWayCueProps) {
if (!open) return null
return (
<div className="wrong-way-cue" role="alert">
<p className="wrong-way-cue__text">
{`You may be off the trail — about ${distanceFt} ft from the blazes for the last ${minutes} minutes.`}
</p>
<div className="wrong-way-cue__actions">
<button type="button" className="wrong-way-cue__primary" onClick={onShowWayBack}>
Show me the way back
</button>
<button type="button" className="wrong-way-cue__secondary" onClick={onDismiss}>
I’m fine
</button>
</div>
</div>
)
}