Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
9a551936
Unverified
Commit
9a551936
authored
Feb 17, 2023
by
tom goriunov
Committed by
GitHub
Feb 17, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #628 from blockscout/token-inventory-fix
fix token inventory pagination and links
parents
a4c20166
92917947
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
TokenInventory.tsx
ui/token/TokenInventory.tsx
+1
-1
TokenInventoryItem.tsx
ui/token/TokenInventoryItem.tsx
+14
-13
No files found.
ui/token/TokenInventory.tsx
View file @
9a551936
...
@@ -66,7 +66,7 @@ const TokenInventory = ({ inventoryQuery }: Props) => {
...
@@ -66,7 +66,7 @@ const TokenInventory = ({ inventoryQuery }: Props) => {
rowGap=
{
{
base
:
3
,
lg
:
6
}
}
rowGap=
{
{
base
:
3
,
lg
:
6
}
}
gridTemplateColumns=
{
{
base
:
'
repeat(2, calc((100% - 12px)/2))
'
,
lg
:
'
repeat(auto-fill, minmax(210px, 1fr))
'
}
}
gridTemplateColumns=
{
{
base
:
'
repeat(2, calc((100% - 12px)/2))
'
,
lg
:
'
repeat(auto-fill, minmax(210px, 1fr))
'
}
}
>
>
{
items
.
map
((
item
)
=>
<
TokenInventoryItem
key=
{
item
.
token
.
address
}
item=
{
item
}
/>)
}
{
items
.
map
((
item
)
=>
<
TokenInventoryItem
key=
{
item
.
token
.
address
+
'
_
'
+
item
.
id
}
item=
{
item
}
/>)
}
</
Grid
></>
</
Grid
></>
);
);
};
};
...
...
ui/token/TokenInventoryItem.tsx
View file @
9a551936
import
{
Flex
,
Link
,
Text
,
LinkBox
,
LinkOverlay
,
useColorModeValue
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Text
,
LinkBox
,
LinkOverlay
,
useColorModeValue
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
NextLink
from
'
next/link
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
TokenInstance
}
from
'
types/api/token
'
;
import
type
{
TokenInstance
}
from
'
types/api/token
'
;
...
@@ -7,14 +7,13 @@ import type { TokenInstance } from 'types/api/token';
...
@@ -7,14 +7,13 @@ import type { TokenInstance } from 'types/api/token';
import
Address
from
'
ui/shared/address/Address
'
;
import
Address
from
'
ui/shared/address/Address
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressIcon
from
'
ui/shared/address/AddressIcon
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
AddressLink
from
'
ui/shared/address/AddressLink
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
NftMedia
from
'
ui/shared/nft/NftMedia
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
type
Props
=
{
item
:
TokenInstance
};
type
Props
=
{
item
:
TokenInstance
};
const
NFTItem
=
({
item
}:
Props
)
=>
{
const
NFTItem
=
({
item
}:
Props
)
=>
{
const
tokenLink
=
route
({
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
item
.
token
.
address
,
id
:
item
.
id
}
});
return
(
return
(
<
LinkBox
<
LinkBox
w=
{
{
base
:
'
100%
'
,
lg
:
'
210px
'
}
}
w=
{
{
base
:
'
100%
'
,
lg
:
'
210px
'
}
}
...
@@ -27,24 +26,26 @@ const NFTItem = ({ item }: Props) => {
...
@@ -27,24 +26,26 @@ const NFTItem = ({ item }: Props) => {
fontWeight=
{
500
}
fontWeight=
{
500
}
lineHeight=
"20px"
lineHeight=
"20px"
>
>
<
LinkOverlay
href=
{
tokenLink
}
>
<
NextLink
href=
{
{
pathname
:
'
/token/[hash]/instance/[id]
'
,
query
:
{
hash
:
item
.
token
.
address
,
id
:
item
.
id
}
}
}
passHref
>
<
NftMedia
<
LinkOverlay
>
mb=
"18px"
<
NftMedia
imageUrl=
{
item
.
image_url
}
mb=
"18px"
animationUrl=
{
item
.
animation_url
}
imageUrl=
{
item
.
image_url
}
/>
animationUrl=
{
item
.
animation_url
}
</
LinkOverlay
>
/>
</
LinkOverlay
>
</
NextLink
>
{
item
.
id
&&
(
{
item
.
id
&&
(
<
Flex
mb=
{
2
}
ml=
{
1
}
>
<
Flex
mb=
{
2
}
ml=
{
1
}
>
<
Text
whiteSpace=
"pre"
variant=
"secondary"
>
ID#
</
Text
>
<
Text
whiteSpace=
"pre"
variant=
"secondary"
>
ID#
</
Text
>
<
TruncatedTextTooltip
label=
{
item
.
id
}
>
<
TruncatedTextTooltip
label=
{
item
.
id
}
>
<
Link
<
Link
Internal
overflow=
"hidden"
overflow=
"hidden"
whiteSpace=
"nowrap"
whiteSpace=
"nowrap"
textOverflow=
"ellipsis"
textOverflow=
"ellipsis"
>
>
{
item
.
id
}
{
item
.
id
}
</
Link
>
</
Link
Internal
>
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
</
Flex
>
</
Flex
>
)
}
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment