Pull Request branch dev-clone to main #1
|
|
@ -13,16 +13,16 @@ import client from "../../honoClient";
|
|||
|
||||
// Define the schema for validation
|
||||
const formSchema = z.object({
|
||||
name: z.string().min(1, "This field is required"),
|
||||
username: z.string().min(1, "This field is required"),
|
||||
email: z.string().email("Invalid email address").min(1, "This field is required"),
|
||||
password: z.string().min(6, "Password must be at least 6 characters long"),
|
||||
companyName: z.string().min(1, "This field is required"),
|
||||
position: z.string().min(1, "This field is required"),
|
||||
workExperience: z.string().min(1, "This field is required"),
|
||||
address: z.string().min(1, "This field is required"),
|
||||
phoneNumber: z.string().min(1, "This field is required"),
|
||||
terms: z.boolean().refine((val) => val, "You must agree to the terms and services"),
|
||||
name: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
username: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
email: z.string().email("Alamat email tidak valid").min(1, "Kolom ini wajib diisi"),
|
||||
password: z.string().min(6, "Kata sandi harus minimal 6 karakter"),
|
||||
companyName: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
position: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
workExperience: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
address: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
phoneNumber: z.string().min(1, "Kolom ini wajib diisi"),
|
||||
terms: z.boolean().refine((val) => val, "Anda harus menyetujui persyaratan dan layanan"),
|
||||
});
|
||||
|
||||
// Define the form type
|
||||
|
|
@ -71,14 +71,14 @@ export default function RegisterPage() {
|
|||
} catch (error: any) {
|
||||
const message = error.message;
|
||||
|
||||
if (message.includes("Email or username has been registered")) {
|
||||
if (message.includes("Email atau username sudah terdaftar")) {
|
||||
setErrorFields({
|
||||
email: "Email is already registered",
|
||||
username: "Username is already registered",
|
||||
});
|
||||
} else if (message.includes("Phone number has been registered")) {
|
||||
} else if (message.includes("Nomor telepon sudah terdaftar")) {
|
||||
setErrorFields({
|
||||
phoneNumber: "Phone number is already registered",
|
||||
phoneNumber: "Nomor telepon sudah terdaftar",
|
||||
});
|
||||
} else {
|
||||
setErrorMessage(message);
|
||||
|
|
@ -98,9 +98,9 @@ export default function RegisterPage() {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{/* Title */}
|
||||
<div className="absolute top-6 left-6 text-base font-bold">
|
||||
Amati
|
||||
{/* Logo */}
|
||||
<div className="absolute top-7 left-6">
|
||||
<img src="../src/assets/logos/amati-logo.png" alt="Amati Logo" className="h-4 w-full object-contain" />
|
||||
</div>
|
||||
|
||||
{/* Main content */}
|
||||
|
|
@ -111,9 +111,9 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Title and Already have an account */}
|
||||
<div className="flex flex-col gap-1 mb-7">
|
||||
<h1 className="text-3xl lg:text-4xl font-extrabold text-left">Register an Account</h1>
|
||||
<h1 className="text-3xl lg:text-4xl font-extrabold text-left">Daftar Akun</h1>
|
||||
<p className="text-sm md:text-sm text-gray-400">
|
||||
Already have an account?{' '}
|
||||
Sudah punya akun?{' '}
|
||||
<a href="/login" className="text-blue-500 font-semibold hover:text-blue-800">
|
||||
Sign In now
|
||||
</a>
|
||||
|
|
@ -138,21 +138,22 @@ export default function RegisterPage() {
|
|||
|
||||
{/* Form fields */}
|
||||
<div className="space-y-4">
|
||||
<FormField name="name" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Full Name</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Insert your full name according to Citizenship Card"
|
||||
{...field}
|
||||
className={`${form.formState.errors.name ? "border-red-500" : ""
|
||||
} text-sm md:text-base`}
|
||||
style={{ width: "100%" }}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)} />
|
||||
<div className="space-y-4">
|
||||
<FormField name="name" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Nama Lengkap</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Masukkan nama lengkap sesuai dengan Kartu Identitas"
|
||||
{...field}
|
||||
className={`${form.formState.errors.name ? "border-red-500" : ""} truncate text-sm md:text-base`}
|
||||
style={{ width: "100%" }}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)} />
|
||||
</div>
|
||||
|
||||
<FormField name="username" render={({ field }) => (
|
||||
<FormItem>
|
||||
|
|
@ -200,10 +201,10 @@ export default function RegisterPage() {
|
|||
|
||||
<FormField name="companyName" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Company Name</FormLabel>
|
||||
<FormLabel className="font-bold text-sm">Nama Perusahaan</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Company Name"
|
||||
placeholder="Nama Perusahaan"
|
||||
{...field}
|
||||
className={form.formState.errors.companyName ? "border-red-500" : ""}
|
||||
/>
|
||||
|
|
@ -214,10 +215,10 @@ export default function RegisterPage() {
|
|||
|
||||
<FormField name="position" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Position</FormLabel>
|
||||
<FormLabel className="font-bold text-sm">Jabatan</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Position"
|
||||
placeholder="Jabatan"
|
||||
{...field}
|
||||
className={form.formState.errors.position ? "border-red-500" : ""}
|
||||
/>
|
||||
|
|
@ -228,10 +229,10 @@ export default function RegisterPage() {
|
|||
|
||||
<FormField name="workExperience" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Work Experience</FormLabel>
|
||||
<FormLabel className="font-bold text-sm">Pengalaman Kerja</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Work Experience"
|
||||
placeholder="Pengalaman Kerja"
|
||||
{...field}
|
||||
className={form.formState.errors.workExperience ? "border-red-500" : ""}
|
||||
/>
|
||||
|
|
@ -242,10 +243,10 @@ export default function RegisterPage() {
|
|||
|
||||
<FormField name="address" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Address</FormLabel>
|
||||
<FormLabel className="font-bold text-sm">Alamat</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Address"
|
||||
placeholder="Alamat"
|
||||
{...field}
|
||||
className={form.formState.errors.address ? "border-red-500" : ""}
|
||||
/>
|
||||
|
|
@ -256,10 +257,10 @@ export default function RegisterPage() {
|
|||
|
||||
<FormField name="phoneNumber" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="font-bold text-sm">Phone Number</FormLabel>
|
||||
<FormLabel className="font-bold text-sm">Nomor Telepon</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="Phone Number"
|
||||
placeholder="Nomor Telepon"
|
||||
{...field}
|
||||
className={form.formState.errors.phoneNumber ? "border-red-500" : ""}
|
||||
/>
|
||||
|
|
@ -289,7 +290,7 @@ export default function RegisterPage() {
|
|||
htmlFor="terms"
|
||||
className="text-sm font-normal leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-[#00000099] p-2 rounded"
|
||||
>
|
||||
I am agree to Terms and Services
|
||||
Saya setuju dengan syarat dan layanan
|
||||
</label>
|
||||
</div>
|
||||
</FormControl>
|
||||
|
|
@ -307,7 +308,7 @@ export default function RegisterPage() {
|
|||
type="submit"
|
||||
className="w-full flex items-center justify-between text-base font-medium md:w-auto bg-[--primary-color] text-white"
|
||||
>
|
||||
<span className="flex-grow text-left">Create Account</span>
|
||||
<span className="flex-grow text-left">Daftar Akun</span>
|
||||
<TbArrowNarrowRight className="ml-12 h-5 w-5" />
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user