fix: Add WNW_CONFIG type definitions and fix TypeScript errors
This commit is contained in:
@@ -20,7 +20,7 @@ export function Login() {
|
||||
setError('');
|
||||
|
||||
try {
|
||||
const response = await fetch(window.WNW_CONFIG.restUrl + '/auth/login', {
|
||||
const response = await fetch((window.WNW_CONFIG?.restUrl || '') + '/auth/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -118,7 +118,7 @@ export function Login() {
|
||||
{/* Footer Links */}
|
||||
<div className="mt-6 space-y-3">
|
||||
<a
|
||||
href={window.WNW_CONFIG.wpAdminUrl}
|
||||
href={window.WNW_CONFIG?.wpAdminUrl || '/wp-admin'}
|
||||
className="flex items-center justify-center gap-2 text-sm text-blue-600 hover:text-blue-700 dark:text-blue-400 transition-colors"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
@@ -127,7 +127,7 @@ export function Login() {
|
||||
|
||||
<div className="text-center">
|
||||
<a
|
||||
href={window.WNW_CONFIG.siteUrl + '/wp-login.php?action=lostpassword'}
|
||||
href={(window.WNW_CONFIG?.siteUrl || '') + '/wp-login.php?action=lostpassword'}
|
||||
className="text-sm text-gray-600 hover:text-gray-700 dark:text-gray-400 transition-colors"
|
||||
>
|
||||
{__('Forgot password?')}
|
||||
@@ -138,7 +138,7 @@ export function Login() {
|
||||
|
||||
{/* Site Info */}
|
||||
<div className="text-center mt-6 text-sm text-gray-600 dark:text-gray-400">
|
||||
{window.WNW_CONFIG.siteName}
|
||||
{window.WNW_CONFIG?.siteName || 'WooNooW'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user