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
e65edd64
Commit
e65edd64
authored
Aug 30, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address snippet component
parent
ab3fb647
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
28 deletions
+30
-28
CustomAbiTableItem.tsx
ui/customAbi/CustomAbiTable/CustomAbiTableItem.tsx
+2
-7
AddressTagTableItem.tsx
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
+2
-6
PublicTagTableItem.tsx
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
+2
-15
AddressSnippet.tsx
ui/shared/AddressSnippet.tsx
+24
-0
No files found.
ui/customAbi/CustomAbiTable/CustomAbiTableItem.tsx
View file @
e65edd64
...
...
@@ -2,13 +2,12 @@ import {
Tr
,
Td
,
HStack
,
Text
,
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
CustomAbi
}
from
'
types/api/account
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
...
...
@@ -31,11 +30,7 @@ const CustomAbiTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return
(
<
Tr
alignItems=
"top"
key=
{
item
.
id
}
>
<
Td
>
<
HStack
>
<
Text
fontSize=
"md"
fontWeight=
{
600
}
>
{
item
.
contract_address_hash
}
</
Text
>
<
CopyToClipboard
text=
{
item
.
contract_address_hash
}
/>
</
HStack
>
<
Text
fontSize=
"sm"
marginTop=
{
0.5
}
variant=
"secondary"
>
{
item
.
name
}
</
Text
>
<
AddressSnippet
address=
{
item
.
contract_address_hash
}
subtitle=
{
item
.
name
}
/>
</
Td
>
<
Td
>
<
HStack
spacing=
{
6
}
>
...
...
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
View file @
e65edd64
...
...
@@ -8,8 +8,7 @@ import React, { useCallback } from 'react';
import
type
{
AddressTag
}
from
'
types/api/account
'
;
import
AddressIcon
from
'
ui/shared/AddressIcon
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
...
...
@@ -32,10 +31,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
return
(
<
Tr
alignItems=
"top"
key=
{
item
.
id
}
>
<
Td
>
<
HStack
spacing=
{
4
}
>
<
AddressIcon
address=
{
item
.
address_hash
}
/>
<
AddressLinkWithTooltip
address=
{
item
.
address_hash
}
/>
</
HStack
>
<
AddressSnippet
address=
{
item
.
address_hash
}
/>
</
Td
>
<
Td
>
<
TruncatedTextTooltip
label=
{
item
.
name
}
>
...
...
ui/publicTags/PublicTagTable/PublicTagTableItem.tsx
View file @
e65edd64
import
{
Box
,
Tag
,
Tr
,
Td
,
...
...
@@ -11,8 +10,7 @@ import React, { useCallback } from 'react';
import
type
{
PublicTag
}
from
'
types/api/account
'
;
import
AddressIcon
from
'
ui/shared/AddressIcon
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
...
...
@@ -36,18 +34,7 @@ const PublicTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
<
Tr
alignItems=
"top"
key=
{
item
.
id
}
>
<
Td
>
<
VStack
spacing=
{
4
}
alignItems=
"unset"
>
{
item
.
addresses
.
map
((
address
)
=>
{
return
(
<
HStack
spacing=
{
4
}
key=
{
address
}
overflow=
"hidden"
alignItems=
"start"
>
<
AddressIcon
address=
{
address
}
/>
<
Box
overflow=
"hidden"
>
<
AddressLinkWithTooltip
address=
{
address
}
/>
{
/* will be added later */
}
{
/* <Text fontSize="sm" variant="secondary" mt={ 0.5 }>Address Name</Text> */
}
</
Box
>
</
HStack
>
);
})
}
{
item
.
addresses
.
map
((
address
)
=>
<
AddressSnippet
key=
{
address
}
address=
{
address
}
/>)
}
</
VStack
>
</
Td
>
<
Td
>
...
...
ui/shared/AddressSnippet.tsx
0 → 100644
View file @
e65edd64
import
{
Box
,
HStack
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
AddressIcon
from
'
ui/shared/AddressIcon
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
interface
Props
{
address
:
string
;
subtitle
?:
string
;
}
const
AddressSnippet
=
({
address
,
subtitle
}:
Props
)
=>
{
return
(
<
HStack
spacing=
{
4
}
key=
{
address
}
overflow=
"hidden"
alignItems=
"start"
>
<
AddressIcon
address=
{
address
}
/>
<
Box
overflow=
"hidden"
>
<
AddressLinkWithTooltip
address=
{
address
}
/>
{
subtitle
&&
<
Text
fontSize=
"sm"
variant=
"secondary"
mt=
{
0.5
}
>
{
subtitle
}
</
Text
>
}
</
Box
>
</
HStack
>
);
};
export
default
React
.
memo
(
AddressSnippet
);
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