mirror of https://github.com/Lukibeg/OmniBoard.git
83 lines
2.9 KiB
Vue
83 lines
2.9 KiB
Vue
<script setup>
|
|
import InputError from '@/Components/InputError.vue';
|
|
import InputLabel from '@/Components/InputLabel.vue';
|
|
import PrimaryButton from '@/Components/PrimaryButton.vue';
|
|
import TextInput from '@/Components/TextInput.vue';
|
|
import { Link, useForm, usePage } from '@inertiajs/vue3';
|
|
|
|
defineProps({
|
|
mustVerifyEmail: {
|
|
type: Boolean,
|
|
},
|
|
status: {
|
|
type: String,
|
|
},
|
|
});
|
|
|
|
const user = usePage().props.auth.user;
|
|
|
|
const form = useForm({
|
|
name: user.name,
|
|
email: user.email,
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<section>
|
|
<header>
|
|
<h2 class="text-lg font-medium text-gray-900">
|
|
Informação de perfil
|
|
</h2>
|
|
|
|
<p class="mt-1 text-sm text-gray-600">
|
|
Atualize as informações do seu perfil e o seu endereço de e-mail.
|
|
</p>
|
|
</header>
|
|
|
|
<form @submit.prevent="form.patch(route('profile.update'))" class="mt-6 space-y-6">
|
|
<div>
|
|
<InputLabel for="name" value="Nome" />
|
|
|
|
<TextInput id="name" type="text" class="mt-1 block w-full" v-model="form.name" required autofocus
|
|
autocomplete="name" />
|
|
|
|
<InputError class="mt-2" :message="form.errors.name" />
|
|
</div>
|
|
|
|
<div>
|
|
<InputLabel for="email" value="Email" />
|
|
|
|
<TextInput id="email" type="email" class="mt-1 block w-full" v-model="form.email" required
|
|
autocomplete="username" />
|
|
|
|
<InputError class="mt-2" :message="form.errors.email" />
|
|
</div>
|
|
|
|
<div v-if="mustVerifyEmail && user.email_verified_at === null">
|
|
<p class="mt-2 text-sm text-gray-800">
|
|
Seu e-mail não está verificado.
|
|
<Link :href="route('verification.send')" method="post" as="button"
|
|
class="rounded-md text-sm text-gray-600 underline hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
Clique aqui para reenviar sua verificação de e-mail.
|
|
</Link>
|
|
</p>
|
|
|
|
<div v-show="status === 'verification-link-sent'" class="mt-2 text-sm font-medium text-green-600">
|
|
Um novo link de verificação foi enviado com sucesso para seu e-mail.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex items-center gap-4">
|
|
<PrimaryButton :disabled="form.processing">Salvar</PrimaryButton>
|
|
|
|
<Transition enter-active-class="transition ease-in-out" enter-from-class="opacity-0"
|
|
leave-active-class="transition ease-in-out" leave-to-class="opacity-0">
|
|
<p v-if="form.recentlySuccessful" class="text-sm text-gray-600">
|
|
Alteração concluída!
|
|
</p>
|
|
</Transition>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</template>
|