@@ -216,7 +216,7 @@ export default function SecretaryLayout({ children }: PatientLayoutProps) {
*/}
diff --git a/components/theme-initializer.tsx b/components/theme-initializer.tsx
new file mode 100644
index 0000000..cfa2fca
--- /dev/null
+++ b/components/theme-initializer.tsx
@@ -0,0 +1,32 @@
+import Script from 'next/script';
+
+const themeScript = `
+(function() {
+ try {
+ const theme = localStorage.getItem('accessibility-theme') || 'light';
+ const contrast = localStorage.getItem('accessibility-contrast') || 'normal';
+ const fontSize = localStorage.getItem('accessibility-font-size') || '16';
+
+ const root = document.documentElement;
+
+ // Clear previous theme classes
+ root.classList.remove('light', 'dark', 'high-contrast');
+
+ // Add new theme classes
+ root.classList.add(theme);
+ if (contrast === 'high') {
+ root.classList.add('high-contrast');
+ }
+
+ // Set font size
+ root.style.fontSize = fontSize + 'px';
+
+ } catch (e) {
+ console.error('Failed to apply theme from localStorage', e);
+ }
+})();
+`;
+
+export function ThemeInitializer() {
+ return ;
+}
diff --git a/package-lock.json b/package-lock.json
index bea8963..b156fbb 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2499,14 +2499,14 @@
"version": "15.7.15",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz",
"integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/@types/react": {
"version": "18.3.24",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.24.tgz",
"integrity": "sha512-0dLEBsA1kI3OezMBF8nSsb7Nk19ZnsyE1LLhB8r27KbgU5H4pvuqZLdtE+aUkJVoXgTVuA+iLIwmZ0TuK4tx6A==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@types/prop-types": "*",
@@ -2517,7 +2517,7 @@
"version": "18.3.7",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz",
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"peerDependencies": {
"@types/react": "^18.0.0"
@@ -3579,7 +3579,6 @@
"version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
"integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
- "dev": true,
"funding": [
{
"type": "opencollective",
@@ -4126,7 +4125,6 @@
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.13.tgz",
"integrity": "sha512-i+zidfmTqtwquj4hMEwdjshYYgMbOrPzb9a0M3ZgNa0JMoZeFC6bxZvO8yr8ozS6ix2SDz0+mvryPeBs2TFE+w==",
- "dev": true,
"license": "MIT"
},
"node_modules/tailwindcss-animate": {