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
beec5c82
Unverified
Commit
beec5c82
authored
Sep 02, 2022
by
tom goriunov
Committed by
GitHub
Sep 02, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #121 from blockscout/priv-tags-url
fix private tags urls
parents
cf42a4da
3ab997cf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
31 deletions
+51
-31
useNavItems.tsx
lib/hooks/useNavItems.tsx
+1
-1
private_tags.tsx
...network_type]/[network_sub_type]/account/private_tags.tsx
+0
-23
tag_address.tsx
...[network_type]/[network_sub_type]/account/tag_address.tsx
+16
-0
tag_transaction.tsx
...work_type]/[network_sub_type]/account/tag_transaction.tsx
+16
-0
PrivateTags.tsx
ui/pages/PrivateTags.tsx
+18
-7
No files found.
lib/hooks/useNavItems.tsx
View file @
beec5c82
...
...
@@ -27,7 +27,7 @@ export default function useNavItems() {
const
accountNavItems
=
[
{
text
:
'
Watchlist
'
,
pathname
:
basePath
+
'
/account/watchlist
'
,
icon
:
watchlistIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/
private_tag
s
'
,
icon
:
privateTagIcon
},
{
text
:
'
Private tags
'
,
pathname
:
basePath
+
'
/account/
tag_addres
s
'
,
icon
:
privateTagIcon
},
{
text
:
'
Public tags
'
,
pathname
:
basePath
+
'
/account/public_tags_request
'
,
icon
:
publicTagIcon
},
{
text
:
'
API keys
'
,
pathname
:
basePath
+
'
/account/api_key
'
,
icon
:
apiKeysIcon
},
{
text
:
'
Custom ABI
'
,
pathname
:
basePath
+
'
/account/custom_abi
'
,
icon
:
abiIcon
},
...
...
pages/[network_type]/[network_sub_type]/account/private_tags.tsx
deleted
100644 → 0
View file @
cf42a4da
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
];
const
PrivateTagsPage
:
NextPage
=
()
=>
{
const
[
,
setActiveTab
]
=
useState
(
TABS
[
0
]);
const
onChangeTab
=
useCallback
((
index
:
number
)
=>
{
setActiveTab
(
TABS
[
index
]);
},
[
setActiveTab
]);
return
(
<>
<
Head
><
title
>
Private tags
</
title
></
Head
>
<
PrivateTags
onChangeTab=
{
onChangeTab
}
/>
</>
);
};
export
default
PrivateTagsPage
;
pages/[network_type]/[network_sub_type]/account/tag_address.tsx
0 → 100644
View file @
beec5c82
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
AddressTagsPage
:
NextPage
=
()
=>
{
return
(
<>
<
Head
><
title
>
Public tags
</
title
></
Head
>
<
PrivateTags
tab=
"address"
/>
</>
);
};
export
default
AddressTagsPage
;
pages/[network_type]/[network_sub_type]/account/tag_transaction.tsx
0 → 100644
View file @
beec5c82
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
PrivateTags
from
'
ui/pages/PrivateTags
'
;
const
TransactionTagsPage
:
NextPage
=
()
=>
{
return
(
<>
<
Head
><
title
>
Public tags
</
title
></
Head
>
<
PrivateTags
tab=
"transaction"
/>
</>
);
};
export
default
TransactionTagsPage
;
ui/pages/PrivateTags.tsx
View file @
beec5c82
...
...
@@ -6,27 +6,38 @@ import {
TabPanel
,
TabPanels
,
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
useBasePath
from
'
lib/hooks/useBasePath
'
;
import
PrivateAddressTags
from
'
ui/privateTags/PrivateAddressTags
'
;
import
PrivateTransactionTags
from
'
ui/privateTags/PrivateTransactionTags
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
TABS
=
[
'
address
'
,
'
transaction
'
]
as
const
;
type
TabName
=
typeof
TABS
[
number
];
type
Props
=
{
onChangeTab
:
(
index
:
number
)
=>
void
;
tab
:
TabName
;
}
const
PrivateTags
=
({
onChangeTab
:
onChangeTabProps
}:
Props
)
=>
{
const
onTabChange
=
useCallback
((
index
:
number
)
=>
{
onChangeTabProps
(
index
);
},
[
onChangeTabProps
]);
const
PrivateTags
=
({
tab
}:
Props
)
=>
{
const
[
,
setActiveTab
]
=
useState
<
TabName
>
(
tab
);
const
basePath
=
useBasePath
();
const
onChangeTab
=
useCallback
((
index
:
number
)
=>
{
setActiveTab
(
TABS
[
index
]);
const
newUrl
=
basePath
+
'
/account/
'
+
(
TABS
[
index
]
===
'
address
'
?
'
tag_address
'
:
'
tag_transaction
'
);
history
.
replaceState
(
history
.
state
,
''
,
newUrl
);
},
[
setActiveTab
,
basePath
]);
return
(
<
Page
>
<
Box
h=
"100%"
>
<
AccountPageHeader
text=
"Private tags"
/>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
on
TabChange
}
>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
on
ChangeTab
}
defaultIndex=
{
TABS
.
indexOf
(
tab
)
}
>
<
TabList
marginBottom=
{
8
}
>
<
Tab
>
Address
</
Tab
>
<
Tab
>
Transaction
</
Tab
>
...
...
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