aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-31 15:23:49 -0700
committerAdam Soltys <[email protected]>2024-08-31 15:23:49 -0700
commita89d4ee9b9bf0c15505a58803585f1847731983e (patch)
tree46098814beabc79de334898dbc4808aed8d5f329 /src/lib
parentdf71664f20312e81134ee90ad561f55d3020ee0a (diff)
downloadcoinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.tar.gz
coinos-ui-a89d4ee9b9bf0c15505a58803585f1847731983e.zip
typescript
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/handler.ts19
-rw-r--r--src/lib/translations/index.js8
-rw-r--r--src/lib/types.ts22
3 files changed, 31 insertions, 18 deletions
diff --git a/src/lib/handler.ts b/src/lib/handler.ts
index 03795ad9..559761f0 100644
--- a/src/lib/handler.ts
+++ b/src/lib/handler.ts
@@ -1,14 +1,13 @@
import { goto } from "$app/navigation";
import { applyAction } from "$app/forms";
-export default (submitting) =>
- () => {
- submitting = true;
- return async ({ result }) => {
- if (result.type === "redirect") {
- goto(result.location);
- } else {
- await applyAction(result);
- }
- };
+export default (toggle) => () => {
+ toggle();
+ return async ({ result }) => {
+ if (result.type === "redirect") {
+ goto(result.location);
+ } else {
+ await applyAction(result);
+ }
};
+};
diff --git a/src/lib/translations/index.js b/src/lib/translations/index.js
index ae2fcedf..cd7c20dd 100644
--- a/src/lib/translations/index.js
+++ b/src/lib/translations/index.js
@@ -1,17 +1,9 @@
import i18n from "sveltekit-i18n";
-import lang from "./lang.json";
-
-const availableLocales = Object.keys(lang);
-const trans = {};
-for (let i = 0; i < availableLocales.length; i++) {
- trans[availableLocales[i]] = { lang };
-}
export const defaultLocale = "en";
const config = {
fallbackLocale: "en",
- translations: trans,
loaders: [
{
locale: "en",
diff --git a/src/lib/types.ts b/src/lib/types.ts
new file mode 100644
index 00000000..33f78c85
--- /dev/null
+++ b/src/lib/types.ts
@@ -0,0 +1,22 @@
+export interface Message {
+ author: User;
+ created_at: number;
+ recipient: User;
+}
+
+export interface Note {
+ created_at: number;
+ seen: number;
+}
+
+export interface User {
+ id: string;
+}
+
+export interface Invoice {
+ id?: string;
+ memoPrompt?: boolean;
+ memo?: string;
+ rate: number;
+ type: string;
+}