prioritize showing wallet balance over price carousel
This commit is contained in:
parent
79b894514b
commit
7dac5e79a6
@ -144,12 +144,12 @@ export function WalletSummary () {
|
||||
return `${abbrNum(me.privates?.sats)}`
|
||||
}
|
||||
|
||||
export function NavWalletSummary () {
|
||||
export function NavWalletSummary ({ className }) {
|
||||
const me = useMe()
|
||||
const walletLimitReached = me?.privates?.sats >= msatsToSats(BALANCE_LIMIT_MSATS)
|
||||
|
||||
return (
|
||||
<Nav.Item>
|
||||
<Nav.Item className={className}>
|
||||
<Link href='/wallet' passHref legacyBehavior>
|
||||
<Nav.Link eventKey='wallet' className={`${walletLimitReached ? 'text-warning' : 'text-success'} text-monospace px-0 text-nowrap`}>
|
||||
<WalletSummary me={me} />
|
||||
|
@ -1,8 +1,10 @@
|
||||
import { Nav, Navbar } from 'react-bootstrap'
|
||||
import { NavPrice, Sorts, hasNavSelect } from '../common'
|
||||
import { NavPrice, NavWalletSummary, Sorts, hasNavSelect } from '../common'
|
||||
import styles from '../../header.module.css'
|
||||
import { useMe } from '@/components/me'
|
||||
|
||||
export default function SecondBar (props) {
|
||||
const me = useMe()
|
||||
const { topNavKey } = props
|
||||
if (!hasNavSelect(props)) return null
|
||||
return (
|
||||
@ -12,7 +14,7 @@ export default function SecondBar (props) {
|
||||
activeKey={topNavKey}
|
||||
>
|
||||
<Sorts {...props} />
|
||||
<NavPrice className='justify-content-end' />
|
||||
{me ? <NavWalletSummary className='ms-auto px-2' /> : <NavPrice className='justify-content-end' />}
|
||||
</Nav>
|
||||
</Navbar>
|
||||
)
|
||||
|
@ -47,7 +47,7 @@ export default function StickyBar ({ prefix, sub, path, topNavKey, dropNavKey })
|
||||
>
|
||||
<Back />
|
||||
<NavPrice className='flex-shrink-1 flex-grow-0' />
|
||||
{me ? <NavWalletSummary /> : <SignUpButton />}
|
||||
{me ? <NavWalletSummary className='px-2' /> : <SignUpButton />}
|
||||
</Nav>
|
||||
</Navbar>
|
||||
</Container>
|
||||
|
Loading…
x
Reference in New Issue
Block a user