Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/stops/StopPane.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<p>Loading...</p>
{:else}
<div>
{#if loading && isLoading}
{#if loading && isLoading && tripSelected}
<LoadingSpinner />
{/if}

Expand Down
82 changes: 39 additions & 43 deletions src/routes/stops/[stopID]/schedule/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { page } from '$app/stores';
import LoadingSpinner from '$components/LoadingSpinner.svelte';

Check failure on line 3 in src/routes/stops/[stopID]/schedule/+page.svelte

View workflow job for this annotation

GitHub Actions / lint

'LoadingSpinner' is defined but never used
import RouteScheduleTable from '$components/schedule-for-stop/RouteScheduleTable.svelte';
import StopPageHeader from '$components/stops/StopPageHeader.svelte';
import StandalonePage from '$components/StandalonePage.svelte';
Expand All @@ -9,7 +9,7 @@
import AccordionItem from '$components/containers/AccordionItem.svelte';
import { Datepicker } from 'flowbite-svelte';
import { onMount } from 'svelte';
import { isLoading } from 'svelte-i18n';

Check failure on line 12 in src/routes/stops/[stopID]/schedule/+page.svelte

View workflow job for this annotation

GitHub Actions / lint

'isLoading' is defined but never used
import { t } from 'svelte-i18n';

let selectedDate = $state(new Date());
Expand All @@ -19,7 +19,7 @@
let stopName = $state('');
let stopId = $state('');
let stopDirection = $state('');
let loading = $state(true);

Check failure on line 22 in src/routes/stops/[stopID]/schedule/+page.svelte

View workflow job for this annotation

GitHub Actions / lint

'loading' is assigned a value but never used
let accordionComponent = $state();
let allRoutesExpanded = $state(false);

Expand Down Expand Up @@ -140,52 +140,48 @@
</svelte:head>

<StandalonePage>
{#if loading || $isLoading}
<LoadingSpinner />
{:else}
<StopPageHeader {stopName} {stopId} {stopDirection} />

<div class="flex flex-col">
<div class="flex flex-1 flex-col">
<h2 class="mb-4 text-2xl font-bold text-gray-800">
{$t('schedule_for_stop.route_schedules')}
</h2>

<div class="mb-4 flex gap-4">
<div class="z-20 min-w-32 md:w-[30%]">
<Datepicker bind:value={selectedDate} inputClass="w-96" />
</div>

<div class="flex-1 text-right">
<button class="button" onclick={toggleAllRoutes}>
{allRoutesExpanded
? $t('schedule_for_stop.collapse_all_routes')
: $t('schedule_for_stop.show_all_routes')}
</button>
</div>
<StopPageHeader {stopName} {stopId} {stopDirection} />

<div class="flex flex-col">
<div class="flex flex-1 flex-col">
<h2 class="mb-4 text-2xl font-bold text-gray-800">
{$t('schedule_for_stop.route_schedules')}
</h2>

<div class="mb-4 flex gap-4">
<div class="z-20 min-w-32 md:w-[30%]">
<Datepicker bind:value={selectedDate} inputClass="w-96" />
</div>

<div
class="flex-1 rounded-lg border border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-black"
>
{#if emptySchedules}
<p class="text-center text-gray-700 dark:text-gray-400">
{$t('schedule_for_stop.no_schedules_available')}
</p>
{:else}
<Accordion bind:this={accordionComponent}>
{#each schedules as schedule}
<AccordionItem>
{#snippet header()}
<span>{schedule.tripHeadsign}</span>
{/snippet}
<RouteScheduleTable {schedule} />
</AccordionItem>
{/each}
</Accordion>
{/if}
<div class="flex-1 text-right">
<button class="button" onclick={toggleAllRoutes}>
{allRoutesExpanded
? $t('schedule_for_stop.collapse_all_routes')
: $t('schedule_for_stop.show_all_routes')}
</button>
</div>
</div>

<div
class="flex-1 rounded-lg border border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-black"
>
{#if emptySchedules}
<p class="text-center text-gray-700 dark:text-gray-400">
{$t('schedule_for_stop.no_schedules_available')}
</p>
{:else}
<Accordion bind:this={accordionComponent}>
{#each schedules as schedule}
<AccordionItem>
{#snippet header()}
<span>{schedule.tripHeadsign}</span>
{/snippet}
<RouteScheduleTable {schedule} />
</AccordionItem>
{/each}
</Accordion>
{/if}
</div>
</div>
{/if}
</div>
</StandalonePage>
Loading