Run prettier for formatting fixes

This commit is contained in:
Fred Boniface 2024-07-12 15:29:55 +01:00
parent 2b8d32f3c9
commit 31b4653ca2
13 changed files with 54 additions and 58 deletions

View File

@ -3,7 +3,7 @@
<style>
#banner {
width: 200px;
background: rgba(255, 0, 0,0.5);
background: rgba(255, 0, 0, 0.5);
color: #ffffff7a;
position: fixed;
text-align: center;

View File

@ -3,7 +3,7 @@
export let text: string;
</script>
<a class="link-button" href="{link}">{text}</a>
<a class="link-button" href={link}>{text}</a>
<style>
.link-button {
@ -32,6 +32,6 @@
.link-button:hover {
box-shadow: var(--box-shadow-dark);
background-color: rgb(45,45,45);
background-color: rgb(45, 45, 45);
}
</style>

View File

@ -31,6 +31,6 @@
.script-button:hover {
box-shadow: var(--box-shadow-dark);
background-color: rgb(45,45,45);
background-color: rgb(45, 45, 45);
}
</style>

View File

@ -40,7 +40,7 @@
try {
const apiResponse = (await apiGet(apiPath)) as NearestStationResponse[];
stations = apiResponse;
nearToMeCache.set(apiResponse)
nearToMeCache.set(apiResponse);
} catch (err) {
errorMessage = err as string;
} finally {
@ -54,7 +54,7 @@
errorMessage = "Register to use this feature";
} else {
if ($nearToMeCache.length) {
stations = $nearToMeCache
stations = $nearToMeCache;
}
getNearestStations();
}
@ -66,26 +66,24 @@
<Card {config}>
{#if blockLoading}
<InLineLoading />
{:else}
{#if !$uuid || $uuid === "null"}
<LinkButton text="Register to use this feature" link="/more/reg" />
{:else if $location}
{#if !stations.length}
{#if errorMessage}
<p>{errorMessage}</p>
{:else}
<InLineLoading />
{/if}
{:else if !$uuid || $uuid === "null"}
<LinkButton text="Register to use this feature" link="/more/reg" />
{:else if $location}
{#if !stations.length}
{#if errorMessage}
<p>{errorMessage}</p>
{:else}
<div id="buttons">
{#each stations as station}
<LinkButton text={`${station.NLCDESC} - ${station.miles}mi`} link={`/ldb?station=${station["3ALPHA"]}`} />
{/each}
</div>
<InLineLoading />
{/if}
{:else}
<ScriptButton text={"Turn on Location"} fn={turnOnLocation} />
<div id="buttons">
{#each stations as station}
<LinkButton text={`${station.NLCDESC} - ${station.miles}mi`} link={`/ldb?station=${station["3ALPHA"]}`} />
{/each}
</div>
{/if}
{:else}
<ScriptButton text={"Turn on Location"} fn={turnOnLocation} />
{/if}
</Card>

View File

@ -11,7 +11,7 @@
helpText: "",
onRefresh: () => {},
refreshing: false,
}
};
</script>
<Card config={upstreamProps}>

View File

@ -1,6 +1,6 @@
<script>
import { IconAlertCircle } from "@tabler/icons-svelte";
import { fly } from "svelte/transition";
import { fly } from "svelte/transition";
export let alerts = [];
$: uniqueAlerts = [...new Set(alerts)];

View File

@ -31,7 +31,7 @@
let updatedTime: Date;
async function callFetch(station: string): Promise<StaffLdb> {
console.log("callFetch function called")
console.log("callFetch function called");
const data = await fetchStaffLdb(station);
if (data.data) {
title = data.data.locationName;
@ -53,8 +53,7 @@
onMount(async () => {
console.log("staff-ldb component mounted");
})
});
</script>
{#if nrcc.length}
@ -73,7 +72,6 @@
<Loading />
{:then data}
{#if data}
{#if data.trainServices?.length}
<TableGenerator services={data.trainServices} click={showDetail} />
{/if}

View File

@ -75,7 +75,7 @@
<p class="smallScreen">Your display is too small to view this data</p>
<p class="smallScreen">Try rotating your device</p>
<table in:fade={{duration:500}}>
<table in:fade={{ duration: 500 }}>
<tr>
<th class="id">ID</th>
<th class="from">From</th>

View File

@ -4,29 +4,29 @@
export let updatedTime: Date | undefined;
let currentTime: string = "00:00:00"
let updateDisplay: string;
function updateTime() {
const now = new Date();
const hours = now.getHours().toString().padStart(2, '0');
const mins = now.getMinutes().toString().padStart(2, '0');
const secs = now.getSeconds().toString().padStart(2, '0');
currentTime = `${hours}:${mins}:${secs}`
}
let currentTime: string = "00:00:00";
let updateDisplay: string;
function updateTime() {
const now = new Date();
const hours = now.getHours().toString().padStart(2, "0");
const mins = now.getMinutes().toString().padStart(2, "0");
const secs = now.getSeconds().toString().padStart(2, "0");
currentTime = `${hours}:${mins}:${secs}`;
}
onMount(() => {
console.log("TimeBar component mounted")
updateTime();
const interval = setInterval(updateTime, 250);
return () => clearInterval(interval);
})
onMount(() => {
console.log("TimeBar component mounted");
updateTime();
const interval = setInterval(updateTime, 250);
return () => clearInterval(interval);
});
</script>
<div id="TimeBar">
{#if updatedTime}
<span in:fade class="updated-time">Updated: {updatedTime.toLocaleTimeString()}</span>
{:else}
<span></span>
<span />
{/if}
<span class="current-time">{currentTime}</span>
</div>
@ -42,12 +42,12 @@ onMount(() => {
padding: 0;
}
.updated-time {
font-family: firamono, 'Courier New', Courier, monospace;
font-family: firamono, "Courier New", Courier, monospace;
margin-left: 10px;
font-size: 14px;
}
.current-time {
font-family: firamono, 'Courier New', Courier, monospace;
font-family: firamono, "Courier New", Courier, monospace;
font-weight: 900;
vertical-align: middle;
color: aliceblue;

View File

@ -8,7 +8,6 @@
];
import { page } from "$app/stores";
import { IconHome } from "@tabler/icons-svelte";
</script>
<footer>

View File

@ -16,7 +16,7 @@
formAction: "/ldb",
placeholder: "enter crs/tiploc",
maxLen: 7,
fieldName: "station"
fieldName: "station",
},
{
title: "Timetable & PIS",
@ -24,7 +24,7 @@
formAction: "/train",
placeholder: "enter headcode",
maxLen: 4,
fieldName: "headcode"
fieldName: "headcode",
},
];

View File

@ -27,7 +27,7 @@
helpText: "",
onRefresh: () => {},
refreshing: false,
}
};
function load() {
isLoading = true;
@ -41,8 +41,8 @@
async function getData() {
if (inputValue) {
const apiPath = `/api/v2/ref/reasonCode/${inputValue}`;
const res = await apiGet(apiPath)
return res
const res = await apiGet(apiPath);
return res;
} else {
return [];
}

View File

@ -29,8 +29,9 @@
console.log("Refresh");
}
</script>
<Header title={"Test"} />
<TimeBar updatedTime={new Date} />
<TimeBar updatedTime={new Date()} />
<LookupCard config={LookupConfig} />
<LookupCard config={TimetableConfig} />
<NearToMeCard />