mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: make Company field required in contact form
This commit is contained in:
@@ -38,15 +38,9 @@ export default function ContactPage() {
|
|||||||
function handleSubmit(e: FormEvent) {
|
function handleSubmit(e: FormEvent) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const lines = [
|
const lines = [`Name: ${name}`, `Company: ${company}`, `Email: ${email}`, "", message].join(
|
||||||
`Name: ${name}`,
|
"\n",
|
||||||
company ? `Company: ${company}` : "",
|
);
|
||||||
`Email: ${email}`,
|
|
||||||
"",
|
|
||||||
message,
|
|
||||||
]
|
|
||||||
.filter(Boolean)
|
|
||||||
.join("\n");
|
|
||||||
|
|
||||||
const mailto = `mailto:contact@snapotter.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(lines)}`;
|
const mailto = `mailto:contact@snapotter.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(lines)}`;
|
||||||
window.location.href = mailto;
|
window.location.href = mailto;
|
||||||
@@ -129,11 +123,12 @@ export default function ContactPage() {
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="company" className="mb-1.5 block text-sm font-medium">
|
<label htmlFor="company" className="mb-1.5 block text-sm font-medium">
|
||||||
Company
|
Company <span className="text-accent">*</span>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
id="company"
|
id="company"
|
||||||
type="text"
|
type="text"
|
||||||
|
required
|
||||||
value={company}
|
value={company}
|
||||||
onChange={(e) => setCompany(e.target.value)}
|
onChange={(e) => setCompany(e.target.value)}
|
||||||
className="w-full rounded-lg border border-border bg-background px-4 py-2.5 text-sm outline-none transition-colors focus:border-accent focus:ring-1 focus:ring-accent"
|
className="w-full rounded-lg border border-border bg-background px-4 py-2.5 text-sm outline-none transition-colors focus:border-accent focus:ring-1 focus:ring-accent"
|
||||||
|
|||||||
Reference in New Issue
Block a user