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
7f3c8b3a
Commit
7f3c8b3a
authored
Feb 16, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve ts
parent
3cc098e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
resources.ts
lib/api/resources.ts
+1
-1
RoutedTabs.tsx
ui/shared/RoutedTabs/RoutedTabs.tsx
+3
-1
No files found.
lib/api/resources.ts
View file @
7f3c8b3a
...
@@ -167,7 +167,7 @@ export const RESOURCES = {
...
@@ -167,7 +167,7 @@ export const RESOURCES = {
address_token_transfers
:
{
address_token_transfers
:
{
path
:
'
/api/v2/addresses/:hash/token-transfers
'
,
path
:
'
/api/v2/addresses/:hash/token-transfers
'
,
paginationFields
:
[
'
block_number
'
as
const
,
'
items_count
'
as
const
,
'
index
'
as
const
,
'
transaction_index
'
as
const
],
paginationFields
:
[
'
block_number
'
as
const
,
'
items_count
'
as
const
,
'
index
'
as
const
,
'
transaction_index
'
as
const
],
filterFields
:
[
'
filter
'
as
const
,
'
type
'
as
const
,
'
token
'
as
const
],
filterFields
:
[
'
filter
'
as
const
,
'
type
'
as
const
,
'
token
_hash
'
as
const
],
},
},
address_blocks_validated
:
{
address_blocks_validated
:
{
path
:
'
/api/v2/addresses/:hash/blocks-validated
'
,
path
:
'
/api/v2/addresses/:hash/blocks-validated
'
,
...
...
ui/shared/RoutedTabs/RoutedTabs.tsx
View file @
7f3c8b3a
...
@@ -10,6 +10,7 @@ import {
...
@@ -10,6 +10,7 @@ import {
chakra
,
chakra
,
}
from
'
@chakra-ui/react
'
;
}
from
'
@chakra-ui/react
'
;
import
type
{
StyleProps
}
from
'
@chakra-ui/styled-system
'
;
import
type
{
StyleProps
}
from
'
@chakra-ui/styled-system
'
;
import
_pickBy
from
'
lodash/pickBy
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'
react
'
;
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'
react
'
;
...
@@ -51,8 +52,9 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, .
...
@@ -51,8 +52,9 @@ const RoutedTabs = ({ tabs, tabListProps, rightSlot, stickyEnabled, className, .
const
handleTabChange
=
React
.
useCallback
((
index
:
number
)
=>
{
const
handleTabChange
=
React
.
useCallback
((
index
:
number
)
=>
{
const
nextTab
=
tabs
[
index
];
const
nextTab
=
tabs
[
index
];
const
queryForPathname
=
_pickBy
(
router
.
query
,
(
value
,
key
)
=>
router
.
pathname
.
includes
(
`[
${
key
}
]`
));
router
.
push
(
router
.
push
(
{
pathname
:
router
.
asPath
.
split
(
'
?
'
)[
0
],
query
:
{
tab
:
nextTab
.
id
}
}
as
Parameters
<
typeof
router
.
push
>
[
0
]
,
{
pathname
:
router
.
pathname
,
query
:
{
...
queryForPathname
,
tab
:
nextTab
.
id
}
}
,
undefined
,
undefined
,
{
shallow
:
true
},
{
shallow
:
true
},
);
);
...
...
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