improve tipping walkthrough: don't display if user doesn't have sats, more generic error message

This commit is contained in:
keyan 2022-03-10 14:09:09 -06:00
parent f35d714c70
commit f241f14379
2 changed files with 8 additions and 7 deletions

View File

@ -36,7 +36,7 @@ export function FundErrorModal () {
> >
<div className='modal-close' onClick={() => setError(false)}>X</div> <div className='modal-close' onClick={() => setError(false)}>X</div>
<Modal.Body> <Modal.Body>
<p className='font-weight-bolder'>you have no sats</p> <p className='font-weight-bolder'>you need more sats</p>
<div className='d-flex justify-content-end'> <div className='d-flex justify-content-end'>
<Link href='/wallet?type=fund'> <Link href='/wallet?type=fund'>
<Button variant='success' onClick={() => setError(false)}>fund</Button> <Button variant='success' onClick={() => setError(false)}>fund</Button>

View File

@ -76,12 +76,13 @@ export default function UpVote ({ item, className }) {
const setVoteShow = (yes) => { const setVoteShow = (yes) => {
if (!me) return if (!me) return
if (yes && !me.upvotePopover) { // if they haven't seen the walkthrough and they have sats
_setVoteShow(yes) if (yes && !me.upvotePopover && me.sats) {
_setVoteShow(true)
} }
if (voteShow && !yes) { if (voteShow && !yes) {
_setVoteShow(yes) _setVoteShow(false)
setWalkthrough({ variables: { upvotePopover: true } }) setWalkthrough({ variables: { upvotePopover: true } })
} }
} }
@ -90,13 +91,13 @@ export default function UpVote ({ item, className }) {
if (!me) return if (!me) return
// if we want to show it, yet we still haven't shown // if we want to show it, yet we still haven't shown
if (yes && !me.tipPopover) { if (yes && !me.tipPopover && me.sats) {
_setTipShow(yes) _setTipShow(true)
} }
// if it's currently showing and we want to hide it // if it's currently showing and we want to hide it
if (tipShow && !yes) { if (tipShow && !yes) {
_setTipShow(yes) _setTipShow(false)
setWalkthrough({ variables: { tipPopover: true } }) setWalkthrough({ variables: { tipPopover: true } })
} }
} }