|
1 | 1 | <template> |
2 | 2 | <div> |
3 | | - <img |
4 | | - class="mx-auto h-12 w-auto" |
5 | | - src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" |
6 | | - alt="Workflow" |
7 | | - /> |
8 | | - <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900"> |
9 | | - Register for free |
10 | | - </h2> |
11 | | - <p class="mt-2 text-center text-sm text-gray-600"> |
12 | | - Or |
13 | | - {{ " " }} |
14 | | - <router-link |
15 | | - :to="{ name: 'Login' }" |
16 | | - class="font-medium text-indigo-600 hover:text-indigo-500" |
| 3 | + <div> |
| 4 | + <img |
| 5 | + class="mx-auto h-12 w-auto" |
| 6 | + src="https://tailwindui.com/img/logos/workflow-mark-indigo-600.svg" |
| 7 | + alt="Workflow" |
| 8 | + /> |
| 9 | + <h2 class="mt-6 text-center text-3xl font-extrabold text-gray-900"> |
| 10 | + Register for free |
| 11 | + </h2> |
| 12 | + <p class="mt-2 text-center text-sm text-gray-600"> |
| 13 | + Or |
| 14 | + {{ " " }} |
| 15 | + <router-link |
| 16 | + :to="{ name: 'Login' }" |
| 17 | + class="font-medium text-indigo-600 hover:text-indigo-500" |
| 18 | + > |
| 19 | + login to your account |
| 20 | + </router-link> |
| 21 | + </p> |
| 22 | + </div> |
| 23 | + <form class="mt-8 space-y-6" @submit="register"> |
| 24 | + <Alert |
| 25 | + v-if="Object.keys(errors).length" |
| 26 | + class="flex-col items-stretch text-sm" |
17 | 27 | > |
18 | | - login to your account |
19 | | - </router-link> |
20 | | - </p> |
21 | | - </div> |
22 | | - <form class="mt-8 space-y-6" @submit="register"> |
23 | | - <Alert v-if="Object.keys(errors).length" class="flex-col items-stretch text-sm"> |
24 | | - <div v-for="(field, i) of Object.keys(errors)" :key="i"> |
25 | | - <div v-for="(error, ind) of errors[field] || []" :key="ind"> |
26 | | - * {{ error }} |
| 28 | + <div v-for="(field, i) of Object.keys(errors)" :key="i"> |
| 29 | + <div v-for="(error, ind) of errors[field] || []" :key="ind"> |
| 30 | + * {{ error }} |
| 31 | + </div> |
27 | 32 | </div> |
28 | | - </div> |
29 | | - </Alert> |
| 33 | + </Alert> |
30 | 34 |
|
31 | | - <input type="hidden" name="remember" value="true" /> |
32 | | - <div class="rounded-md shadow-sm -space-y-px"> |
33 | | - <div> |
34 | | - <label for="fullname" class="sr-only">Email address</label> |
35 | | - <input |
36 | | - id="fullname" |
| 35 | + <input type="hidden" name="remember" value="true" /> |
| 36 | + <div class="rounded-md shadow-sm -space-y-px"> |
| 37 | + <TInput |
37 | 38 | name="name" |
38 | | - type="text" |
39 | | - autocomplete="name" |
40 | | - required="" |
41 | 39 | v-model="user.name" |
42 | | - class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" |
43 | | - placeholder="Full name" |
| 40 | + :errors="errors" |
| 41 | + placeholder="Full Name" |
| 42 | + inputClass="rounded-t-md" |
44 | 43 | /> |
45 | | - </div> |
46 | | - <div> |
47 | | - <label for="email-address" class="sr-only">Email address</label> |
48 | | - <input |
49 | | - id="email-address" |
50 | | - name="email" |
| 44 | + <TInput |
51 | 45 | type="email" |
52 | | - autocomplete="email" |
53 | | - required="" |
| 46 | + name="email" |
54 | 47 | v-model="user.email" |
55 | | - class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" |
56 | | - :class="{ 'border-red-500': errors.email, 'z-10': errors.email }" |
57 | | - placeholder="Email address" |
| 48 | + :errors="errors" |
| 49 | + placeholder="Email Address" |
58 | 50 | /> |
59 | | - </div> |
60 | | - <div> |
61 | | - <label for="password" class="sr-only">Password</label> |
62 | | - <input |
63 | | - id="password" |
64 | | - name="password" |
| 51 | + <TInput |
65 | 52 | type="password" |
66 | | - autocomplete="current-password" |
67 | | - required="" |
| 53 | + name="password" |
68 | 54 | v-model="user.password" |
69 | | - class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" |
| 55 | + :errors="errors" |
70 | 56 | placeholder="Password" |
71 | | - :class="{ 'border-red-500': errors.password, 'z-10': errors.password }" |
72 | 57 | /> |
73 | | - </div> |
74 | | - <div> |
75 | | - <label for="password_confirmation" class="sr-only">Password</label> |
76 | | - <input |
77 | | - id="password_confirmation" |
78 | | - name="password_confirmation" |
| 58 | + <TInput |
79 | 59 | type="password" |
80 | | - autocomplete="current-password" |
81 | | - required="" |
| 60 | + name="password_confirmation" |
82 | 61 | v-model="user.password_confirmation" |
83 | | - class="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 focus:z-10 sm:text-sm" |
| 62 | + :errors="errors" |
84 | 63 | placeholder="Confirm Password" |
| 64 | + inputClass="rounded-b-md" |
85 | 65 | /> |
86 | 66 | </div> |
87 | | - </div> |
88 | | - |
89 | | - <div> |
90 | | - <TButtonLoading :loading="loading" class="w-full relative justify-center"> |
91 | | - Sign up |
92 | | - </TButtonLoading> |
93 | | - </div> |
94 | | - </form> |
| 67 | + <div> |
| 68 | + <TButtonLoading |
| 69 | + :loading="loading" |
| 70 | + class="w-full relative justify-center" |
| 71 | + > |
| 72 | + Sign up |
| 73 | + </TButtonLoading> |
| 74 | + </div> |
| 75 | + </form> |
| 76 | + </div> |
95 | 77 | </template> |
96 | 78 |
|
97 | 79 | <script setup> |
98 | 80 | import { ref } from "vue"; |
99 | 81 | import { LockClosedIcon } from "@heroicons/vue/solid"; |
100 | 82 | import store from "../store"; |
101 | 83 | import { useRouter } from "vue-router"; |
102 | | -import TButtonLoading from '../components/core/TButtonLoading.vue' |
| 84 | +import TButtonLoading from "../components/core/TButtonLoading.vue"; |
| 85 | +import TInput from "../components/core/TInput.vue"; |
103 | 86 | import Alert from "../components/Alert.vue"; |
104 | 87 |
|
105 | 88 | const router = useRouter(); |
|
0 commit comments