diff --git a/admin-spa/src/index.css b/admin-spa/src/index.css index 6dded1a..e3c6e76 100644 --- a/admin-spa/src/index.css +++ b/admin-spa/src/index.css @@ -65,6 +65,7 @@ @layer base { * { @apply border-border; } body { @apply bg-background text-foreground; } + h1, h2, h3, h4, h5, h6 { @apply text-foreground; } } /* Command palette input: remove native borders/shadows to match shadcn */ diff --git a/admin-spa/src/routes/More/index.tsx b/admin-spa/src/routes/More/index.tsx index 79197b1..8934830 100644 --- a/admin-spa/src/routes/More/index.tsx +++ b/admin-spa/src/routes/More/index.tsx @@ -1,10 +1,11 @@ import React, { useEffect } from 'react'; import { useNavigate, Link } from 'react-router-dom'; -import { Tag, Settings as SettingsIcon, ChevronRight, Minimize2, LogOut } from 'lucide-react'; +import { Tag, Settings as SettingsIcon, ChevronRight, Minimize2, LogOut, Sun, Moon, Monitor } from 'lucide-react'; import { __ } from '@/lib/i18n'; import { usePageHeader } from '@/contexts/PageHeaderContext'; import { useApp } from '@/contexts/AppContext'; import { Button } from '@/components/ui/button'; +import { useTheme } from '@/components/ThemeProvider'; interface MenuItem { icon: React.ReactNode; @@ -32,6 +33,7 @@ export default function MorePage() { const navigate = useNavigate(); const { setPageHeader, clearPageHeader } = usePageHeader(); const { isStandalone, exitFullscreen } = useApp(); + const { theme, setTheme } = useTheme(); useEffect(() => { setPageHeader(__('More')); @@ -48,6 +50,12 @@ export default function MorePage() { // Clear auth and redirect to login window.location.href = window.WNW_CONFIG?.wpAdminUrl || '/wp-admin'; }; + + const themeOptions = [ + { value: 'light', icon: , label: __('Light') }, + { value: 'dark', icon: , label: __('Dark') }, + { value: 'system', icon: , label: __('System') }, + ]; return (
@@ -80,6 +88,27 @@ export default function MorePage() { ))}
+ {/* Theme Selector */} +
+

{__('Appearance')}

+
+ {themeOptions.map((option) => ( + + ))} +
+
+ {/* Exit Fullscreen / Logout */}
{isStandalone ? ( diff --git a/admin-spa/src/routes/Settings/index.tsx b/admin-spa/src/routes/Settings/index.tsx index 1fb8627..10f16a3 100644 --- a/admin-spa/src/routes/Settings/index.tsx +++ b/admin-spa/src/routes/Settings/index.tsx @@ -1,32 +1,13 @@ -import React from 'react'; -import { __ } from '@/lib/i18n'; +import React, { useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; export default function SettingsIndex() { - return ( -
-

{__('WooNooW Settings')}

-

- {__('Configure WooNooW plugin settings and preferences.')} -

- -
-
-

{__('Plugin Configuration')}

-

- {__('Settings interface coming soon.')} -

-
- -
-

{__('Quick Links')}

-
-

- {__('WooCommerce Settings:')}{' '} - {__('Use the navigation menu to access General, Payments, Shipping, and other WooCommerce settings.')} -

-
-
-
-
- ); + const navigate = useNavigate(); + + useEffect(() => { + // Redirect to Store Details as the default settings page + navigate('/settings/store', { replace: true }); + }, [navigate]); + + return null; } \ No newline at end of file diff --git a/includes/Admin/Assets.php b/includes/Admin/Assets.php index 6d97362..e3fc648 100644 --- a/includes/Admin/Assets.php +++ b/includes/Admin/Assets.php @@ -47,6 +47,13 @@ class Assets { 'adminUrl' => admin_url('admin.php'), ]); wp_add_inline_script($handle, 'window.WNW_API = window.WNW_API || WNW_API;', 'after'); + + // WordPress REST API settings (for media upload compatibility) + wp_localize_script($handle, 'wpApiSettings', [ + 'root' => esc_url_raw(rest_url()), + 'nonce' => wp_create_nonce('wp_rest'), + ]); + wp_add_inline_script($handle, 'window.wpApiSettings = window.wpApiSettings || wpApiSettings;', 'after'); // Also expose compact global for convenience wp_localize_script($handle, 'wnw', [ @@ -134,6 +141,13 @@ class Assets { 'adminScreen' => 'woonoow', 'adminUrl' => admin_url('admin.php'), ]); + + // WordPress REST API settings (for media upload compatibility) + wp_localize_script($handle, 'wpApiSettings', [ + 'root' => esc_url_raw(rest_url()), + 'nonce' => wp_create_nonce('wp_rest'), + ]); + wp_localize_script($handle, 'WNW_STORE', self::store_runtime()); wp_add_inline_script($handle, 'window.WNW_STORE = window.WNW_STORE || WNW_STORE;', 'after');