fix: react-doctor prefer-module-scope-static-value 15→~5 (move static values to module scope, remove dead Section)

This commit is contained in:
Nora
2026-06-26 05:33:52 -06:00
parent 13d15883b1
commit 6547498ea4
26 changed files with 187 additions and 193 deletions
+14 -33
View File
@@ -3,6 +3,12 @@
import Link from "next/link";
import React, { useState } from "react";
const navLinks = [
{ label: "Features", href: "#features" },
{ label: "Stats", href: "#stats" },
{ label: "Reviews", href: "#reviews" }, // anchors added to HeroSection sections (fixes missing id issue)
];
// ============================================
// HEADER COMPONENT
// ============================================
@@ -10,15 +16,9 @@ interface HeaderProps {
className?: string;
}
export function Header({ className = "" }: HeaderProps) {
function Header({ className = "" }: HeaderProps) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const navLinks = [
{ label: "Features", href: "#features" },
{ label: "Stats", href: "#stats" },
{ label: "Reviews", href: "#reviews" }, // anchors added to HeroSection sections (fixes missing id issue)
];
return (
<header
className={`sticky top-0 z-50 backdrop-blur-md bg-[#faf8f5]/90 border-b border-[#6b8f71]/20 shadow-sm ${className}`}
@@ -172,11 +172,17 @@ export function Header({ className = "" }: HeaderProps) {
// ============================================
// FOOTER COMPONENT
// ============================================
const footerLinks = [
{ label: "Privacy", href: "/privacy-policy" },
{ label: "Terms", href: "/terms-and-conditions" },
{ label: "Contact", href: "/contact" },
];
interface FooterProps {
className?: string;
}
export function Footer({ className = "" }: FooterProps) {
function Footer({ className = "" }: FooterProps) {
// 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
@@ -184,12 +190,6 @@ export function Footer({ className = "" }: FooterProps) {
// on hydration, so `new Date()` never reaches JSX during the first paint.)
const [year] = useState<number>(() => new Date().getFullYear());
const footerLinks = [
{ label: "Privacy", href: "/privacy-policy" },
{ label: "Terms", href: "/terms-and-conditions" },
{ label: "Contact", href: "/contact" },
];
return (
<footer
className={`w-full py-12 border-t border-[#e8e4dc] bg-[#faf8f5] ${className}`}
@@ -386,25 +386,6 @@ export function LandingPageWrapper({ children, className = "" }: WrapperProps) {
);
}
// ============================================
// UTILITY: Section Wrapper
// ============================================
export function Section({
children,
className = "",
id,
}: {
children?: React.ReactNode;
className?: string;
id?: string;
}) {
return (
<section id={id} className={`relative z-10 ${className}`}>
{children}
</section>
);
}
// ============================================
// DEFAULT EXPORT: Complete Landing Page
// ============================================