fix(UX): added description to which says press enter to add email

This commit is contained in:
Shariq Ansari 2025-03-12 16:59:55 +05:30
parent f8394c32a4
commit 5b99863974
2 changed files with 13 additions and 5 deletions

View File

@ -11,7 +11,7 @@
:label="value" :label="value"
theme="gray" theme="gray"
variant="subtle" variant="subtle"
class="rounded bg-surface-gray-3 group-hover:bg-surface-gray-4 focus-visible:ring-outline-gray-4" class="rounded bg-surface-white hover:!bg-surface-gray-1 focus-visible:ring-outline-gray-4"
@keydown.delete.capture.stop="removeLastValue" @keydown.delete.capture.stop="removeLastValue"
> >
<template #suffix> <template #suffix>
@ -35,6 +35,9 @@
</div> </div>
</div> </div>
<ErrorMessage class="mt-2 pl-2" v-if="error" :message="error" /> <ErrorMessage class="mt-2 pl-2" v-if="error" :message="error" />
<p v-if="description" class="text-xs text-ink-gray-5 mt-1.5">
{{ description }}
</p>
</div> </div>
</template> </template>
@ -46,6 +49,10 @@ const props = defineProps({
type: Function, type: Function,
default: null, default: null,
}, },
description: {
type: String,
default: '',
},
errorMessage: { errorMessage: {
type: Function, type: Function,
default: (value) => `${value} is an Invalid value`, default: (value) => `${value} is an Invalid value`,

View File

@ -14,6 +14,7 @@
:error-message=" :error-message="
(value) => __('{0} is an invalid email address', [value]) (value) => __('{0} is an invalid email address', [value])
" "
:description="__('Press enter to add email')"
/> />
<FormControl <FormControl
type="select" type="select"
@ -26,7 +27,6 @@
]" ]"
:description="description" :description="description"
/> />
<ErrorMessage class="mt-2" v-if="error" :message="error" />
</div> </div>
<template v-if="pendingInvitations.data?.length && !invitees.length"> <template v-if="pendingInvitations.data?.length && !invitees.length">
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4">
@ -67,7 +67,8 @@
</div> </div>
</template> </template>
</div> </div>
<div class="flex flex-row-reverse"> <div class="flex justify-between items-center gap-2">
<div><ErrorMessage v-if="error" :message="error" /></div>
<Button <Button
:label="__('Send Invites')" :label="__('Send Invites')"
variant="solid" variant="solid"
@ -120,8 +121,8 @@ const inviteByEmail = createResource({
error.value = null error.value = null
pendingInvitations.reload() pendingInvitations.reload()
}, },
onError(error) { onError(err) {
error.value = error error.value = err?.messages?.[0]
}, },
}) })