+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/base/Toast.vue b/components/base/Toast.vue
deleted file mode 100644
index d05014e..0000000
--- a/components/base/Toast.vue
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
{{ title }}
- ×
- {{ content }}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/base/Toaster.vue b/components/base/Toaster.vue
new file mode 100644
index 0000000..bb9484a
--- /dev/null
+++ b/components/base/Toaster.vue
@@ -0,0 +1,92 @@
+
+
+ tryClose(toast, state)" :data-type="toast.type ?? 'info'">
+
+
{{ toast.title }}
+ ×
+ {{ toast.content }}
+
+ tryClose(toast, false)" />
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/composables/useToast.ts b/composables/useToast.ts
index 2367c7b..ec38f8d 100644
--- a/composables/useToast.ts
+++ b/composables/useToast.ts
@@ -1,4 +1,40 @@
-export default function useToast()
+export interface ToastConfig
{
-
+ closeable?: boolean
+ duration: number
+ title?: string
+ content?: string
+ timer?: boolean
+ type?: ToastType
+}
+export type ToastType = 'info' | 'success' | 'error';
+export type ExtraToastConfig = ToastConfig & { id: string, state: boolean };
+
+let id = 0;
+
+const [provideToaster, useToast] = createInjectionState(() => {
+ const list = ref([]);
+
+ function add(config: ToastConfig)
+ {
+ list.value.push({ ...config, id: (++id).toString(), state: true, });
+ }
+ function clear(type?: ToastType)
+ {
+ list.value.forEach(e => { if(e.type !== type) { e.state = false; } });
+ }
+
+ return { list, add, clear }
+}, { injectionKey: Symbol('toaster') });
+
+export { provideToaster, useToastWithDefault as useToast };
+
+function useToastWithDefault()
+{
+ const toasts = useToast();
+ if(!toasts)
+ {
+ return { list: ref([]), add: () => {}, clear: () => {} };
+ }
+ return toasts;
}
\ No newline at end of file
diff --git a/db.sqlite-shm b/db.sqlite-shm
index 49ed849..73c3e9d 100644
Binary files a/db.sqlite-shm and b/db.sqlite-shm differ
diff --git a/pages/admin/index.vue b/pages/admin/index.vue
index 8e429d6..e1f6e9f 100644
--- a/pages/admin/index.vue
+++ b/pages/admin/index.vue
@@ -44,7 +44,5 @@ async function fetch()
-
-
\ No newline at end of file
diff --git a/pages/index.vue b/pages/index.vue
index f98069e..d81a49b 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -31,7 +31,6 @@ watch(loading, (value) => {
-
\ No newline at end of file
diff --git a/pages/user/login.vue b/pages/user/login.vue
index f6621d4..4f312e5 100644
--- a/pages/user/login.vue
+++ b/pages/user/login.vue
@@ -3,25 +3,30 @@
Connexion
- Connexion
+
+ $router.go(-1)">
+ Connexion
+
-
\ No newline at end of file
diff --git a/pages/user/register.vue b/pages/user/register.vue
index d8e0f55..1e48397 100644
--- a/pages/user/register.vue
+++ b/pages/user/register.vue
@@ -3,28 +3,31 @@
Inscription