fix: sh-admin dashboard bugs and UI polish (#56)

This commit is contained in:
Nivedin
2023-03-29 23:49:34 +05:30
committed by GitHub
parent b826b53cee
commit 885c0dc500
14 changed files with 815 additions and 591 deletions

View File

@@ -0,0 +1,71 @@
<template>
<HoppSmartModal
v-if="show"
dialog
title="Invite User"
@close="$emit('hide-modal')"
>
<template #body>
<div class="flex flex-col">
<input
id="inviteUserEmail"
v-model="email"
v-focus
class="input floating-input"
placeholder=" "
type="text"
autocomplete="off"
@keyup.enter="sendInvite"
/>
<label for="inviteUserEmail">Email Address</label>
</div>
</template>
<template #footer>
<span class="flex space-x-2">
<HoppButtonPrimary
label="Send Invite"
:loading="loadingState"
@click="sendInvite"
/>
<HoppButtonSecondary label="Cancel" outline filled @click="hideModal" />
</span>
</template>
</HoppSmartModal>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useToast } from '~/composables/toast';
const toast = useToast();
withDefaults(
defineProps<{
show: boolean;
loadingState: boolean;
}>(),
{
show: false,
loadingState: false,
}
);
const emit = defineEmits<{
(event: 'hide-modal'): void;
(event: 'send-invite', email: string): void;
}>();
const email = ref('');
const sendInvite = () => {
if (email.value.trim() === '') {
toast.error('Please enter a valid email address');
return;
}
emit('send-invite', email.value);
};
const hideModal = () => {
emit('hide-modal');
};
</script>