Skip to content

Commit 5a12ca6

Browse files
committed
frontend: added divider
1 parent e4858b7 commit 5a12ca6

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

frontend/src/components/timetable/ConnectionComponent.svelte

+12-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
import ViaStops from "$components/timetable/info/ViaStops.svelte";
88
import Messages from "$components/timetable/messages/Messages.svelte";
99
10-
let { connection }: { connection: Connection } = $props();
10+
let { connection, renderBorder, renderInformation }: {
11+
connection: Connection,
12+
renderBorder: boolean,
13+
renderInformation: boolean
14+
} = $props();
1115
const isDeparture = getContext<boolean>("isDeparture");
1216
</script>
1317

1418
<div class:bg-text={connection?.cancelled ?? false}
1519
class:text-background={connection?.cancelled ?? false}
16-
class="font-medium py-2"
20+
class="font-medium py-1"
1721
>
1822
<!-- layout for smaller screens (under md) -->
1923
<div class="p-2 md:hidden gap-y-2">
@@ -49,11 +53,11 @@
4953
<div class="mx-auto hidden md:flex flex-col justify-between">
5054
<!-- 1st row -->
5155
<div class="flex flex-row">
52-
<span class="flex-[1] mr-8"></span>
53-
<span class="flex-[4] mr-4">
56+
<span class="flex-[1] mr-8" class:border-t={renderBorder} class:border-text={renderBorder}></span>
57+
<span class="flex-[4] mr-4" class:border-t={renderBorder} class:border-text={renderBorder}>
5458
<Messages connection={connection} />
5559
</span>
56-
<span class="flex-[1]"></span>
60+
<span class="flex-[1]" class:border-t={renderBorder} class:border-text={renderBorder}></span>
5761
</div>
5862

5963
<!-- 2nd row -->
@@ -78,7 +82,9 @@
7882
<div class="flex flex-row items-center text-3xl">
7983
<!-- Time Information -->
8084
<div class="flex-[1] mr-8">
81-
<TimeComponent time={isDeparture ? connection?.departure : connection?.arrival} />
85+
{#if renderInformation}
86+
<TimeComponent time={isDeparture ? connection?.departure : connection?.arrival} />
87+
{/if}
8288
</div>
8389

8490
<div class="flex-[4] mr-4">

frontend/src/components/timetable/WingTrain.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</script>
77

88
<div class="flex flex-col">
9-
{#each journey.connections as connection}
10-
<ConnectionComponent {connection} />
9+
{#each journey.connections as connection, i}
10+
<ConnectionComponent connection={connection} renderBorder={i === 0} renderInformation={i === journey.connections.length - 1} />
1111
{/each}
1212
</div>

frontend/src/routes/[evaNumber]/[type=type]/+page.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@
5656
<Clock/>
5757
</div>
5858

59-
<div class="scrollbar-hidden overflow-y-scroll container mx-auto flex flex-col">
59+
<div class="scrollbar-hidden overflow-y-scroll container mx-auto flex flex-col divide-y-2 md:divide-y-0">
6060
{#each data.journeys as journey}
6161
{#if !matchesFilter(journey)}{:else}
6262
{#if journey.connections.length > 1}
6363
<WingTrain journey={journey} />
6464
{:else}
65-
<ConnectionComponent connection={journey.connections[0]} />
65+
<ConnectionComponent connection={journey.connections[0]} renderInformation={true} renderBorder={true} />
6666
{/if}
6767
{/if}
6868
{/each}

0 commit comments

Comments
 (0)