feat: update testimonial popup text and improve form layout

This commit is contained in:
Rasyid
2025-06-19 12:46:34 +07:00
parent 74046efebe
commit b3bf575402
@@ -39,7 +39,7 @@ export function TestimonialPopup() {
</DialogTrigger> </DialogTrigger>
<DialogContent className="max-w-3xl max-h-[90vh] overflow-y-auto"> <DialogContent className="max-w-3xl max-h-[90vh] overflow-y-auto">
<DialogHeader className="pb-2"> <DialogHeader className="pb-2">
<DialogTitle>Tambah Testimoni</DialogTitle> <DialogTitle>Tulis Testimoni</DialogTitle>
</DialogHeader> </DialogHeader>
<TestimonialForm setOpen={setOpen} /> <TestimonialForm setOpen={setOpen} />
</DialogContent> </DialogContent>
@@ -50,11 +50,11 @@ export function TestimonialPopup() {
return ( return (
<Drawer open={open} onOpenChange={setOpen}> <Drawer open={open} onOpenChange={setOpen}>
<DrawerTrigger asChild> <DrawerTrigger asChild>
<Button className="w-full">Tambah Testimoni</Button> <Button>Tambah Testimoni</Button>
</DrawerTrigger> </DrawerTrigger>
<DrawerContent className="max-h-[85vh]"> <DrawerContent className="max-h-[85vh]">
<DrawerHeader className="pb-0"> <DrawerHeader className="pb-0">
<DrawerTitle>Tambah Testimoni</DrawerTitle> <DrawerTitle>Tulis Testimoni</DrawerTitle>
</DrawerHeader> </DrawerHeader>
<div className="overflow-y-auto px-4"> <div className="overflow-y-auto px-4">
<TestimonialForm setOpen={setOpen} className="py-2" /> <TestimonialForm setOpen={setOpen} className="py-2" />
@@ -83,7 +83,6 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
name: '', name: '',
email: '', email: '',
role: '', role: '',
company: '',
testimonial: '', testimonial: '',
}); });
@@ -152,7 +151,6 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
name: '', name: '',
email: '', email: '',
role: '', role: '',
company: '',
testimonial: '', testimonial: '',
}); });
if (fileInputRef.current) fileInputRef.current.value = ''; if (fileInputRef.current) fileInputRef.current.value = '';
@@ -160,26 +158,16 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
return ( return (
<div className={cn('w-full', className)}> <div className={cn('w-full', className)}>
{/* Progress Bar */}
<div className="mb-4">
<div className="flex items-center justify-between mb-1">
<span className="text-xs font-medium">Langkah {step} dari 2</span>
</div>
<div className="w-full bg-secondary rounded-full h-1.5">
<div
className="bg-primary h-1.5 rounded-full transition-all duration-300"
style={{ width: `${(step / 2) * 100}%` }}
></div>
</div>
</div>
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<div className="relative"> <div className="relative">
{step === 1 && ( {step === 1 && (
<div className="w-full"> <div className="w-full">
<div className="pb-3 border-b mb-4"> {/* Section header with step info aligned using justify-between */}
<h3 className="text-lg font-semibold">Data Diri</h3> <div className="flex justify-between items-center pb-3 border-b mb-4">
<p className="text-xs text-muted-foreground mt-1">1/2</p> <h3 className="text-base font-semibold">Lengkapi Data Diri</h3>
<span className="text-sm text-muted-foreground">
Langkah 1 dari 2
</span>
</div> </div>
<div className="space-y-6"> <div className="space-y-6">
@@ -254,24 +242,11 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
label: 'Role', label: 'Role',
placeholder: 'Backend Developer', placeholder: 'Backend Developer',
required: true, required: true,
optional: false,
},
{
id: 'company',
label: 'Perusahaan',
placeholder: 'Nama perusahaan',
required: false,
optional: true,
}, },
].map((field) => ( ].map((field) => (
<div key={field.id} className="space-y-1"> <div key={field.id} className="space-y-1">
<Label htmlFor={field.id} className="text-sm"> <Label htmlFor={field.id} className="text-sm">
{field.label} {field.label}
{field.optional && (
<span className="text-muted-foreground font-normal ml-1 text-xs">
(opsional)
</span>
)}
</Label> </Label>
<Input <Input
id={field.id} id={field.id}
@@ -305,9 +280,12 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
{step === 2 && ( {step === 2 && (
<div className="w-full"> <div className="w-full">
<div className="pb-3 border-b mb-4"> {/* Section header with step info aligned using justify-between */}
<h3 className="text-lg font-semibold">Ulasan</h3> <div className="flex justify-between items-center pb-3 border-b mb-4">
<p className="text-xs text-muted-foreground mt-1">2/2</p> <h3 className="text-base font-semibold">Ulasan</h3>
<span className="text-sm text-muted-foreground">
Langkah 2 dari 2
</span>
</div> </div>
<div className="space-y-6"> <div className="space-y-6">
@@ -323,7 +301,7 @@ function TestimonialForm({ className, setOpen }: TestimonialFormProps) {
<Textarea <Textarea
id="testimonial" id="testimonial"
placeholder="Bagaimana pengalaman Anda menggunakan layanan kami?" placeholder="Bagaimana pengalaman Anda bersama IMPHNEN?"
className={cn( className={cn(
'min-h-[140px]', 'min-h-[140px]',
testimonialError && 'border-destructive' testimonialError && 'border-destructive'