diff --git a/frontend/src/app/buy/page.tsx b/frontend/src/app/buy/page.tsx index 2c99d91..c81b738 100644 --- a/frontend/src/app/buy/page.tsx +++ b/frontend/src/app/buy/page.tsx @@ -1,6 +1,7 @@ 'use client' import { useEffect, useState } from 'react' +import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { Header } from '@/components/Header' import { Footer } from '@/components/Footer' @@ -36,6 +37,7 @@ interface Listing { } export default function BrowseListingsPage() { + const { isAuthenticated, checkAuth, isLoading: authLoading } = useStore() const [listings, setListings] = useState([]) const [loading, setLoading] = useState(true) const [searchQuery, setSearchQuery] = useState('') @@ -48,6 +50,10 @@ export default function BrowseListingsPage() { loadListings() }, [sortBy, verifiedOnly]) + useEffect(() => { + checkAuth() + }, [checkAuth]) + const loadListings = async () => { setLoading(true) try { @@ -195,6 +201,37 @@ export default function BrowseListingsPage() { + {/* Contact gate hint (consistent with /buy/[slug]) */} + {!authLoading && !isAuthenticated && ( +
+
+
+ +
+
+

Contact requires login

+

+ Listing details are public. To protect sellers from spam, inquiries are only available for logged-in accounts. +

+
+ + Login + + + Register + +
+
+
+
+ )} + {/* Listings Grid */} {loading ? (
@@ -268,10 +305,18 @@ export default function BrowseListingsPage() { {/* View CTA */}
- - - View Details - +
+ + + View Details + + {!isAuthenticated && ( + + + Login to contact + + )} +
diff --git a/frontend/src/app/terminal/portfolio/page.tsx b/frontend/src/app/terminal/portfolio/page.tsx index a9df24e..c252161 100755 --- a/frontend/src/app/terminal/portfolio/page.tsx +++ b/frontend/src/app/terminal/portfolio/page.tsx @@ -685,11 +685,10 @@ export default function PortfolioPage() { } catch { setListedDomains(new Set()) } } catch (err) { console.error('Failed to load portfolio:', err) - showToast('Failed to load portfolio', 'error') } finally { setLoading(false) } - }, [showToast]) + }, []) useEffect(() => { loadData() }, [loadData])