Skip to content

Commit

Permalink
Fix Gift NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Nov 8, 2023
1 parent e4cddac commit 2bcee4f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/components/modules/GiftNFT.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import LoadingIndicator from 'app/components/elements/LoadingIndicator'
import g from 'app/redux/GlobalReducer'
import transaction from 'app/redux/Transaction'
import { getAssetMeta } from 'app/utils/market/utils'
import { walletUrl } from 'app/utils/walletUtils'

class GiftNFT extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -74,7 +75,7 @@ class GiftNFT extends React.Component {
</span>
}

items.push(<tr key={count} title={tt('g.gift') + ' ' + data.title} className={count % 2 == 0 ? '' : 'zebra'} onClick={e => this.giftNFT(e, token_id)}>
items.push(<tr key={count} title={tt('g.gift') + ' ' + data.title + ' (#' + token.token_id + ')'} className={count % 2 == 0 ? '' : 'zebra'} onClick={e => this.giftNFT(e, token_id)}>
<td>
<NFTSmallIcon image={image} onClick={e => e.preventDefault()} />
</td>
Expand All @@ -89,8 +90,22 @@ class GiftNFT extends React.Component {
++count
}

if (!items.length) {
if (!nft_tokens) {
items = <LoadingIndicator type='circle' />
} else if (!items.length) {
items = <div style={{ marginBottom: '1rem' }}>
{tt('gift_nft.no_tokens')}
{currentUser && <span>
<a href={walletUrl('/@' + currentUser.get('username') + '/nft-collections')} target='_blank' rel='noreferrer nofollow'>
{tt('gift_nft.issue')}
</a>
{tt('gift_nft.no_tokens2')}
<a href={walletUrl('/nft')} target='_blank' rel='noreferrer nofollow'>
{tt('gift_nft.buy')}
</a>
{tt('gift_nft.no_tokens3')}
</span>}
</div>
} else {
items = <table><tbody>
{items}
Expand Down
7 changes: 7 additions & 0 deletions app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,13 @@
"ok": "Ok",
"confirm": "Confirm"
},
"gift_nft": {
"no_tokens": "You haven't any NFT-tokens yet. ",
"issue": "Issue",
"no_tokens2": " or ",
"buy": "buy",
"no_tokens3": " them."
},
"header_jsx": {
"home": "home",
"created": "New",
Expand Down
7 changes: 7 additions & 0 deletions app/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@
"unwanted_operation_cost": "Плата за отправку нежелательных операций (если получатель заблокировал отправителя или выбрал Не беспокоить)",
"unlimit_operation_cost": "Плата за отправку операций при отрицательной репутации, за обход лимитов post/comment/vote-window"
},
"gift_nft": {
"no_tokens": "У вас пока еще нет NFT-токенов. ",
"issue": "Создайте",
"no_tokens2": " или ",
"buy": "купите",
"no_tokens3": " их."
},
"header_jsx": {
"home": "Лента",
"created": "Новые",
Expand Down

0 comments on commit 2bcee4f

Please sign in to comment.