fix contact form and linking and favicon

This commit is contained in:
jwinterm
2026-02-12 22:33:28 -05:00
parent 22c0c03c6c
commit 6a3e609c41
5 changed files with 38 additions and 2 deletions
@@ -0,0 +1,25 @@
'use client';
import { useTheme } from 'next-themes';
import { useEffect } from 'react';
export function DynamicFavicon() {
const { resolvedTheme } = useTheme();
useEffect(() => {
if (!resolvedTheme) return;
const variant = resolvedTheme === 'dark' ? 'dark' : 'light';
// Update all favicon link elements
const links = document.querySelectorAll<HTMLLinkElement>('link[rel="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]');
links.forEach((link) => {
const href = link.getAttribute('href');
if (href?.includes('/images/branding/favicon_')) {
link.href = href.replace(/favicon_(dark|light)/, `favicon_${variant}`);
}
});
}, [resolvedTheme]);
return null;
}