diff --git a/admin-spa/src/index.css b/admin-spa/src/index.css index e3c6e76..d457ffa 100644 --- a/admin-spa/src/index.css +++ b/admin-spa/src/index.css @@ -66,6 +66,13 @@ * { @apply border-border; } body { @apply bg-background text-foreground; } h1, h2, h3, h4, h5, h6 { @apply text-foreground; } + + /* Override WordPress common.css focus/active styles */ + a:focus, + a:active { + outline: none !important; + box-shadow: none !important; + } } /* Command palette input: remove native borders/shadows to match shadcn */ diff --git a/admin-spa/src/routes/Login.tsx b/admin-spa/src/routes/Login.tsx index dbf35bd..ea30f61 100644 --- a/admin-spa/src/routes/Login.tsx +++ b/admin-spa/src/routes/Login.tsx @@ -19,9 +19,9 @@ export function Login() { }); const navigate = useNavigate(); - // Fetch branding + // Fetch branding (public endpoint - no auth required) useEffect(() => { - fetch((window.WNW_CONFIG?.restUrl || '') + '/store/settings') + fetch((window.WNW_CONFIG?.restUrl || '') + '/store/branding') .then(res => res.json()) .then(data => { setBranding({ diff --git a/admin-spa/src/routes/Settings/Payments.tsx b/admin-spa/src/routes/Settings/Payments.tsx index afc0e90..ea78b13 100644 --- a/admin-spa/src/routes/Settings/Payments.tsx +++ b/admin-spa/src/routes/Settings/Payments.tsx @@ -302,11 +302,11 @@ export default function PaymentsPage() {
{manualGateways.map((gateway: PaymentGateway) => ( -
+
-
- +
+

{gateway.method_title || gateway.title}

diff --git a/admin-spa/src/routes/Settings/Shipping.tsx b/admin-spa/src/routes/Settings/Shipping.tsx index 78142fb..6b28dae 100644 --- a/admin-spa/src/routes/Settings/Shipping.tsx +++ b/admin-spa/src/routes/Settings/Shipping.tsx @@ -342,7 +342,9 @@ export default function ShippingPage() { className="flex items-center justify-between gap-2 py-2 px-2 md:px-3 bg-muted/50 rounded-md" >
- +
+ +
- +
+ +
@@ -684,7 +688,9 @@ export default function ShippingPage() {
- +
+ +
diff --git a/includes/Api/StoreController.php b/includes/Api/StoreController.php index 4a9f488..aee9be3 100644 --- a/includes/Api/StoreController.php +++ b/includes/Api/StoreController.php @@ -32,6 +32,15 @@ class StoreController extends WP_REST_Controller { * Register routes */ public function register_routes() { + // GET /woonoow/v1/store/branding (PUBLIC - for login page) + register_rest_route($this->namespace, '/' . $this->rest_base . '/branding', [ + [ + 'methods' => WP_REST_Server::READABLE, + 'callback' => [$this, 'get_branding'], + 'permission_callback' => '__return_true', // Public endpoint + ], + ]); + // GET /woonoow/v1/store/settings register_rest_route($this->namespace, '/' . $this->rest_base . '/settings', [ [ @@ -78,6 +87,26 @@ class StoreController extends WP_REST_Controller { ]); } + /** + * Get store branding (PUBLIC - for login page) + * + * @param WP_REST_Request $request Request object + * @return WP_REST_Response Response object + */ + public function get_branding(WP_REST_Request $request) { + $branding = [ + 'store_name' => get_option('blogname', 'WooNooW'), + 'store_logo' => get_option('woonoow_store_logo', ''), + 'store_icon' => get_option('woonoow_store_icon', ''), + 'store_tagline' => get_option('woonoow_store_tagline', ''), + ]; + + $response = rest_ensure_response($branding); + $response->header('Cache-Control', 'max-age=300'); // Cache for 5 minutes + + return $response; + } + /** * Get store settings *