@@ -86,10 +86,8 @@ function RoutePage() {
86
86
) ;
87
87
}
88
88
} , [ ] ) ;
89
-
90
89
useEffect ( ( ) => {
91
90
if ( pointsOfInterest ) {
92
- console . log ( pointsOfInterest ) ;
93
91
setLatitude ( pointsOfInterest [ 0 ] . latitude ) ;
94
92
setLongitude ( pointsOfInterest [ 0 ] . longitude ) ;
95
93
setDestinationName ( pointsOfInterest [ 0 ] . name ) ;
@@ -102,14 +100,14 @@ function RoutePage() {
102
100
< div className = "flex flex-col place-items-start pb-20" >
103
101
< BackButton > Afslut</ BackButton >
104
102
< h1 className = "text-xl font-bold my-3" > { selectedRoute . name } </ h1 >
105
- < div className = "overflow-y-auto h-4/6 relative w-full bg-white dark:bg-zinc-700 dark:highlight-white/5 shadow-lg ring-1 ring-black/5 rounded-lg flex flex-col divide-y dark:divide-zinc-200/5 " >
103
+ < div className = "relative w-full rounded-lg flex flex-col-reverse gap-1 " >
106
104
{ pointsOfInterest &&
107
105
pointsOfInterest
108
- . toReversed ( )
109
- . map ( ( pointOfInterest ) => (
106
+ . map ( ( pointOfInterest , index ) => (
110
107
< PointOfInterest
111
108
pointOfInterest = { pointOfInterest }
112
109
key = { pointOfInterest . id }
110
+ index = { index + 1 }
113
111
/>
114
112
) ) }
115
113
</ div >
@@ -118,32 +116,40 @@ function RoutePage() {
118
116
< div >
119
117
< span className = "block text-sm text-bold" > Afstand til del 1</ span >
120
118
< span className = "block" > 180 meter</ span >
121
- < button
122
- className = "bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
123
- type = "button"
124
- onClick = { ( ) => startWaypointer ( ) }
125
- >
126
- Vis mig vej
127
- </ button >
128
119
</ div >
129
120
< div className = "pl-3" >
130
- < div className = "flex justify-between mb-3" >
131
- < span className = "text-sm text-bold" > Retning</ span >
132
- < span className = "w-1/2" >
133
- < LocationArrow
134
- className = "inline w-5"
135
- style = { {
136
- transform : `rotate(${ - rotation } deg)` ,
137
- } }
138
- />
139
- </ span >
140
- </ div >
141
- < div className = "text-xs text-zinc-500" >
142
- Lat: { userLatitude } /{ latitude }
143
- </ div >
144
- < div className = "text-xs text-zinc-500" >
145
- Long: { userLongitude } /{ longitude }
146
- </ div >
121
+ { /* TODO: Make this check for compass */ }
122
+ { ! location && (
123
+ < button
124
+ className = "bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
125
+ type = "button"
126
+ onClick = { ( ) => startWaypointer ( ) }
127
+ >
128
+ Vis mig vej
129
+ </ button >
130
+ ) }
131
+ { /* TODO: Make this check for compass */ }
132
+ { location && (
133
+ < div >
134
+ < div className = "flex justify-between mb-3" >
135
+ < span className = "text-sm text-bold" > Retning</ span >
136
+ < span className = "w-1/2" >
137
+ < LocationArrow
138
+ className = "inline w-5"
139
+ style = { {
140
+ transform : `rotate(${ - rotation } deg)` ,
141
+ } }
142
+ />
143
+ </ span >
144
+ </ div >
145
+ < div className = "text-xs text-zinc-500" >
146
+ Lat: { userLatitude } /{ latitude }
147
+ </ div >
148
+ < div className = "text-xs text-zinc-500" >
149
+ Long: { userLongitude } /{ longitude }
150
+ </ div >
151
+ </ div >
152
+ ) }
147
153
</ div >
148
154
</ div >
149
155
</ div >
0 commit comments