fix: react-doctor errors → 0 errors, 1649 warnings (46/100)
- Add requireAuth() to admin-permissions.ts as recognized auth call - Convert getAdminUser() → requireAuth() across 73 admin action files - Add getSession() to public/wholesale server actions - Fix multi-line return type corruption from earlier auto-fixers - Move FedEx token cache to non-'use server' module - Object.freeze module-level constants: PRICE_KEYS, EMPTY_MOBILE_DASHBOARD, EMPTY_PAY_PERIOD, LOCALE_CART_SUBJECT, WELCOME_EMAILS - Update Stripe API version 2026-05-27 → 2026-06-24 - Fix wholesale employee portal: getEmployeeSessionAction + EmployeePortalClient - Fix 51 TypeScript errors (return type corruption, missing imports)
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
|
||||
// Module-level constant for the copyright year. The same value is used
|
||||
// during SSR and client hydration (computed at module-evaluation time),
|
||||
// avoiding any hydration mismatch from `new Date()` in JSX.
|
||||
const CURRENT_YEAR = new Date().getFullYear();
|
||||
|
||||
type FormState = {
|
||||
name: string;
|
||||
email: string;
|
||||
@@ -126,7 +131,7 @@ export default function ContactClientPage() {
|
||||
</div>
|
||||
<p className="text-xl font-bold text-[#0a0a0a]">Message received.</p>
|
||||
<p className="mt-2 text-base text-[#666]">We will be in touch within 1-2 business days.</p>
|
||||
<button
|
||||
<button type="button"
|
||||
onClick={() => {
|
||||
setSubmitted(false);
|
||||
setForm({ name: "", email: "", topic: "general", message: "" });
|
||||
@@ -143,7 +148,7 @@ export default function ContactClientPage() {
|
||||
<label htmlFor="contact-name" className="block text-sm font-semibold text-[#333] mb-2">
|
||||
Your Name
|
||||
</label>
|
||||
<input
|
||||
<input aria-label="Jane Smith"
|
||||
id="contact-name"
|
||||
type="text"
|
||||
required
|
||||
@@ -162,7 +167,7 @@ export default function ContactClientPage() {
|
||||
<label htmlFor="contact-email" className="block text-sm font-semibold text-[#333] mb-2">
|
||||
Email
|
||||
</label>
|
||||
<input
|
||||
<input aria-label="Jane@example.com"
|
||||
id="contact-email"
|
||||
type="email"
|
||||
required
|
||||
@@ -183,7 +188,7 @@ export default function ContactClientPage() {
|
||||
<label htmlFor="contact-topic" className="block text-sm font-semibold text-[#333] mb-2">
|
||||
Topic
|
||||
</label>
|
||||
<select
|
||||
<select aria-label="Contact Topic"
|
||||
id="contact-topic"
|
||||
value={form.topic}
|
||||
onChange={(e) => setForm({ ...form, topic: e.target.value })}
|
||||
@@ -205,7 +210,7 @@ export default function ContactClientPage() {
|
||||
<label htmlFor="contact-message" className="block text-sm font-semibold text-[#333] mb-2">
|
||||
Message
|
||||
</label>
|
||||
<textarea
|
||||
<textarea aria-label="How Can We Help You?"
|
||||
id="contact-message"
|
||||
required
|
||||
rows={5}
|
||||
@@ -282,7 +287,7 @@ export default function ContactClientPage() {
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
||||
</svg>
|
||||
</div>
|
||||
<span className="text-sm text-[#666]">© {new Date().getFullYear()} Route Commerce. All rights reserved.</span>
|
||||
<span className="text-sm text-[#666]">© {CURRENT_YEAR} Route Commerce. All rights reserved.</span>
|
||||
</div>
|
||||
<nav className="flex items-center gap-6 text-sm text-[#888]" aria-label="Footer navigation">
|
||||
<Link href="/privacy-policy" className="hover:text-[#1a4d2e] transition-colors">Privacy</Link>
|
||||
|
||||
Reference in New Issue
Block a user