From fbab3fd81f02fec1231bc74577cd0b0110c0f2a3 Mon Sep 17 00:00:00 2001 From: Floris Bartra Date: Tue, 30 Jan 2024 16:29:58 +0100 Subject: [PATCH] Add buttons to show password --- src/components/LoginForm.vue | 10 ++--- src/components/PasswordInput.vue | 55 ++++++++++++++++++++++++++++ src/components/PasswordResetForm.vue | 18 ++++----- src/components/RegisterForm.vue | 19 ++++------ src/main.ts | 17 +++++++-- src/views/Me.vue | 25 +++++-------- 6 files changed, 97 insertions(+), 47 deletions(-) create mode 100644 src/components/PasswordInput.vue diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index 6d85a2d9..252054e3 100755 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -6,6 +6,7 @@ import { useUserStore } from '@/stores/user.store'; import FormField from './FormField.vue'; import Modal from './Modal.vue'; +import PasswordInput from './PasswordInput.vue'; const { ask_reset_password, login } = useUserStore(); @@ -79,14 +80,11 @@ const openModal = () => { -
diff --git a/src/components/PasswordInput.vue b/src/components/PasswordInput.vue new file mode 100644 index 00000000..18038650 --- /dev/null +++ b/src/components/PasswordInput.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/PasswordResetForm.vue b/src/components/PasswordResetForm.vue index 279bc11a..2489016e 100755 --- a/src/components/PasswordResetForm.vue +++ b/src/components/PasswordResetForm.vue @@ -7,6 +7,7 @@ import { computed, reactive } from 'vue'; import { useUserStore } from '@/stores/user.store'; import FormField from './FormField.vue'; +import PasswordInput from './PasswordInput.vue'; const { reset_password } = useUserStore(); @@ -47,29 +48,24 @@ const register_user = async () => { - -
diff --git a/src/components/RegisterForm.vue b/src/components/RegisterForm.vue index 6936de64..944159ad 100755 --- a/src/components/RegisterForm.vue +++ b/src/components/RegisterForm.vue @@ -12,6 +12,7 @@ import { useUserStore } from '@/stores/user.store'; import Content from './Content.vue'; import FormField from './FormField.vue'; import Modal from './Modal.vue'; +import PasswordInput from './PasswordInput.vue'; const contentStore = useContentStore(); const { getContent } = contentStore; @@ -115,29 +116,23 @@ const register_user = async () => { - - diff --git a/src/main.ts b/src/main.ts index 92a354ab..f10e6d60 100755 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { - faArrowsRotate, faCircle, faCircleCheck, faCirclePlus, faClock, - faFile, faPencil, faWarning, + faArrowsRotate, faCircle, faCircleCheck, faCirclePlus, faClock, faEye, + faEyeSlash, faFile, faPencil, faWarning, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import axios, { type AxiosError } from 'axios'; @@ -16,7 +16,18 @@ import App from './App.vue'; import './style.css'; /* add icons to the library */ -library.add(faCirclePlus, faPencil, faWarning, faFile, faArrowsRotate, faCircleCheck, faCircle, faClock); +library.add( + faCirclePlus, + faPencil, + faWarning, + faFile, + faArrowsRotate, + faCircleCheck, + faCircle, + faClock, + faEye, + faEyeSlash, +); axios.defaults.baseURL = import.meta.env.VITE_API_URL; axios.defaults.withCredentials = true; diff --git a/src/views/Me.vue b/src/views/Me.vue index 2eeee652..22168b97 100755 --- a/src/views/Me.vue +++ b/src/views/Me.vue @@ -10,6 +10,7 @@ import { import placeholder from '@/assets/images/logo_home.png'; import FormField from '@/components/FormField.vue'; import Modal from '@/components/Modal.vue'; +import PasswordInput from '@/components/PasswordInput.vue'; import type { PlayerRegistrationDeref } from '@/models/registration'; import type { Tournament } from '@/models/tournament'; import { useTournamentStore } from '@/stores/tournament.store'; @@ -490,15 +491,13 @@ const editField = (field: string) => { class="m-2 flex flex-col" label="Nouveau mot de passe" > - { class="m-2 flex flex-col" label="Confirmer le mot de passe" > - { class="m-2 flex flex-col" label="Mot de passe actuel" > -