feat: Split Sidebar into Discover + Manage sections
SIDEBAR RESTRUCTURE: Section 1 - DISCOVER (External Market Data): - Auctions → Live auction feed - Marketplace → Browse /buy (public) - TLD Intelligence → Market insights Section 2 - MANAGE (Your Assets & Tools): - Dashboard → Overview - Watchlist → Tracked domains - Portfolio → Owned domains - My Listings → Sell domains (manage) - Sniper Alerts → Custom notifications - SEO Juice → Backlink analysis (Tycoon) LISTINGS PAGE: - Simplified to 'My Listings' only (management) - Added 'Browse Marketplace' button linking to /buy - Cleaner separation of concerns This creates a clear distinction: - Discover = Looking at external data - Manage = Managing your own stuff
This commit is contained in:
@ -18,13 +18,10 @@ import {
|
|||||||
Copy,
|
Copy,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
DollarSign,
|
DollarSign,
|
||||||
Globe,
|
|
||||||
X,
|
X,
|
||||||
Sparkles,
|
Sparkles,
|
||||||
Store,
|
|
||||||
List,
|
|
||||||
Search,
|
|
||||||
Tag,
|
Tag,
|
||||||
|
Store,
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
@ -53,22 +50,6 @@ interface Listing {
|
|||||||
published_at: string | null
|
published_at: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PublicListing {
|
|
||||||
domain: string
|
|
||||||
slug: string
|
|
||||||
title: string | null
|
|
||||||
description: string | null
|
|
||||||
asking_price: number | null
|
|
||||||
currency: string
|
|
||||||
price_type: string
|
|
||||||
pounce_score: number | null
|
|
||||||
estimated_value: number | null
|
|
||||||
is_verified: boolean
|
|
||||||
allow_offers: boolean
|
|
||||||
public_url: string
|
|
||||||
seller_verified: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
interface VerificationInfo {
|
interface VerificationInfo {
|
||||||
verification_code: string
|
verification_code: string
|
||||||
dns_record_type: string
|
dns_record_type: string
|
||||||
@ -78,22 +59,11 @@ interface VerificationInfo {
|
|||||||
status: string
|
status: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type TabType = 'browse' | 'my-listings'
|
export default function MyListingsPage() {
|
||||||
|
|
||||||
export default function ListingsPage() {
|
|
||||||
const { subscription } = useStore()
|
const { subscription } = useStore()
|
||||||
|
|
||||||
// Tab state
|
const [listings, setListings] = useState<Listing[]>([])
|
||||||
const [activeTab, setActiveTab] = useState<TabType>('browse')
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
// My Listings state
|
|
||||||
const [myListings, setMyListings] = useState<Listing[]>([])
|
|
||||||
const [loadingMy, setLoadingMy] = useState(true)
|
|
||||||
|
|
||||||
// Browse state
|
|
||||||
const [publicListings, setPublicListings] = useState<PublicListing[]>([])
|
|
||||||
const [loadingPublic, setLoadingPublic] = useState(true)
|
|
||||||
const [searchQuery, setSearchQuery] = useState('')
|
|
||||||
|
|
||||||
// Modals
|
// Modals
|
||||||
const [showCreateModal, setShowCreateModal] = useState(false)
|
const [showCreateModal, setShowCreateModal] = useState(false)
|
||||||
@ -116,31 +86,18 @@ export default function ListingsPage() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadMyListings()
|
loadListings()
|
||||||
loadPublicListings()
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const loadMyListings = async () => {
|
const loadListings = async () => {
|
||||||
setLoadingMy(true)
|
setLoading(true)
|
||||||
try {
|
try {
|
||||||
const data = await api.request<Listing[]>('/listings/my')
|
const data = await api.request<Listing[]>('/listings/my')
|
||||||
setMyListings(data)
|
setListings(data)
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error('Failed to load my listings:', err)
|
console.error('Failed to load listings:', err)
|
||||||
} finally {
|
} finally {
|
||||||
setLoadingMy(false)
|
setLoading(false)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const loadPublicListings = async () => {
|
|
||||||
setLoadingPublic(true)
|
|
||||||
try {
|
|
||||||
const data = await api.request<PublicListing[]>('/listings?limit=50')
|
|
||||||
setPublicListings(data)
|
|
||||||
} catch (err: any) {
|
|
||||||
console.error('Failed to load public listings:', err)
|
|
||||||
} finally {
|
|
||||||
setLoadingPublic(false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,8 +121,7 @@ export default function ListingsPage() {
|
|||||||
setSuccess('Listing created! Now verify ownership to publish.')
|
setSuccess('Listing created! Now verify ownership to publish.')
|
||||||
setShowCreateModal(false)
|
setShowCreateModal(false)
|
||||||
setNewListing({ domain: '', title: '', description: '', asking_price: '', price_type: 'negotiable', allow_offers: true })
|
setNewListing({ domain: '', title: '', description: '', asking_price: '', price_type: 'negotiable', allow_offers: true })
|
||||||
loadMyListings()
|
loadListings()
|
||||||
setActiveTab('my-listings')
|
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setError(err.message)
|
setError(err.message)
|
||||||
} finally {
|
} finally {
|
||||||
@ -202,7 +158,7 @@ export default function ListingsPage() {
|
|||||||
if (result.verified) {
|
if (result.verified) {
|
||||||
setSuccess('Domain verified! You can now publish your listing.')
|
setSuccess('Domain verified! You can now publish your listing.')
|
||||||
setShowVerifyModal(false)
|
setShowVerifyModal(false)
|
||||||
loadMyListings()
|
loadListings()
|
||||||
} else {
|
} else {
|
||||||
setError(result.message)
|
setError(result.message)
|
||||||
}
|
}
|
||||||
@ -220,8 +176,7 @@ export default function ListingsPage() {
|
|||||||
body: JSON.stringify({ status: 'active' }),
|
body: JSON.stringify({ status: 'active' }),
|
||||||
})
|
})
|
||||||
setSuccess('Listing published!')
|
setSuccess('Listing published!')
|
||||||
loadMyListings()
|
loadListings()
|
||||||
loadPublicListings()
|
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setError(err.message)
|
setError(err.message)
|
||||||
}
|
}
|
||||||
@ -233,7 +188,7 @@ export default function ListingsPage() {
|
|||||||
try {
|
try {
|
||||||
await api.request(`/listings/${listing.id}`, { method: 'DELETE' })
|
await api.request(`/listings/${listing.id}`, { method: 'DELETE' })
|
||||||
setSuccess('Listing deleted')
|
setSuccess('Listing deleted')
|
||||||
loadMyListings()
|
loadListings()
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
setError(err.message)
|
setError(err.message)
|
||||||
}
|
}
|
||||||
@ -261,34 +216,34 @@ export default function ListingsPage() {
|
|||||||
return <Badge>{status}</Badge>
|
return <Badge>{status}</Badge>
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPublicListings = publicListings.filter(listing => {
|
|
||||||
if (!searchQuery) return true
|
|
||||||
return listing.domain.toLowerCase().includes(searchQuery.toLowerCase())
|
|
||||||
})
|
|
||||||
|
|
||||||
const tier = subscription?.tier || 'scout'
|
const tier = subscription?.tier || 'scout'
|
||||||
const limits = { scout: 2, trader: 10, tycoon: 50 }
|
const limits = { scout: 2, trader: 10, tycoon: 50 }
|
||||||
const maxListings = limits[tier as keyof typeof limits] || 2
|
const maxListings = limits[tier as keyof typeof limits] || 2
|
||||||
|
|
||||||
const tabs = [
|
|
||||||
{ id: 'browse' as TabType, label: 'Browse Marketplace', icon: Store, count: publicListings.length },
|
|
||||||
{ id: 'my-listings' as TabType, label: 'My Listings', icon: List, count: myListings.length },
|
|
||||||
]
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CommandCenterLayout
|
<CommandCenterLayout
|
||||||
title="Marketplace"
|
title="My Listings"
|
||||||
subtitle="Buy and sell premium domains"
|
subtitle={`Manage your domains for sale • ${listings.length}/${maxListings} slots used`}
|
||||||
actions={
|
actions={
|
||||||
<button
|
<div className="flex items-center gap-3">
|
||||||
onClick={() => setShowCreateModal(true)}
|
<Link
|
||||||
disabled={myListings.length >= maxListings}
|
href="/buy"
|
||||||
className="flex items-center gap-2 px-4 py-2 bg-accent text-background text-sm font-medium rounded-lg
|
className="flex items-center gap-2 px-4 py-2 text-foreground-muted text-sm font-medium
|
||||||
hover:bg-accent-hover transition-all disabled:opacity-50 disabled:cursor-not-allowed"
|
border border-border rounded-lg hover:bg-foreground/5 transition-all"
|
||||||
>
|
>
|
||||||
<Plus className="w-4 h-4" />
|
<Store className="w-4 h-4" />
|
||||||
List Domain
|
Browse Marketplace
|
||||||
</button>
|
</Link>
|
||||||
|
<button
|
||||||
|
onClick={() => setShowCreateModal(true)}
|
||||||
|
disabled={listings.length >= maxListings}
|
||||||
|
className="flex items-center gap-2 px-4 py-2 bg-accent text-background text-sm font-medium rounded-lg
|
||||||
|
hover:bg-accent-hover transition-all disabled:opacity-50 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
<Plus className="w-4 h-4" />
|
||||||
|
List Domain
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
@ -309,252 +264,135 @@ export default function ListingsPage() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Tabs */}
|
{/* Stats */}
|
||||||
<div className="flex gap-2 p-1 bg-background-secondary/50 rounded-xl border border-border">
|
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
||||||
{tabs.map((tab) => (
|
<StatCard title="My Listings" value={`${listings.length}/${maxListings}`} icon={Tag} />
|
||||||
<button
|
<StatCard
|
||||||
key={tab.id}
|
title="Published"
|
||||||
onClick={() => setActiveTab(tab.id)}
|
value={listings.filter(l => l.status === 'active').length}
|
||||||
className={clsx(
|
icon={CheckCircle}
|
||||||
"flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium transition-all",
|
accent
|
||||||
activeTab === tab.id
|
/>
|
||||||
? "bg-foreground text-background"
|
<StatCard
|
||||||
: "text-foreground-muted hover:text-foreground hover:bg-foreground/5"
|
title="Total Views"
|
||||||
)}
|
value={listings.reduce((sum, l) => sum + l.view_count, 0)}
|
||||||
>
|
icon={Eye}
|
||||||
<tab.icon className="w-4 h-4" />
|
/>
|
||||||
{tab.label}
|
<StatCard
|
||||||
<span className={clsx(
|
title="Inquiries"
|
||||||
"px-2 py-0.5 text-xs rounded-full",
|
value={listings.reduce((sum, l) => sum + l.inquiry_count, 0)}
|
||||||
activeTab === tab.id ? "bg-background/20 text-background" : "bg-foreground/10"
|
icon={MessageSquare}
|
||||||
)}>
|
/>
|
||||||
{tab.count}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Browse Tab */}
|
{/* Listings */}
|
||||||
{activeTab === 'browse' && (
|
{loading ? (
|
||||||
<div className="space-y-6">
|
<div className="flex items-center justify-center py-20">
|
||||||
{/* Search */}
|
<Loader2 className="w-6 h-6 text-accent animate-spin" />
|
||||||
<div className="relative">
|
|
||||||
<Search className="absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-foreground-subtle" />
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search domains for sale..."
|
|
||||||
value={searchQuery}
|
|
||||||
onChange={(e) => setSearchQuery(e.target.value)}
|
|
||||||
className="w-full pl-12 pr-4 py-3 bg-background-secondary/50 border border-border rounded-xl
|
|
||||||
text-foreground placeholder:text-foreground-subtle
|
|
||||||
focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Listings Grid */}
|
|
||||||
{loadingPublic ? (
|
|
||||||
<div className="flex items-center justify-center py-20">
|
|
||||||
<Loader2 className="w-6 h-6 text-accent animate-spin" />
|
|
||||||
</div>
|
|
||||||
) : filteredPublicListings.length === 0 ? (
|
|
||||||
<div className="text-center py-16 bg-background-secondary/30 border border-border rounded-2xl">
|
|
||||||
<Store className="w-16 h-16 text-foreground-subtle mx-auto mb-6" />
|
|
||||||
<h2 className="text-xl font-medium text-foreground mb-2">No Domains Listed</h2>
|
|
||||||
<p className="text-foreground-muted mb-6">
|
|
||||||
{searchQuery ? `No domains match "${searchQuery}"` : 'Be the first to list your domain!'}
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
setActiveTab('my-listings')
|
|
||||||
setShowCreateModal(true)
|
|
||||||
}}
|
|
||||||
className="inline-flex items-center gap-2 px-6 py-3 bg-accent text-background font-medium rounded-xl hover:bg-accent-hover transition-all"
|
|
||||||
>
|
|
||||||
<Plus className="w-5 h-5" />
|
|
||||||
List Your Domain
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
|
||||||
{filteredPublicListings.map((listing) => (
|
|
||||||
<Link
|
|
||||||
key={listing.slug}
|
|
||||||
href={`/buy/${listing.slug}`}
|
|
||||||
className="group p-5 bg-background-secondary/30 border border-border rounded-2xl
|
|
||||||
hover:border-accent/50 hover:bg-background-secondary/50 transition-all duration-300"
|
|
||||||
>
|
|
||||||
<div className="flex items-start justify-between mb-3">
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<h3 className="font-mono text-lg font-medium text-foreground group-hover:text-accent transition-colors truncate">
|
|
||||||
{listing.domain}
|
|
||||||
</h3>
|
|
||||||
{listing.title && (
|
|
||||||
<p className="text-sm text-foreground-muted truncate mt-1">{listing.title}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
{listing.is_verified && (
|
|
||||||
<div className="shrink-0 ml-2 w-8 h-8 bg-accent/10 rounded-lg flex items-center justify-center">
|
|
||||||
<Shield className="w-4 h-4 text-accent" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex items-end justify-between">
|
|
||||||
{listing.pounce_score && (
|
|
||||||
<div className="px-2 py-1 bg-accent/10 text-accent rounded text-sm font-medium">
|
|
||||||
Score: {listing.pounce_score}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="text-right">
|
|
||||||
<p className="text-xl font-display text-foreground">
|
|
||||||
{formatPrice(listing.asking_price, listing.currency)}
|
|
||||||
</p>
|
|
||||||
{listing.price_type === 'negotiable' && (
|
|
||||||
<p className="text-xs text-accent">Negotiable</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
) : listings.length === 0 ? (
|
||||||
|
<div className="text-center py-16 bg-background-secondary/30 border border-border rounded-2xl">
|
||||||
{/* My Listings Tab */}
|
<Sparkles className="w-16 h-16 text-foreground-subtle mx-auto mb-6" />
|
||||||
{activeTab === 'my-listings' && (
|
<h2 className="text-xl font-medium text-foreground mb-2">No Listings Yet</h2>
|
||||||
<div className="space-y-6">
|
<p className="text-foreground-muted mb-6 max-w-md mx-auto">
|
||||||
{/* Stats */}
|
Create your first listing to sell a domain on the Pounce marketplace.
|
||||||
<div className="grid grid-cols-2 lg:grid-cols-4 gap-4">
|
</p>
|
||||||
<StatCard title="My Listings" value={`${myListings.length}/${maxListings}`} icon={Tag} />
|
<button
|
||||||
<StatCard
|
onClick={() => setShowCreateModal(true)}
|
||||||
title="Published"
|
className="inline-flex items-center gap-2 px-6 py-3 bg-accent text-background font-medium rounded-xl hover:bg-accent-hover transition-all"
|
||||||
value={myListings.filter(l => l.status === 'active').length}
|
>
|
||||||
icon={CheckCircle}
|
<Plus className="w-5 h-5" />
|
||||||
accent
|
Create Listing
|
||||||
/>
|
</button>
|
||||||
<StatCard
|
</div>
|
||||||
title="Total Views"
|
) : (
|
||||||
value={myListings.reduce((sum, l) => sum + l.view_count, 0)}
|
<div className="space-y-4">
|
||||||
icon={Eye}
|
{listings.map((listing) => (
|
||||||
/>
|
<div
|
||||||
<StatCard
|
key={listing.id}
|
||||||
title="Inquiries"
|
className="p-5 bg-background-secondary/30 border border-border rounded-2xl hover:border-border-hover transition-all"
|
||||||
value={myListings.reduce((sum, l) => sum + l.inquiry_count, 0)}
|
>
|
||||||
icon={MessageSquare}
|
<div className="flex flex-wrap items-start gap-4">
|
||||||
/>
|
{/* Domain Info */}
|
||||||
</div>
|
<div className="flex-1 min-w-[200px]">
|
||||||
|
<div className="flex items-center gap-3 mb-2">
|
||||||
{/* My Listings */}
|
<h3 className="font-mono text-lg font-medium text-foreground">{listing.domain}</h3>
|
||||||
{loadingMy ? (
|
{getStatusBadge(listing.status, listing.is_verified)}
|
||||||
<div className="flex items-center justify-center py-20">
|
{listing.is_verified && (
|
||||||
<Loader2 className="w-6 h-6 text-accent animate-spin" />
|
<div className="w-6 h-6 bg-accent/10 rounded flex items-center justify-center" title="Verified">
|
||||||
</div>
|
<Shield className="w-3 h-3 text-accent" />
|
||||||
) : myListings.length === 0 ? (
|
|
||||||
<div className="text-center py-16 bg-background-secondary/30 border border-border rounded-2xl">
|
|
||||||
<Sparkles className="w-16 h-16 text-foreground-subtle mx-auto mb-6" />
|
|
||||||
<h2 className="text-xl font-medium text-foreground mb-2">No Listings Yet</h2>
|
|
||||||
<p className="text-foreground-muted mb-6 max-w-md mx-auto">
|
|
||||||
Create your first listing to sell a domain on the Pounce marketplace.
|
|
||||||
</p>
|
|
||||||
<button
|
|
||||||
onClick={() => setShowCreateModal(true)}
|
|
||||||
className="inline-flex items-center gap-2 px-6 py-3 bg-accent text-background font-medium rounded-xl hover:bg-accent-hover transition-all"
|
|
||||||
>
|
|
||||||
<Plus className="w-5 h-5" />
|
|
||||||
Create Listing
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="space-y-4">
|
|
||||||
{myListings.map((listing) => (
|
|
||||||
<div
|
|
||||||
key={listing.id}
|
|
||||||
className="p-5 bg-background-secondary/30 border border-border rounded-2xl hover:border-border-hover transition-all"
|
|
||||||
>
|
|
||||||
<div className="flex flex-wrap items-start gap-4">
|
|
||||||
{/* Domain Info */}
|
|
||||||
<div className="flex-1 min-w-[200px]">
|
|
||||||
<div className="flex items-center gap-3 mb-2">
|
|
||||||
<h3 className="font-mono text-lg font-medium text-foreground">{listing.domain}</h3>
|
|
||||||
{getStatusBadge(listing.status, listing.is_verified)}
|
|
||||||
{listing.is_verified && (
|
|
||||||
<div className="w-6 h-6 bg-accent/10 rounded flex items-center justify-center" title="Verified">
|
|
||||||
<Shield className="w-3 h-3 text-accent" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
{listing.title && (
|
)}
|
||||||
<p className="text-sm text-foreground-muted">{listing.title}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Price */}
|
|
||||||
<div className="text-right">
|
|
||||||
<p className="text-xl font-display text-foreground">
|
|
||||||
{formatPrice(listing.asking_price, listing.currency)}
|
|
||||||
</p>
|
|
||||||
{listing.pounce_score && (
|
|
||||||
<p className="text-xs text-foreground-muted">Score: {listing.pounce_score}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Stats */}
|
|
||||||
<div className="flex items-center gap-4 text-sm text-foreground-muted">
|
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
<Eye className="w-4 h-4" /> {listing.view_count}
|
|
||||||
</span>
|
|
||||||
<span className="flex items-center gap-1">
|
|
||||||
<MessageSquare className="w-4 h-4" /> {listing.inquiry_count}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Actions */}
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
{!listing.is_verified && (
|
|
||||||
<button
|
|
||||||
onClick={() => handleStartVerification(listing)}
|
|
||||||
disabled={verifying}
|
|
||||||
className="flex items-center gap-1.5 px-3 py-2 bg-amber-500/10 text-amber-400 text-sm font-medium rounded-lg hover:bg-amber-500/20 transition-all"
|
|
||||||
>
|
|
||||||
<Shield className="w-4 h-4" />
|
|
||||||
Verify
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{listing.is_verified && listing.status === 'draft' && (
|
|
||||||
<button
|
|
||||||
onClick={() => handlePublish(listing)}
|
|
||||||
className="flex items-center gap-1.5 px-3 py-2 bg-accent text-background text-sm font-medium rounded-lg hover:bg-accent-hover transition-all"
|
|
||||||
>
|
|
||||||
<CheckCircle className="w-4 h-4" />
|
|
||||||
Publish
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{listing.status === 'active' && (
|
|
||||||
<Link
|
|
||||||
href={`/buy/${listing.slug}`}
|
|
||||||
target="_blank"
|
|
||||||
className="flex items-center gap-1.5 px-3 py-2 bg-foreground/5 text-foreground-muted text-sm font-medium rounded-lg hover:bg-foreground/10 transition-all"
|
|
||||||
>
|
|
||||||
<ExternalLink className="w-4 h-4" />
|
|
||||||
View
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<button
|
|
||||||
onClick={() => handleDelete(listing)}
|
|
||||||
className="p-2 text-foreground-subtle hover:text-red-400 transition-colors"
|
|
||||||
>
|
|
||||||
<Trash2 className="w-4 h-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
{listing.title && (
|
||||||
|
<p className="text-sm text-foreground-muted">{listing.title}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
))}
|
|
||||||
|
{/* Price */}
|
||||||
|
<div className="text-right">
|
||||||
|
<p className="text-xl font-display text-foreground">
|
||||||
|
{formatPrice(listing.asking_price, listing.currency)}
|
||||||
|
</p>
|
||||||
|
{listing.pounce_score && (
|
||||||
|
<p className="text-xs text-foreground-muted">Score: {listing.pounce_score}</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Stats */}
|
||||||
|
<div className="flex items-center gap-4 text-sm text-foreground-muted">
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<Eye className="w-4 h-4" /> {listing.view_count}
|
||||||
|
</span>
|
||||||
|
<span className="flex items-center gap-1">
|
||||||
|
<MessageSquare className="w-4 h-4" /> {listing.inquiry_count}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Actions */}
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{!listing.is_verified && (
|
||||||
|
<button
|
||||||
|
onClick={() => handleStartVerification(listing)}
|
||||||
|
disabled={verifying}
|
||||||
|
className="flex items-center gap-1.5 px-3 py-2 bg-amber-500/10 text-amber-400 text-sm font-medium rounded-lg hover:bg-amber-500/20 transition-all"
|
||||||
|
>
|
||||||
|
<Shield className="w-4 h-4" />
|
||||||
|
Verify
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{listing.is_verified && listing.status === 'draft' && (
|
||||||
|
<button
|
||||||
|
onClick={() => handlePublish(listing)}
|
||||||
|
className="flex items-center gap-1.5 px-3 py-2 bg-accent text-background text-sm font-medium rounded-lg hover:bg-accent-hover transition-all"
|
||||||
|
>
|
||||||
|
<CheckCircle className="w-4 h-4" />
|
||||||
|
Publish
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{listing.status === 'active' && (
|
||||||
|
<Link
|
||||||
|
href={`/buy/${listing.slug}`}
|
||||||
|
target="_blank"
|
||||||
|
className="flex items-center gap-1.5 px-3 py-2 bg-foreground/5 text-foreground-muted text-sm font-medium rounded-lg hover:bg-foreground/10 transition-all"
|
||||||
|
>
|
||||||
|
<ExternalLink className="w-4 h-4" />
|
||||||
|
View
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<button
|
||||||
|
onClick={() => handleDelete(listing)}
|
||||||
|
className="p-2 text-foreground-subtle hover:text-red-400 transition-colors"
|
||||||
|
>
|
||||||
|
<Trash2 className="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
|
|||||||
@ -72,8 +72,30 @@ export function Sidebar({ collapsed: controlledCollapsed, onCollapsedChange }: S
|
|||||||
// Count available domains for notification badge
|
// Count available domains for notification badge
|
||||||
const availableCount = domains?.filter(d => d.is_available).length || 0
|
const availableCount = domains?.filter(d => d.is_available).length || 0
|
||||||
|
|
||||||
// Navigation items - all point to /command/* routes
|
// SECTION 1: Discover - External market data
|
||||||
const navItems = [
|
const discoverItems = [
|
||||||
|
{
|
||||||
|
href: '/command/auctions',
|
||||||
|
label: 'Auctions',
|
||||||
|
icon: Gavel,
|
||||||
|
badge: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/buy',
|
||||||
|
label: 'Marketplace',
|
||||||
|
icon: Tag,
|
||||||
|
badge: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: '/command/intelligence',
|
||||||
|
label: 'TLD Intelligence',
|
||||||
|
icon: TrendingUp,
|
||||||
|
badge: null,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
// SECTION 2: Manage - Your own assets and tools
|
||||||
|
const manageItems = [
|
||||||
{
|
{
|
||||||
href: '/command/dashboard',
|
href: '/command/dashboard',
|
||||||
label: 'Dashboard',
|
label: 'Dashboard',
|
||||||
@ -92,21 +114,9 @@ export function Sidebar({ collapsed: controlledCollapsed, onCollapsedChange }: S
|
|||||||
icon: Briefcase,
|
icon: Briefcase,
|
||||||
badge: null,
|
badge: null,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
href: '/command/auctions',
|
|
||||||
label: 'Auctions',
|
|
||||||
icon: Gavel,
|
|
||||||
badge: null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
href: '/command/intelligence',
|
|
||||||
label: 'Intelligence',
|
|
||||||
icon: TrendingUp,
|
|
||||||
badge: null,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
href: '/command/listings',
|
href: '/command/listings',
|
||||||
label: 'Marketplace',
|
label: 'My Listings',
|
||||||
icon: Tag,
|
icon: Tag,
|
||||||
badge: null,
|
badge: null,
|
||||||
},
|
},
|
||||||
@ -175,64 +185,119 @@ export function Sidebar({ collapsed: controlledCollapsed, onCollapsedChange }: S
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Navigation */}
|
{/* Main Navigation */}
|
||||||
<nav className="flex-1 py-6 px-3 space-y-1.5 overflow-y-auto">
|
<nav className="flex-1 py-6 px-3 overflow-y-auto">
|
||||||
<div className={clsx("mb-4", collapsed ? "px-1" : "px-2")}>
|
{/* SECTION 1: Discover */}
|
||||||
|
<div className={clsx("mb-6", collapsed ? "px-1" : "px-2")}>
|
||||||
{!collapsed && (
|
{!collapsed && (
|
||||||
<p className="text-[10px] font-semibold text-foreground-subtle/60 uppercase tracking-[0.15em] mb-3">
|
<p className="text-[10px] font-semibold text-foreground-subtle/60 uppercase tracking-[0.15em] mb-3">
|
||||||
Navigation
|
Discover
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
{collapsed && <div className="h-px bg-border/50 mb-3" />}
|
||||||
|
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
{discoverItems.map((item) => (
|
||||||
|
<Link
|
||||||
|
key={item.href}
|
||||||
|
href={item.href}
|
||||||
|
onClick={() => setMobileOpen(false)}
|
||||||
|
className={clsx(
|
||||||
|
"group relative flex items-center gap-3 px-3 py-3 rounded-xl transition-all duration-300",
|
||||||
|
isActive(item.href)
|
||||||
|
? "bg-gradient-to-r from-accent/20 to-accent/5 text-foreground border border-accent/20 shadow-[0_0_20px_-5px_rgba(16,185,129,0.2)]"
|
||||||
|
: "text-foreground-muted hover:text-foreground hover:bg-foreground/5 border border-transparent"
|
||||||
|
)}
|
||||||
|
title={collapsed ? item.label : undefined}
|
||||||
|
>
|
||||||
|
{isActive(item.href) && (
|
||||||
|
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-accent rounded-r-full shadow-[0_0_10px_rgba(16,185,129,0.5)]" />
|
||||||
|
)}
|
||||||
|
<div className="relative">
|
||||||
|
<item.icon className={clsx(
|
||||||
|
"w-5 h-5 transition-all duration-300",
|
||||||
|
isActive(item.href)
|
||||||
|
? "text-accent drop-shadow-[0_0_8px_rgba(16,185,129,0.5)]"
|
||||||
|
: "group-hover:text-foreground"
|
||||||
|
)} />
|
||||||
|
</div>
|
||||||
|
{!collapsed && (
|
||||||
|
<span className={clsx(
|
||||||
|
"text-sm font-medium transition-colors",
|
||||||
|
isActive(item.href) && "text-foreground"
|
||||||
|
)}>
|
||||||
|
{item.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{!isActive(item.href) && (
|
||||||
|
<div className="absolute inset-0 rounded-xl bg-accent/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" />
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{navItems.map((item) => (
|
{/* SECTION 2: Manage */}
|
||||||
<Link
|
<div className={clsx("", collapsed ? "px-1" : "px-2")}>
|
||||||
key={item.href}
|
{!collapsed && (
|
||||||
href={item.href}
|
<p className="text-[10px] font-semibold text-foreground-subtle/60 uppercase tracking-[0.15em] mb-3">
|
||||||
onClick={() => setMobileOpen(false)}
|
Manage
|
||||||
className={clsx(
|
</p>
|
||||||
"group relative flex items-center gap-3 px-3 py-3 rounded-xl transition-all duration-300",
|
)}
|
||||||
isActive(item.href)
|
{collapsed && <div className="h-px bg-border/50 mb-3" />}
|
||||||
? "bg-gradient-to-r from-accent/20 to-accent/5 text-foreground border border-accent/20 shadow-[0_0_20px_-5px_rgba(16,185,129,0.2)]"
|
|
||||||
: "text-foreground-muted hover:text-foreground hover:bg-foreground/5 border border-transparent"
|
|
||||||
)}
|
|
||||||
title={collapsed ? item.label : undefined}
|
|
||||||
>
|
|
||||||
{/* Active indicator line */}
|
|
||||||
{isActive(item.href) && (
|
|
||||||
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-accent rounded-r-full shadow-[0_0_10px_rgba(16,185,129,0.5)]" />
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="relative">
|
<div className="space-y-1.5">
|
||||||
<item.icon className={clsx(
|
{manageItems.map((item) => (
|
||||||
"w-5 h-5 transition-all duration-300",
|
<Link
|
||||||
isActive(item.href)
|
key={item.href}
|
||||||
? "text-accent drop-shadow-[0_0_8px_rgba(16,185,129,0.5)]"
|
href={item.href}
|
||||||
: "group-hover:text-foreground"
|
onClick={() => setMobileOpen(false)}
|
||||||
)} />
|
className={clsx(
|
||||||
{/* Badge for notifications */}
|
"group relative flex items-center gap-3 px-3 py-3 rounded-xl transition-all duration-300",
|
||||||
{item.badge && (
|
isActive(item.href)
|
||||||
<span className="absolute -top-2 -right-2 w-5 h-5 bg-accent text-background
|
? "bg-gradient-to-r from-accent/20 to-accent/5 text-foreground border border-accent/20 shadow-[0_0_20px_-5px_rgba(16,185,129,0.2)]"
|
||||||
text-[10px] font-bold rounded-full flex items-center justify-center
|
: "text-foreground-muted hover:text-foreground hover:bg-foreground/5 border border-transparent"
|
||||||
shadow-[0_0_10px_rgba(16,185,129,0.4)] animate-pulse">
|
)}
|
||||||
{item.badge > 9 ? '9+' : item.badge}
|
title={collapsed ? item.label : undefined}
|
||||||
</span>
|
>
|
||||||
)}
|
{isActive(item.href) && (
|
||||||
</div>
|
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-8 bg-accent rounded-r-full shadow-[0_0_10px_rgba(16,185,129,0.5)]" />
|
||||||
{!collapsed && (
|
)}
|
||||||
<span className={clsx(
|
<div className="relative">
|
||||||
"text-sm font-medium transition-colors",
|
<item.icon className={clsx(
|
||||||
isActive(item.href) && "text-foreground"
|
"w-5 h-5 transition-all duration-300",
|
||||||
)}>
|
isActive(item.href)
|
||||||
{item.label}
|
? "text-accent drop-shadow-[0_0_8px_rgba(16,185,129,0.5)]"
|
||||||
</span>
|
: "group-hover:text-foreground"
|
||||||
)}
|
)} />
|
||||||
|
{item.badge && typeof item.badge === 'number' && (
|
||||||
{/* Hover glow effect */}
|
<span className="absolute -top-2 -right-2 w-5 h-5 bg-accent text-background
|
||||||
{!isActive(item.href) && (
|
text-[10px] font-bold rounded-full flex items-center justify-center
|
||||||
<div className="absolute inset-0 rounded-xl bg-accent/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" />
|
shadow-[0_0_10px_rgba(16,185,129,0.4)] animate-pulse">
|
||||||
)}
|
{item.badge > 9 ? '9+' : item.badge}
|
||||||
</Link>
|
</span>
|
||||||
))}
|
)}
|
||||||
|
{item.badge && typeof item.badge === 'string' && !collapsed && (
|
||||||
|
<span className="absolute -top-1 -right-10 px-1.5 py-0.5 bg-amber-500/20 text-amber-400
|
||||||
|
text-[9px] font-bold rounded uppercase">
|
||||||
|
{item.badge}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{!collapsed && (
|
||||||
|
<span className={clsx(
|
||||||
|
"text-sm font-medium transition-colors",
|
||||||
|
isActive(item.href) && "text-foreground"
|
||||||
|
)}>
|
||||||
|
{item.label}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{!isActive(item.href) && (
|
||||||
|
<div className="absolute inset-0 rounded-xl bg-accent/5 opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" />
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{/* Bottom Section */}
|
{/* Bottom Section */}
|
||||||
|
|||||||
Reference in New Issue
Block a user