diff --git a/app/code-of-conduct/page.tsx b/app/code-of-conduct/page.tsx index 0593eb5..c370bd7 100644 --- a/app/code-of-conduct/page.tsx +++ b/app/code-of-conduct/page.tsx @@ -1,6 +1,6 @@ export default function CodeOfConductPage() { return ( -
+

Code of Conduct

diff --git a/app/contact/components/TestComponent.tsx b/app/contact/components/TestComponent.tsx deleted file mode 100644 index 2367947..0000000 --- a/app/contact/components/TestComponent.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function TestComponent() { - return ( -
-

Test Component

-
- ); -} diff --git a/app/contact/components/YourDetails.tsx b/app/contact/components/YourDetails.tsx new file mode 100644 index 0000000..829be31 --- /dev/null +++ b/app/contact/components/YourDetails.tsx @@ -0,0 +1,93 @@ +import { useEffect, useState } from 'react'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; + +export default function YourDetails() { + const [email, setEmail] = useState(''); + const [subject, setSubject] = useState(''); + const [message, setMessage] = useState(''); + const [isValid, setIsValid] = useState(false); + + useEffect(() => { + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + const isFormValid = + emailRegex.test(email.trim()) && + subject.trim().length > 0 && + message.trim().length > 0; + + setIsValid(isFormValid); + }, [email, subject, message]); + + return ( +
+ + Your details + + + {/* Email Input */} +
+ + setEmail(e.target.value)} + /> +
+ + {/* Subject Input */} +
+ + setSubject(e.target.value)} + /> +
+ + {/* Message Textarea */} +
+ +