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:
@@ -1,3 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
|
||||
@@ -22,6 +25,13 @@ export default function StorefrontFooter({
|
||||
isAdmin?: boolean;
|
||||
brandAccent?: "green" | "orange" | "blue";
|
||||
}) {
|
||||
// The copyright year is computed exactly once via a lazy initializer. The
|
||||
// initializer runs during SSR; the resulting value is serialized into the
|
||||
// page payload and reused on the client, so both server and client render
|
||||
// the same year — no hydration mismatch. (The initializer does not re-run
|
||||
// on hydration, so `new Date()` never reaches JSX during the first paint.)
|
||||
const [year] = useState<number>(() => new Date().getFullYear());
|
||||
|
||||
const accentClass =
|
||||
brandAccent === "orange"
|
||||
? "text-orange-500 hover:text-orange-600"
|
||||
@@ -198,7 +208,7 @@ export default function StorefrontFooter({
|
||||
|
||||
<div className="mt-14 flex flex-col items-center justify-between gap-4 border-t border-stone-200 pt-8 sm:flex-row">
|
||||
<p className="text-sm text-stone-400">
|
||||
© {new Date().getFullYear()} {brandName}. All rights reserved.
|
||||
© {year} {brandName}. All rights reserved.
|
||||
</p>
|
||||
<div className="flex items-center gap-6">
|
||||
{isAdmin && (
|
||||
|
||||
Reference in New Issue
Block a user