Skip to content

Commit b9b9770

Browse files
committed
SALG-1278: Style nav/audio box
1 parent aabfa86 commit b9b9770

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

src/components/points-of-interest/PointOfInterest.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function PointOfInterest({
2626
index,
2727
destinationChanged,
2828
nextUnlockableId,
29-
setSource,
29+
setSource
3030
}) {
3131
const { lat, long } = useContext(LatLongContext);
3232
const [proximity, setProximity] = useState(null);
@@ -50,7 +50,7 @@ function PointOfInterest({
5050
);
5151
setProximity(distance);
5252
if (!unlocked && id === nextUnlockableId) {
53-
setUnlocked(distance < 50); // todo magic number/get from config
53+
setUnlocked(distance < 51); // todo magic number/get from config
5454
}
5555
}
5656
}, [latitude, longitude, lat, long, geolocationAvailable]);

src/components/routes/RoutePage.jsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function RoutePage() {
163163
<div className="flex flex-col place-items-start pb-36">
164164
<BackButton>Afslut</BackButton>
165165
<h1 className="text-xl font-bold my-3">{selectedRoute.name}</h1>
166-
<div className="relative w-full rounded-lg flex flex-col-reverse gap-1">
166+
<div className="relative w-full rounded-lg flex flex-col-reverse gap-1 pl-3">
167167
{pointsOfInterest &&
168168
pointsOfInterest.map((pointOfInterest, index) => (
169169
<PointOfInterest
@@ -176,12 +176,13 @@ function RoutePage() {
176176
/>
177177
))}
178178
</div>
179-
<div className="fixed flex flex-col left-3 bottom-3 right-3 bg-zinc-200 dark:bg-zinc-700 gap-3 rounded-lg p-3 pb-15 divide-x dark:divide-zinc-200/5">
179+
<div className="fixed flex flex-col left-3 bottom-0 right-3 bg-zinc-200 dark:bg-zinc-900 gap-3 rounded-t-lg p-3 pb-15 divide-y dark:divide-zinc-200/5">
180180
{routeComplete && <h3>You completed the route. Congratulations!</h3>}
181181
{!routeComplete && (
182182
<div className="flex flex-row justify-between">
183183
<div>
184-
<div className="text-sm text-bold">
184+
<p className="text-xs text-zinc-500">Find vej til næste del</p>
185+
<div className="text-sm font-bold">
185186
Afstand til del
186187
<span className="ml-1 px-2 font-bold rounded-full bg-emerald-700 text-zinc-100 text-sm">
187188
{destinationIndex + 1}
@@ -194,7 +195,7 @@ function RoutePage() {
194195
<div className="pl-3">
195196
{(!orientation || !angle) && (
196197
<button
197-
className="bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
198+
className="bg-zinc-700 dark:bg-zinc-200 text-zinc-200 dark:text-zinc-800 rounded text-sm py-1 px-3"
198199
type="button"
199200
onClick={() => startWaypointer()}
200201
>
@@ -207,7 +208,7 @@ function RoutePage() {
207208
<span className="text-sm text-bold mr-5">Retning</span>
208209
<span className="w-1/2">
209210
<LocationArrow
210-
className="inline w-5"
211+
className="inline w-10"
211212
style={{
212213
transform: `rotate(${-rotation}deg)`,
213214
}}
@@ -220,14 +221,18 @@ function RoutePage() {
220221
</div>
221222
)}
222223

223-
<div>
224-
<audio
225-
className="w-full"
226-
ref={audioRef}
227-
controls
228-
src={`${fileUrl}${source}`}
229-
/>
230-
</div>
224+
{source && audioRef &&
225+
<div className="pt-2">
226+
<p className="text-xs text-zinc-500">Igangværende afspilning</p>
227+
<p className="text-sm font-bold ">Pizza 1</p>
228+
<audio
229+
className="w-full"
230+
ref={audioRef}
231+
controls
232+
src={`${fileUrl}${source}`}
233+
/>
234+
</div>
235+
}
231236
</div>
232237
<div ref={bottomRef} />
233238
</div>

src/components/routes/SelectedRoute.jsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,18 @@ function SelectedRoute({ selectedRoute, hideMapOverlay }) {
3838
className="bg-zinc-100 dark:bg-zinc-700 rounded p-3 w-32 drop-shadow"
3939
>
4040
<label htmlFor="distance" className="block mb-2">
41-
<b className="text-sm">Distance</b>
42-
<br />
43-
<span className="text-xl">{selectedRoute.distance}</span>
41+
<p className="text-xs">Distance</p>
42+
<p className="font-bold">{selectedRoute.distance}</p>
4443
</label>
4544
<label htmlFor="poi" className="block mb-2">
46-
<b className="text-xs">Afsnit</b>
47-
<br />
48-
<span className="text-xl">{selectedRoute.partcount}</span>
45+
<p className="text-xs">Afsnit</p>
46+
<p className="font-bold">{selectedRoute.partcount}</p>
4947
</label>
5048
{/* todo skeleton screen (I think I recall tailwind having these ootb) or some wait indication. https://tailwindcss.com/docs/animation#pulse */}
5149
{/* todo how to sum up podcasts */}
5250
<label htmlFor="length" className="block">
53-
<b className="text-sm">Afspilningstid</b>
54-
<br />
55-
<span className="text-xl">{selectedRoute.totalduration} min</span>
51+
<p className="text-xs">Afspilningstid</p>
52+
<p className="font-bold">{selectedRoute.totalduration} min</p>
5653
</label>
5754
</div>
5855
</div>

0 commit comments

Comments
 (0)