feat: improve registration UX by coloring Next button based on form validity (#8233)

Co-authored-by: jl1204 <jl1204@students.waikato.ac.nz>
This commit is contained in:
Luna-81andjl1204 authored and GitHub committed 2026-08-30 18:30:14 +00:00
1 parent 4928a9788b
commit 6e89e63e2e
2 files changed
+16 -1

No files matched your search

@@ -13,6 +13,7 @@
<v-card-text class="mt-2">
<v-form
ref="domAccountForm"
v-model="isFormValid"
@submit.prevent
>
<v-text-field
@@ -91,6 +92,8 @@ const inputAttrs = {
class: "pb-1",
variant: "solo-filled" as any,
};
const emit = defineEmits(["update:modelValue"]);
const isFormValid = ref(false);
const pwFields = usePasswordField();
const {
@@ -102,6 +105,13 @@ const {
validateEmail,
domAccountForm,
} = useUserRegistrationForm();
watch(
isFormValid,
(val) => {
emit("update:modelValue", val);
},
{ immediate: true },
);
</script>
<style lang="css" scoped>
+6 -1
View File
@@ -146,6 +146,7 @@
<v-card-text>
<v-form
ref="domGroupForm"
v-model="isGroupFormValid"
@submit.prevent
>
<v-text-field
@@ -189,6 +190,7 @@
</BaseButton>
<BaseButton
icon-right
:disabled="!isGroupFormValid || !groupNameValid"
@click="groupDetails.next"
>
<template #icon>
@@ -202,7 +204,7 @@
<template v-else-if="state.ctx.state === States.ProvideAccountDetails">
<div>
<UserRegistrationForm />
<UserRegistrationForm v-model="isAccountFormValid" />
<v-divider />
<v-card-actions class="justify-space-between">
<BaseButton
@@ -216,6 +218,7 @@
</BaseButton>
<BaseButton
icon-right
:disabled="!isAccountFormValid"
@click="accountDetailsNext"
>
<template #icon>
@@ -384,6 +387,7 @@ const provideToken = {
// Provide Group Details
const publicApi = usePublicApi();
const domGroupForm = ref<VForm | null>(null);
const isGroupFormValid = ref(false);
const groupName = ref("");
const groupSeed = ref(false);
const groupPrivate = ref(false);
@@ -420,6 +424,7 @@ const groupDetails = {
},
};
const isAccountFormValid = ref(false);
const {
accountDetails,
credentials,