diff --git a/app.vue b/app.vue index 2abf32f..5caf4b5 100644 --- a/app.vue +++ b/app.vue @@ -1,14 +1,19 @@ + + \ 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 @@ - - - - - \ 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 @@ + + + + + \ 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 +
+ + Connexion +
Pas de compte ? -
\ 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
- Inscription -
- - - -
+
+ + Inscription +
+ + + + +
Votre mot de passe doit respecter les critères de sécurité suivants : - Entre 8 et 128 + Entre 8 et 128 caractères - Au moins + Au moins une minuscule et une majuscule - Au moins un + Au moins un chiffre - Au moins un - caractère spécial parmis la liste suivante: + Au moins un + caractère spécial parmi la liste suivante:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ ] ^ _ ` { | } ~
- - - Pas de compte ? + + + Vous avez déjà un compte ?Se connecter
@@ -32,6 +35,7 @@ \ No newline at end of file