fix: filter highlight, nav alignment, button centering, listing title, dashboard listing name

This commit is contained in:
thesn10
2026-06-25 19:59:03 +02:00
parent b18bdefcc0
commit ca1c0b1cd8
7 changed files with 42 additions and 15 deletions

View File

@@ -87,6 +87,9 @@ function CurrencyToggle({
}) { }) {
const active = (on: boolean): React.CSSProperties => ({ const active = (on: boolean): React.CSSProperties => ({
flex: 1, flex: 1,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
padding: 11, padding: 11,
borderRadius: 10, borderRadius: 10,
fontSize: 13, fontSize: 13,

View File

@@ -168,7 +168,7 @@ export function Dashboard() {
> >
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
<span style={{ fontWeight: 600, fontSize: 15 }}> <span style={{ fontWeight: 600, fontSize: 15 }}>
{l.data.metadataUri || abbrev(l.address)} Listing #{String(l.data.listingId)}
</span> </span>
<Badge color={sc.color} bg={sc.bg}> <Badge color={sc.color} bg={sc.bg}>
{l.data.isActive ? 'Active' : 'Inactive'} {l.data.isActive ? 'Active' : 'Inactive'}
@@ -182,7 +182,7 @@ export function Dashboard() {
fontFamily: 'var(--font-mono)', fontFamily: 'var(--font-mono)',
}} }}
> >
#{String(l.data.listingId)} · {fmtSol(l.data.price)} · {avail}/ {abbrev(l.address)} · {fmtSol(l.data.price)} · {avail}/
{String(l.data.quantity)} avail · {String(l.data.quantityReserved)} pending {String(l.data.quantity)} avail · {String(l.data.quantityReserved)} pending
</div> </div>
</div> </div>

View File

@@ -82,8 +82,8 @@ export function EscrowsTable() {
borderRadius: 7, borderRadius: 7,
fontSize: 12.5, fontSize: 12.5,
fontWeight: 600, fontWeight: 600,
color: filter === f.key ? 'var(--tx)' : 'var(--mut)', color: filter === f.key ? '#0b0613' : 'var(--mut)',
background: filter === f.key ? 'var(--bg2)' : 'transparent', background: filter === f.key ? 'linear-gradient(135deg,var(--acc),var(--acc2))' : 'transparent',
border: 'none', border: 'none',
cursor: 'pointer', cursor: 'pointer',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',

View File

@@ -54,16 +54,22 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd
LISTING ACCOUNT · #{String(d.listingId)} LISTING ACCOUNT · #{String(d.listingId)}
</div> </div>
<h1 style={{ margin: 0, fontSize: 26, fontWeight: 700, letterSpacing: '-.02em' }}> <h1 style={{ margin: 0, fontSize: 26, fontWeight: 700, letterSpacing: '-.02em' }}>
{d.metadataUri || abbrev(pk)} {abbrev(pk)}
</h1> </h1>
</div> </div>
<Badge color={sc.color} bg={sc.bg}>{d.isActive ? 'Active' : 'Inactive'}</Badge> <Badge color={sc.color} bg={sc.bg}>{d.isActive ? 'Active' : 'Inactive'}</Badge>
</div> </div>
{d.metadataUri && (
<p style={{ margin: '0 0 24px', fontSize: 14, color: 'var(--mut)', maxWidth: 620, lineHeight: 1.55 }}>
<a href={d.metadataUri} target="_blank" rel="noreferrer" style={{ color: 'var(--acc2light)' }}>{d.metadataUri}</a>
</p>
)}
<div style={{ display: 'grid', gridTemplateColumns: '1.5fr 1fr', gap: 18, alignItems: 'start', marginBottom: 24 }}> <div style={{ display: 'grid', gridTemplateColumns: '1.5fr 1fr', gap: 18, alignItems: 'start', marginBottom: 24 }}>
{/* Left: account fields */} {/* Left: account fields */}
<div style={{ background: 'var(--bg2)', border: '1px solid var(--bd)', borderRadius: 'var(--radius)', padding: '8px 22px 16px' }}> <div style={{ background: 'var(--bg2)', border: '1px solid var(--bd)', borderRadius: 'var(--radius)', padding: '8px 22px 16px' }}>
<div style={{ fontSize: 11, letterSpacing: '.13em', color: 'var(--mut)', fontWeight: 600, padding: '14px 0 4px' }}>ACCOUNT FIELDS</div> <div style={{ fontSize: 11, letterSpacing: '.13em', color: 'var(--mut)', fontWeight: 600, padding: '14px 0 4px' }}>ACCOUNT FIELDS</div>
<FieldRow label="Address"><MonoChip value={abbrev(pk)} onCopy={() => navigator.clipboard.writeText(pk)} /></FieldRow>
<FieldRow label="Listing ID"><span style={{ fontSize: 13.5, fontWeight: 600 }}>#{String(d.listingId)}</span></FieldRow> <FieldRow label="Listing ID"><span style={{ fontSize: 13.5, fontWeight: 600 }}>#{String(d.listingId)}</span></FieldRow>
<FieldRow label="Seller"><MonoChip value={abbrev(d.seller)} onCopy={() => navigator.clipboard.writeText(d.seller)} onClick={() => router.push(`/search?q=${d.seller}`)} /></FieldRow> <FieldRow label="Seller"><MonoChip value={abbrev(d.seller)} onCopy={() => navigator.clipboard.writeText(d.seller)} onClick={() => router.push(`/search?q=${d.seller}`)} /></FieldRow>
<FieldRow label="Price"><span style={{ fontSize: 13.5, fontWeight: 600 }}>{fmtListingPrice()}</span></FieldRow> <FieldRow label="Price"><span style={{ fontSize: 13.5, fontWeight: 600 }}>{fmtListingPrice()}</span></FieldRow>
@@ -137,7 +143,7 @@ export function ListingDetail({ pk, walletAddress, onUpdate, onClose, onPlaceOrd
<Button variant="danger" onClick={onClose}>Close Listing</Button> <Button variant="danger" onClick={onClose}>Close Listing</Button>
</div> </div>
)} )}
{canPlace && <Button onClick={onPlaceOrder}>Place Order</Button>} {canPlace && <Button style={{ width: '100%', padding: 11 }} onClick={onPlaceOrder}>Place Order</Button>}
{!walletAddress && <div style={{ fontSize: 13, color: 'var(--mut)', lineHeight: 1.5 }}>Connect a wallet to place an order or manage this listing.</div>} {!walletAddress && <div style={{ fontSize: 13, color: 'var(--mut)', lineHeight: 1.5 }}>Connect a wallet to place an order or manage this listing.</div>}
{walletAddress && !isSeller && !canPlace && <div style={{ fontSize: 13, color: 'var(--mut)', lineHeight: 1.5 }}>No actions available listing is inactive or out of stock.</div>} {walletAddress && !isSeller && !canPlace && <div style={{ fontSize: 13, color: 'var(--mut)', lineHeight: 1.5 }}>No actions available listing is inactive or out of stock.</div>}
</div> </div>

View File

@@ -59,15 +59,27 @@ export function ListingsTable() {
style={{ height: 38, width: 220, padding: '0 13px', background: 'var(--bg3)', border: '1px solid var(--bd)', borderRadius: 10, fontSize: 13, fontFamily: 'var(--font-mono)', outline: 'none' }} style={{ height: 38, width: 220, padding: '0 13px', background: 'var(--bg3)', border: '1px solid var(--bd)', borderRadius: 10, fontSize: 13, fontFamily: 'var(--font-mono)', outline: 'none' }}
/> />
<div style={{ display: 'flex', background: 'var(--bg3)', border: '1px solid var(--bd)', borderRadius: 10, padding: 3 }}> <div style={{ display: 'flex', background: 'var(--bg3)', border: '1px solid var(--bd)', borderRadius: 10, padding: 3 }}>
{FILTERS.map((f) => ( {FILTERS.map((f) => {
<button const active = filter === f.key
key={f.key} return (
onClick={() => setFilter(f.key)} <button
style={{ padding: '6px 13px', borderRadius: 7, fontSize: 12.5, fontWeight: 600, color: filter === f.key ? 'var(--tx)' : 'var(--mut)', background: filter === f.key ? 'var(--bg2)' : 'transparent' }} key={f.key}
> onClick={() => setFilter(f.key)}
{f.label} style={{
</button> padding: '6px 13px',
))} borderRadius: 7,
fontSize: 12.5,
fontWeight: 600,
color: active ? '#0b0613' : 'var(--mut)',
background: active ? 'linear-gradient(135deg,var(--acc),var(--acc2))' : 'transparent',
border: 'none',
cursor: 'pointer',
}}
>
{f.label}
</button>
)
})}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -147,6 +147,9 @@ export function Nav() {
})} })}
</div> </div>
{/* Spacer — pushes right-side controls to the edge */}
<div style={{ flex: 1 }} />
{/* Network picker */} {/* Network picker */}
<div ref={netRef} style={{ position: 'relative', flexShrink: 0 }}> <div ref={netRef} style={{ position: 'relative', flexShrink: 0 }}>
<button <button

View File

@@ -36,6 +36,9 @@ export function Button({ variant = 'primary', children, style, disabled, ...rest
{...rest} {...rest}
disabled={disabled} disabled={disabled}
style={{ style={{
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
padding: '11px 18px', padding: '11px 18px',
borderRadius: 'var(--radius)', borderRadius: 'var(--radius)',
fontWeight: 700, fontWeight: 700,