forgot to push
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 16s
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 16s
This commit is contained in:
parent
f60bc1b5e4
commit
e3805fd221
4 changed files with 57 additions and 22 deletions
|
|
@ -20,24 +20,27 @@
|
|||
<div class="justify-self-start flex flex-col w-full col-start-4">
|
||||
<div>Tracker</div>
|
||||
<div>NRF52840 + ICM45856</div>
|
||||
<div class="flex">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex flex-col">
|
||||
<div>200DKK</div>
|
||||
<div class="flex text-sm">
|
||||
<div>20GBP</div>
|
||||
<div>25USD</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex join">
|
||||
<button
|
||||
class="join-item btn btn-primary"
|
||||
class="join-item btn btn-xs btn-primary"
|
||||
on:click={() => {
|
||||
cart.trackers--;
|
||||
sanityCheck();
|
||||
}}>-</button
|
||||
>
|
||||
<div class="join-item input input-disable cursor-default">
|
||||
<div class="join-item input input-xs input-disable cursor-default">
|
||||
{cart.trackers}
|
||||
</div>
|
||||
<button
|
||||
class="join-item btn btn-primary"
|
||||
class="join-item btn btn-xs btn-primary"
|
||||
on:click={() => {
|
||||
cart.trackers++;
|
||||
sanityCheck();
|
||||
|
|
@ -45,4 +48,5 @@
|
|||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
20
src/ts/Misc/CurrencyConvert.ts
Normal file
20
src/ts/Misc/CurrencyConvert.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import pb from "@ts/api/api";
|
||||
import type { ValueData } from "./ValueData";
|
||||
|
||||
export class CurrencyConvert {
|
||||
valueData: ValueData | undefined = undefined;
|
||||
|
||||
constructor() {}
|
||||
|
||||
static async RetreiveCurrencyData(): Promise<ValueData> {
|
||||
const item = await pb.collection("misc").getFirstListItem(`ref="currency"`);
|
||||
return ShopItem.fromJSON(item);
|
||||
}
|
||||
|
||||
// DKK: baller
|
||||
// target: ISO short thing. Fx. "EUR", "USD"
|
||||
// Returns: Target equilavent
|
||||
static async To(dkk: number, target: string): Promise<undefined | number> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
10
src/ts/Misc/ValueData.ts
Normal file
10
src/ts/Misc/ValueData.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// iso: "USD", "EUR"
|
||||
// value: What it is worth compared to 1 DKK
|
||||
interface DkkRelativeEqualivant {
|
||||
iso: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface ValueData {
|
||||
data: DkkRelativeEqualivant[];
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import ShopItem from "./classes/ShopItem";
|
|||
const PUBLIC_POCKET_URL = "https://pocket.deprived.dev/";
|
||||
|
||||
export let pb = new PocketBase(PUBLIC_POCKET_URL);
|
||||
export default pb;
|
||||
|
||||
console.log(PUBLIC_POCKET_URL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue