Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix help center page #56

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions app/components/help-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ import Select from "./selectOption";
import Image from "next/image";

function HelpCenter() {
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();

const form = event.currentTarget;
const email = (form.email as HTMLInputElement).value.trim();
const subject = (form.subject as HTMLSelectElement).value.trim();
const details = (form.details as HTMLTextAreaElement).value.trim();

if (!email || !subject || !details) {
alert("Please fill out all required fields.");
return;
}

alert("Form submitted successfully!");
};
return (
<main className="relative">
{/* <Navbar /> */}
Expand All @@ -23,7 +38,10 @@ function HelpCenter() {
our team will get back to you within 24-48 hours.
</p>
</div>
<form className="flex flex-col gap-y-10 text-start mb-20">
<form
className="flex flex-col gap-y-10 text-start mb-20"
onSubmit={handleSubmit}
>
<div className="flex flex-col gap-y-5">
<label htmlFor="email">
Your email address <span className="text-[#FC8181]">*</span>
Expand All @@ -32,6 +50,7 @@ function HelpCenter() {
type="text"
placeholder="Your email address"
className="p-[16px] rounded-full bg-[#100827]"
name="email"
/>
</div>
<div className="flex flex-col gap-y-5">
Expand All @@ -52,6 +71,7 @@ function HelpCenter() {
rows={7}
placeholder="Write your message here…"
className="px-[16px] py-[12px] bg-[#100827] rounded-2xl"
name="details"
/>
<p className="text-[14px]">
To provide the best assistance, please include as much detail
Expand All @@ -62,12 +82,23 @@ function HelpCenter() {
</div>
<div className="flex flex-col gap-y-5">
<p>Attachments(Optional)</p>
<label
htmlFor="attachments"
className="cursor-pointer py-3 px-6 bg-[#0F96E3] text-white rounded-full text-center block w-fit"
>
Choose Files
</label>
<input
type="upload"
placeholder="Add file or drop files here"
className="p-[16px] rounded-full bg-[#100827] text-center"
type="file"
id="attachments"
name="attachments"
className="hidden"
multiple
/>
</div>
<p className="text-[14px] text-[#D2CED8]">
Add file or drop files here.
</p>
<button
type="submit"
className="py-4 md:w-[309px] w-auto flex items-center justify-center bg-[#0F96E3] rounded-full text-[16px]"
Expand Down
3 changes: 2 additions & 1 deletion app/components/selectOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ function SelectOption() {
<select
value={percentage || ""}
onChange={handlePercentageChange}
className="p-[16px] bg-[#100827] rounded-3xl text-sm outline-none"
className="p-[16px] bg-[#100827] rounded-3xl text-sm outline-none border-r-8 border-[#100827]"
name="subject"
>
<option value="25%"></option>
<option value="50%"></option>
Expand Down
Loading