fix: update all header login links to use SPA login
- BaseLayout.tsx: Updated 4 guest account links - Wishlist.tsx: Updated guest wishlist login link - All now use Link to /login instead of href to /wp-login.php
This commit is contained in:
@@ -128,10 +128,10 @@ function ClassicLayout({ children }: BaseLayoutProps) {
|
|||||||
<span className="hidden lg:block">Account</span>
|
<span className="hidden lg:block">Account</span>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<a href="/wp-login.php" className="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
<Link to="/login" className="flex items-center gap-2 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
||||||
<User className="h-5 w-5" />
|
<User className="h-5 w-5" />
|
||||||
<span className="hidden lg:block">Account</span>
|
<span className="hidden lg:block">Account</span>
|
||||||
</a>
|
</Link>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{/* Wishlist */}
|
{/* Wishlist */}
|
||||||
@@ -248,10 +248,10 @@ function ClassicLayout({ children }: BaseLayoutProps) {
|
|||||||
<span>Account</span>
|
<span>Account</span>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<a href="/wp-login.php" className="flex flex-col items-center gap-1 px-4 py-2 text-xs font-medium text-gray-700 hover:text-gray-900 no-underline">
|
<Link to="/login" className="flex flex-col items-center gap-1 px-4 py-2 text-xs font-medium text-gray-700 hover:text-gray-900 no-underline">
|
||||||
<User className="h-5 w-5" />
|
<User className="h-5 w-5" />
|
||||||
<span>Login</span>
|
<span>Login</span>
|
||||||
</a>
|
</Link>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -423,9 +423,9 @@ function ModernLayout({ children }: BaseLayoutProps) {
|
|||||||
<User className="h-4 w-4" /> Account
|
<User className="h-4 w-4" /> Account
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<a href="/wp-login.php" className="flex items-center gap-1 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
<Link to="/login" className="flex items-center gap-1 text-sm font-medium text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
||||||
<User className="h-4 w-4" /> Account
|
<User className="h-4 w-4" /> Account
|
||||||
</a>
|
</Link>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
|
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
|
||||||
@@ -557,9 +557,9 @@ function BoutiqueLayout({ children }: BaseLayoutProps) {
|
|||||||
<User className="h-4 w-4" /> Account
|
<User className="h-4 w-4" /> Account
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<a href="/wp-login.php" className="flex items-center gap-1 text-sm uppercase tracking-wider text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
<Link to="/login" className="flex items-center gap-1 text-sm uppercase tracking-wider text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
||||||
<User className="h-4 w-4" /> Account
|
<User className="h-4 w-4" /> Account
|
||||||
</a>
|
</Link>
|
||||||
))}
|
))}
|
||||||
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
|
{headerSettings.elements.wishlist && isEnabled('wishlist') && (wishlistSettings.show_in_header ?? true) && (
|
||||||
<Link to="/wishlist" className="flex items-center gap-1 text-sm uppercase tracking-wider text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
<Link to="/wishlist" className="flex items-center gap-1 text-sm uppercase tracking-wider text-gray-700 hover:text-gray-900 transition-colors no-underline">
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate, Link } from 'react-router-dom';
|
||||||
import { Trash2, ShoppingCart, Heart } from 'lucide-react';
|
import { Trash2, ShoppingCart, Heart } from 'lucide-react';
|
||||||
import { useWishlist } from '@/hooks/useWishlist';
|
import { useWishlist } from '@/hooks/useWishlist';
|
||||||
import { useCartStore } from '@/lib/cart/store';
|
import { useCartStore } from '@/lib/cart/store';
|
||||||
@@ -119,7 +119,7 @@ export default function Wishlist() {
|
|||||||
<div className="mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
<div className="mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
||||||
<p className="text-sm text-blue-800">
|
<p className="text-sm text-blue-800">
|
||||||
<strong>Guest Wishlist:</strong> You have {guestProducts.length} items saved locally.
|
<strong>Guest Wishlist:</strong> You have {guestProducts.length} items saved locally.
|
||||||
<a href="/wp-login.php" className="underline ml-1">Login</a> to sync your wishlist to your account.
|
<Link to="/login" className="underline ml-1">Login</Link> to sync your wishlist to your account.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user