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