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
77f8ec65
Commit
77f8ec65
authored
Aug 30, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
public tags page
parent
457a59b9
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
20 deletions
+101
-20
ApiKeys.tsx
ui/pages/ApiKeys.tsx
+4
-3
CustomAbi.tsx
ui/pages/CustomAbi.tsx
+4
-3
PublicTagListItem.tsx
ui/publicTags/PublicTagTable/PublicTagListItem.tsx
+53
-0
PublicTagTableItem.tsx
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
+2
-7
PublicTagsData.tsx
ui/publicTags/PublicTagsData.tsx
+23
-4
AccountPageDescription.tsx
ui/shared/AccountPageDescription.tsx
+12
-0
AccountPageHeader.tsx
ui/shared/AccountPageHeader.tsx
+2
-2
AddressIcon.tsx
ui/shared/AddressIcon.tsx
+1
-1
No files found.
ui/pages/ApiKeys.tsx
View file @
77f8ec65
...
...
@@ -11,6 +11,7 @@ import ApiKeyModal from 'ui/apiKey/ApiKeyModal/ApiKeyModal';
import
ApiKeyListItem
from
'
ui/apiKey/ApiKeyTable/ApiKeyListItem
'
;
import
ApiKeyTable
from
'
ui/apiKey/ApiKeyTable/ApiKeyTable
'
;
import
DeleteApiKeyModal
from
'
ui/apiKey/DeleteApiKeyModal
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
...
...
@@ -50,10 +51,10 @@ const ApiKeysPage: React.FC = () => {
},
[
deleteModalProps
]);
const
description
=
(
<
Text
marginBottom=
{
{
base
:
6
,
lg
:
12
}
}
>
Create API keys to use for your RPC and EthRPC API requests. For more information, see
{
space
}
<
AccountPageDescription
>
Create API keys to use for your RPC and EthRPC API requests. For more information, see
{
space
}
<
Link
href=
"#"
>
“How to use a Blockscout API key”
</
Link
>
.
</
Text
>
</
AccountPageDescription
>
);
const
content
=
(()
=>
{
...
...
ui/pages/CustomAbi.tsx
View file @
77f8ec65
import
{
Box
,
Button
,
HStack
,
Text
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
HStack
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
...
...
@@ -10,6 +10,7 @@ import CustomAbiModal from 'ui/customAbi/CustomAbiModal/CustomAbiModal';
import
CustomAbiListItem
from
'
ui/customAbi/CustomAbiTable/CustomAbiListItem
'
;
import
CustomAbiTable
from
'
ui/customAbi/CustomAbiTable/CustomAbiTable
'
;
import
DeleteCustomAbiModal
from
'
ui/customAbi/DeleteCustomAbiModal
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
AccountPageHeader
from
'
ui/shared/AccountPageHeader
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
...
...
@@ -47,9 +48,9 @@ const CustomAbiPage: React.FC = () => {
},
[
deleteModalProps
]);
const
description
=
(
<
Text
marginBottom=
{
{
base
:
6
,
lg
:
12
}
}
>
<
AccountPageDescription
>
Add custom ABIs for any contract and access when logged into your account. Helpful for debugging, functional testing and contract interaction.
</
Text
>
</
AccountPageDescription
>
);
const
content
=
(()
=>
{
...
...
ui/publicTags/PublicTagTable/PublicTagListItem.tsx
0 → 100644
View file @
77f8ec65
import
{
Tag
,
VStack
,
Text
,
HStack
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
PublicTag
}
from
'
types/api/account
'
;
import
AccountListItemMobile
from
'
ui/shared/AccountListItemMobile
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
interface
Props
{
item
:
PublicTag
;
onEditClick
:
(
data
:
PublicTag
)
=>
void
;
onDeleteClick
:
(
data
:
PublicTag
)
=>
void
;
}
const
PublicTagListItem
=
({
item
,
onEditClick
,
onDeleteClick
}:
Props
)
=>
{
const
onItemEditClick
=
useCallback
(()
=>
{
return
onEditClick
(
item
);
},
[
item
,
onEditClick
]);
const
onItemDeleteClick
=
useCallback
(()
=>
{
return
onDeleteClick
(
item
);
},
[
item
,
onDeleteClick
]);
return
(
<
AccountListItemMobile
>
<
VStack
spacing=
{
4
}
alignItems=
"flex-start"
maxW=
"100%"
>
<
VStack
spacing=
{
4
}
alignItems=
"unset"
maxW=
"100%"
>
{
item
.
addresses
.
map
((
address
)
=>
<
AddressSnippet
key=
{
address
}
address=
{
address
}
/>)
}
</
VStack
>
<
HStack
spacing=
{
3
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Public tags
</
Text
>
<
HStack
spacing=
{
2
}
alignItems=
"baseline"
>
{
item
.
tags
.
split
(
'
;
'
).
map
((
tag
)
=>
{
return
(
<
TruncatedTextTooltip
label=
{
tag
}
key=
{
tag
}
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
{
tag
}
</
Tag
>
</
TruncatedTextTooltip
>
);
})
}
</
HStack
>
</
HStack
>
<
Text
fontSize=
"sm"
fontWeight=
"500"
>
Submitted
</
Text
>
</
VStack
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
</
AccountListItemMobile
>
);
};
export
default
React
.
memo
(
PublicTagListItem
);
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
View file @
77f8ec65
...
...
@@ -2,7 +2,6 @@ import {
Tag
,
Tr
,
Td
,
HStack
,
VStack
,
Text
,
}
from
'
@chakra-ui/react
'
;
...
...
@@ -11,8 +10,7 @@ import React, { useCallback } from 'react';
import
type
{
PublicTag
}
from
'
types/api/account
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
interface
Props
{
...
...
@@ -56,10 +54,7 @@ const PublicTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
</
VStack
>
</
Td
>
<
Td
>
<
HStack
spacing=
{
6
}
>
<
EditButton
onClick=
{
onItemEditClick
}
/>
<
DeleteButton
onClick=
{
onItemDeleteClick
}
/>
</
HStack
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
</
Td
>
</
Tr
>
);
...
...
ui/publicTags/PublicTagsData.tsx
View file @
77f8ec65
import
{
Box
,
Text
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
PublicTags
,
PublicTag
}
from
'
types/api/account
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
PublicTagListItem
from
'
ui/publicTags/PublicTagTable/PublicTagListItem
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
...
...
@@ -19,6 +22,7 @@ type Props = {
const
PublicTagsData
=
({
changeToFormScreen
,
onTagDelete
}:
Props
)
=>
{
const
deleteModalProps
=
useDisclosure
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
PublicTag
>
();
const
isMobile
=
useIsMobile
();
const
{
data
,
isLoading
,
isError
}
=
useQuery
<
unknown
,
unknown
,
PublicTags
>
([
'
public-tags
'
],
async
()
=>
await
fetch
(
'
/api/account/public-tags
'
));
...
...
@@ -41,12 +45,12 @@ const PublicTagsData = ({ changeToFormScreen, onTagDelete }: Props) => {
},
[
deleteModalProps
]);
const
description
=
(
<
Text
marginBottom=
{
12
}
>
<
AccountPageDescription
>
You can request a public category tag which is displayed to all Blockscout users.
Public tags may be added to contract or external addresses, and any associated transactions will inherit that tag.
Clicking a tag opens a page with related information and helps provide context and data organization.
Requests are sent to a moderator for review and approval. This process can take several days.
</
Text
>
</
AccountPageDescription
>
);
if
(
isLoading
)
{
...
...
@@ -63,10 +67,25 @@ const PublicTagsData = ({ changeToFormScreen, onTagDelete }: Props) => {
return
<
DataFetchAlert
/>;
}
const
list
=
isMobile
?
(
<
Box
>
{
data
.
map
((
item
)
=>
(
<
PublicTagListItem
item=
{
item
}
key=
{
item
.
id
}
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
))
}
</
Box
>
)
:
(
<
PublicTagTable
data=
{
data
}
onEditClick=
{
onItemEditClick
}
onDeleteClick=
{
onItemDeleteClick
}
/>
);
return
(
<>
{
description
}
{
data
.
length
>
0
&&
<
PublicTagTable
data=
{
data
}
onEditClick=
{
onItemEditClick
}
onDeleteClick=
{
onItemDeleteClick
}
/>
}
{
data
.
length
>
0
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Button
variant=
"primary"
...
...
ui/shared/AccountPageDescription.tsx
0 → 100644
View file @
77f8ec65
import
{
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
const
AccountPageDescription
=
({
children
}:
{
children
:
React
.
ReactNode
})
=>
{
return
(
<
Text
marginBottom=
{
{
base
:
6
,
lg
:
12
}
}
>
{
children
}
</
Text
>
);
};
export
default
AccountPageDescription
;
ui/shared/AccountPageHeader.tsx
View file @
77f8ec65
import
{
Heading
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
const
PageHeader
=
({
text
}:
{
text
:
string
})
=>
{
const
Account
PageHeader
=
({
text
}:
{
text
:
string
})
=>
{
return
(
<
Heading
as=
"h1"
size=
"lg"
marginBottom=
{
{
base
:
6
,
lg
:
8
}
}
>
{
text
}
</
Heading
>
);
};
export
default
PageHeader
;
export
default
Account
PageHeader
;
ui/shared/AddressIcon.tsx
View file @
77f8ec65
...
...
@@ -4,7 +4,7 @@ import Jazzicon, { jsNumberForAddress } from 'react-jazzicon';
const
AddressIcon
=
({
address
}:
{
address
:
string
})
=>
{
return
(
<
Box
width=
"24px"
>
<
Box
width=
"24px"
display=
"inline-flex"
>
<
Jazzicon
diameter=
{
24
}
seed=
{
jsNumberForAddress
(
address
)
}
/>
</
Box
>
);
...
...
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