@@ -2,6 +2,8 @@ import { React, useEffect, useState } from "react";
2
2
import MapWrapper from "../map/MapWrapper" ;
3
3
import { getFeaturesForMap } from "../../util/helper" ;
4
4
import BackButton from "../BackButton" ;
5
+ import { ReactComponent as IconCirclePlay } from "../../icons/circle-play-solid.svg" ;
6
+ import { ReactComponent as IconMap } from "../../icons/map-solid.svg" ;
5
7
6
8
function SelectedRoute ( { selectedRoute } ) {
7
9
const [ featuresForMap , setFeaturesForMap ] = useState ( null ) ;
@@ -16,33 +18,57 @@ function SelectedRoute({ selectedRoute }) {
16
18
17
19
if ( selectedRoute === null || featuresForMap === null ) return null ;
18
20
21
+ console . log ( selectedRoute )
22
+
19
23
return (
20
24
< >
21
25
< MapWrapper mapData = { featuresForMap } goToView = { featuresForMap [ 0 ] } />
22
26
< BackButton > Kategorier</ BackButton >
23
27
< div className = "relative ml-2" >
24
- < h1 className = "text-4xl font-bold mt-10 mb-5" > { selectedRoute . name } </ h1 >
25
- < div className = "info-box bg-zinc-100 dark:bg-zinc-700 rounded p-3 w-32" >
28
+ { /* TODO: show the real category instead of "Valgt kategory" */ }
29
+ < p className = "mt-10 text-sm font-bold text-emerald-800 dark:text-emerald-400 drop-shadow" > Valgt kategori</ p >
30
+ < h1 className = "text-4xl font-bold mb-5 drop-shadow" > { selectedRoute . name } </ h1 >
31
+ < div id = "info-box" className = "bg-zinc-100 dark:bg-zinc-700 rounded p-3 w-32 drop-shadow" >
26
32
< label htmlFor = "distance" className = "mb-5" >
27
33
< span className = "text-xs" > Distance</ span >
28
34
< div id = "distance" className = "text-lg" >
29
35
{ selectedRoute . distance }
30
36
</ div >
31
37
</ label >
32
38
< label htmlFor = "poi" className = "mb-5" >
33
- < span className = "text-xs" > Dele </ span >
39
+ < span className = "text-xs" > Afsnit </ span >
34
40
< div id = "poi" className = "text-lg" >
35
41
{ selectedRoute . pointsOfInterest . length }
36
42
</ div >
37
43
</ label >
38
- { /* todo skeleton screen (I think I recall tailwind having these ootb) or some wait indication */ }
44
+ { /* todo skeleton screen (I think I recall tailwind having these ootb) or some wait indication. https://tailwindcss.com/docs/animation#pulse */ }
39
45
{ /* todo how to sum up podcasts */ }
40
46
< label htmlFor = "length" >
41
47
< span className = "text-xs" > Afspilningstid</ span >
42
48
{ /* todo */ }
43
49
< div id = "length" className = "text-lg" />
44
50
</ label >
45
51
</ div >
52
+ < div id = "buttons" className = "relative mt-5 flex gap-3" >
53
+ < button
54
+ className = "p-2 rounded text-zinc-100 dark:text-zinc-800 bg-zinc-800 dark:bg-zinc-100 drop-shadow"
55
+ type = "button"
56
+ // TODO: Change onClick to go to selected route
57
+ //onClick={() => setSource(podcast)}
58
+ >
59
+ < IconCirclePlay className = "w-6 h-6" />
60
+ < span className = "sr-only" > Afspil</ span >
61
+ </ button >
62
+ < button
63
+ className = "p-2 rounded text-zinc-100 dark:text-zinc-800 bg-zinc-800 dark:bg-zinc-100 drop-shadow"
64
+ type = "button"
65
+ // TODO: Change onClick to toggle map layer
66
+ //onClick={() => setSource(podcast)}
67
+ >
68
+ < IconMap className = "w-6 h-6" />
69
+ < span className = "sr-only" > Vis kortet</ span >
70
+ </ button >
71
+ </ div >
46
72
</ div >
47
73
</ >
48
74
) ;
0 commit comments