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
ba040562
Commit
ba040562
authored
Aug 30, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
private tags page
parent
77f8ec65
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
143 additions
and
37 deletions
+143
-37
PrivateTags.tsx
ui/pages/PrivateTags.tsx
+1
-1
AddressTagListItem.tsx
ui/privateTags/AddressTagTable/AddressTagListItem.tsx
+41
-0
AddressTagTableItem.tsx
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
+2
-7
PrivateAddressTags.tsx
ui/privateTags/PrivateAddressTags.tsx
+28
-11
PrivateTransactionTags.tsx
ui/privateTags/PrivateTransactionTags.tsx
+27
-10
TransactionTagListItem.tsx
...rivateTags/TransactionTagTable/TransactionTagListItem.tsx
+41
-0
TransactionTagTableItem.tsx
...ivateTags/TransactionTagTable/TransactionTagTableItem.tsx
+2
-7
AddressLinkWithTooltip.tsx
ui/shared/AddressLinkWithTooltip.tsx
+1
-1
No files found.
ui/pages/PrivateTags.tsx
View file @
ba040562
...
@@ -27,7 +27,7 @@ const PrivateTags = ({ onChangeTab: onChangeTabProps }: Props) => {
...
@@ -27,7 +27,7 @@ const PrivateTags = ({ onChangeTab: onChangeTabProps }: Props) => {
<
Box
h=
"100%"
>
<
Box
h=
"100%"
>
<
AccountPageHeader
text=
"Private tags"
/>
<
AccountPageHeader
text=
"Private tags"
/>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
onTabChange
}
>
<
Tabs
variant=
"soft-rounded"
colorScheme=
"blue"
isLazy
onChange=
{
onTabChange
}
>
<
TabList
marginBottom=
{
8
}
>
<
TabList
marginBottom=
{
{
base
:
6
,
lg
:
8
}
}
>
<
Tab
>
Address
</
Tab
>
<
Tab
>
Address
</
Tab
>
<
Tab
>
Transaction
</
Tab
>
<
Tab
>
Transaction
</
Tab
>
</
TabList
>
</
TabList
>
...
...
ui/privateTags/AddressTagTable/AddressTagListItem.tsx
0 → 100644
View file @
ba040562
import
{
Tag
,
Flex
,
HStack
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
AddressTag
}
from
'
types/api/account
'
;
import
AccountListItemMobile
from
'
ui/shared/AccountListItemMobile
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
interface
Props
{
item
:
AddressTag
;
onEditClick
:
(
data
:
AddressTag
)
=>
void
;
onDeleteClick
:
(
data
:
AddressTag
)
=>
void
;
}
const
AddressTagListItem
=
({
item
,
onEditClick
,
onDeleteClick
}:
Props
)
=>
{
const
onItemEditClick
=
useCallback
(()
=>
{
return
onEditClick
(
item
);
},
[
item
,
onEditClick
]);
const
onItemDeleteClick
=
useCallback
(()
=>
{
return
onDeleteClick
(
item
);
},
[
item
,
onDeleteClick
]);
return
(
<
AccountListItemMobile
>
<
Flex
alignItems=
"flex-start"
flexDirection=
"column"
maxW=
"100%"
>
<
AddressSnippet
address=
{
item
.
address_hash
}
/>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
{
item
.
name
}
</
Tag
>
</
HStack
>
</
Flex
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
</
AccountListItemMobile
>
);
};
export
default
React
.
memo
(
AddressTagListItem
);
ui/privateTags/AddressTagTable/AddressTagTableItem.tsx
View file @
ba040562
...
@@ -2,15 +2,13 @@ import {
...
@@ -2,15 +2,13 @@ import {
Tag
,
Tag
,
Tr
,
Tr
,
Td
,
Td
,
HStack
,
}
from
'
@chakra-ui/react
'
;
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
AddressTag
}
from
'
types/api/account
'
;
import
type
{
AddressTag
}
from
'
types/api/account
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
AddressSnippet
from
'
ui/shared/AddressSnippet
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
import
TruncatedTextTooltip
from
'
ui/shared/TruncatedTextTooltip
'
;
interface
Props
{
interface
Props
{
...
@@ -41,10 +39,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -41,10 +39,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
HStack
spacing=
{
6
}
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
<
EditButton
onClick=
{
onItemEditClick
}
/>
<
DeleteButton
onClick=
{
onItemDeleteClick
}
/>
</
HStack
>
</
Td
>
</
Td
>
</
Tr
>
</
Tr
>
);
);
...
...
ui/privateTags/PrivateAddressTags.tsx
View file @
ba040562
import
{
Box
,
Button
,
Text
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
AddressTags
,
AddressTag
}
from
'
types/api/account
'
;
import
type
{
AddressTags
,
AddressTag
}
from
'
types/api/account
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
AddressModal
from
'
./AddressModal/AddressModal
'
;
import
AddressModal
from
'
./AddressModal/AddressModal
'
;
import
AddressTagListItem
from
'
./AddressTagTable/AddressTagListItem
'
;
import
AddressTagTable
from
'
./AddressTagTable/AddressTagTable
'
;
import
AddressTagTable
from
'
./AddressTagTable/AddressTagTable
'
;
import
DeletePrivateTagModal
from
'
./DeletePrivateTagModal
'
;
import
DeletePrivateTagModal
from
'
./DeletePrivateTagModal
'
;
...
@@ -18,6 +21,7 @@ const PrivateAddressTags = () => {
...
@@ -18,6 +21,7 @@ const PrivateAddressTags = () => {
const
addressModalProps
=
useDisclosure
();
const
addressModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
isMobile
=
useIsMobile
();
const
[
addressModalData
,
setAddressModalData
]
=
useState
<
AddressTag
>
();
const
[
addressModalData
,
setAddressModalData
]
=
useState
<
AddressTag
>
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
AddressTag
>
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
AddressTag
>
();
...
@@ -43,10 +47,10 @@ const PrivateAddressTags = () => {
...
@@ -43,10 +47,10 @@ const PrivateAddressTags = () => {
},
[
deleteModalProps
]);
},
[
deleteModalProps
]);
const
description
=
(
const
description
=
(
<
Text
marginBottom=
{
12
}
>
<
AccountPageDescription
>
Use private
transaction tags to label any transaction
s of interest.
Use private
address tags to track any addresse
s of interest.
Private tags are saved in your account and are only visible when you are logged in.
Private tags are saved in your account and are only visible when you are logged in.
</
Text
>
</
AccountPageDescription
>
);
);
if
(
isLoading
&&
!
addressTagsData
)
{
if
(
isLoading
&&
!
addressTagsData
)
{
...
@@ -63,16 +67,29 @@ const PrivateAddressTags = () => {
...
@@ -63,16 +67,29 @@ const PrivateAddressTags = () => {
return
<
DataFetchAlert
/>;
return
<
DataFetchAlert
/>;
}
}
return
(
const
list
=
isMobile
?
(
<>
<
Box
>
{
description
}
{
addressTagsData
.
map
((
item
:
AddressTag
)
=>
(
{
Boolean
(
addressTagsData
?.
length
)
&&
(
<
AddressTagListItem
<
AddressTagTable
item=
{
item
}
data=
{
addressTagsData
}
key=
{
item
.
id
}
onDeleteClick=
{
onDeleteClick
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
onEditClick=
{
onEditClick
}
/>
/>
)
}
))
}
</
Box
>
)
:
(
<
AddressTagTable
data=
{
addressTagsData
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
/>
);
return
(
<>
{
description
}
{
Boolean
(
addressTagsData
?.
length
)
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
variant=
"primary"
...
...
ui/privateTags/PrivateTransactionTags.tsx
View file @
ba040562
import
{
Box
,
Button
,
Skeleton
,
Text
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
React
,
{
useCallback
,
useState
}
from
'
react
'
;
import
type
{
TransactionTags
,
TransactionTag
}
from
'
types/api/account
'
;
import
type
{
TransactionTags
,
TransactionTag
}
from
'
types/api/account
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
fetch
from
'
lib/client/fetch
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
DeletePrivateTagModal
from
'
./DeletePrivateTagModal
'
;
import
DeletePrivateTagModal
from
'
./DeletePrivateTagModal
'
;
import
TransactionModal
from
'
./TransactionModal/TransactionModal
'
;
import
TransactionModal
from
'
./TransactionModal/TransactionModal
'
;
import
TransactionTagListItem
from
'
./TransactionTagTable/TransactionTagListItem
'
;
import
TransactionTagTable
from
'
./TransactionTagTable/TransactionTagTable
'
;
import
TransactionTagTable
from
'
./TransactionTagTable/TransactionTagTable
'
;
const
PrivateTransactionTags
=
()
=>
{
const
PrivateTransactionTags
=
()
=>
{
...
@@ -18,6 +21,7 @@ const PrivateTransactionTags = () => {
...
@@ -18,6 +21,7 @@ const PrivateTransactionTags = () => {
const
transactionModalProps
=
useDisclosure
();
const
transactionModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
isMobile
=
useIsMobile
();
const
[
transactionModalData
,
setTransactionModalData
]
=
useState
<
TransactionTag
>
();
const
[
transactionModalData
,
setTransactionModalData
]
=
useState
<
TransactionTag
>
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
TransactionTag
>
();
const
[
deleteModalData
,
setDeleteModalData
]
=
useState
<
TransactionTag
>
();
...
@@ -43,10 +47,10 @@ const PrivateTransactionTags = () => {
...
@@ -43,10 +47,10 @@ const PrivateTransactionTags = () => {
},
[
deleteModalProps
]);
},
[
deleteModalProps
]);
const
description
=
(
const
description
=
(
<
Text
marginBottom=
{
12
}
>
<
AccountPageDescription
>
Use private transaction tags to label any transactions of interest.
Use private transaction tags to label any transactions of interest.
Private tags are saved in your account and are only visible when you are logged in.
Private tags are saved in your account and are only visible when you are logged in.
</
Text
>
</
AccountPageDescription
>
);
);
if
(
isLoading
&&
!
transactionTagsData
)
{
if
(
isLoading
&&
!
transactionTagsData
)
{
...
@@ -63,16 +67,29 @@ const PrivateTransactionTags = () => {
...
@@ -63,16 +67,29 @@ const PrivateTransactionTags = () => {
return
<
DataFetchAlert
/>;
return
<
DataFetchAlert
/>;
}
}
return
(
const
list
=
isMobile
?
(
<>
<
Box
>
{
description
}
{
transactionTagsData
.
map
((
item
)
=>
(
{
Boolean
(
transactionTagsData
.
length
)
&&
(
<
TransactionTagListItem
<
TransactionTagTable
item=
{
item
}
data=
{
transactionTagsData
}
key=
{
item
.
id
}
onDeleteClick=
{
onDeleteClick
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
onEditClick=
{
onEditClick
}
/>
/>
)
}
))
}
</
Box
>
)
:
(
<
TransactionTagTable
data=
{
transactionTagsData
}
onDeleteClick=
{
onDeleteClick
}
onEditClick=
{
onEditClick
}
/>
);
return
(
<>
{
description
}
{
Boolean
(
transactionTagsData
.
length
)
&&
list
}
<
Box
marginTop=
{
8
}
>
<
Box
marginTop=
{
8
}
>
<
Button
<
Button
variant=
"primary"
variant=
"primary"
...
...
ui/privateTags/TransactionTagTable/TransactionTagListItem.tsx
0 → 100644
View file @
ba040562
import
{
Tag
,
HStack
,
Text
,
Flex
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
type
{
TransactionTag
}
from
'
types/api/account
'
;
import
AccountListItemMobile
from
'
ui/shared/AccountListItemMobile
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
interface
Props
{
item
:
TransactionTag
;
onEditClick
:
(
data
:
TransactionTag
)
=>
void
;
onDeleteClick
:
(
data
:
TransactionTag
)
=>
void
;
}
const
TransactionTagListItem
=
({
item
,
onEditClick
,
onDeleteClick
}:
Props
)
=>
{
const
onItemEditClick
=
useCallback
(()
=>
{
return
onEditClick
(
item
);
},
[
item
,
onEditClick
]);
const
onItemDeleteClick
=
useCallback
(()
=>
{
return
onDeleteClick
(
item
);
},
[
item
,
onDeleteClick
]);
return
(
<
AccountListItemMobile
>
<
Flex
alignItems=
"flex-start"
flexDirection=
"column"
maxW=
"100%"
>
<
AddressLinkWithTooltip
address=
{
item
.
transaction_hash
}
/>
<
HStack
spacing=
{
3
}
mt=
{
4
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
Private tag
</
Text
>
<
Tag
variant=
"gray"
lineHeight=
"24px"
>
{
item
.
name
}
</
Tag
>
</
HStack
>
</
Flex
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
</
AccountListItemMobile
>
);
};
export
default
React
.
memo
(
TransactionTagListItem
);
ui/privateTags/TransactionTagTable/TransactionTagTableItem.tsx
View file @
ba040562
...
@@ -2,7 +2,6 @@ import {
...
@@ -2,7 +2,6 @@ import {
Tag
,
Tag
,
Tr
,
Tr
,
Td
,
Td
,
HStack
,
Tooltip
,
Tooltip
,
}
from
'
@chakra-ui/react
'
;
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
import
React
,
{
useCallback
}
from
'
react
'
;
...
@@ -10,8 +9,7 @@ import React, { useCallback } from 'react';
...
@@ -10,8 +9,7 @@ import React, { useCallback } from 'react';
import
type
{
TransactionTag
}
from
'
types/api/account
'
;
import
type
{
TransactionTag
}
from
'
types/api/account
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
DeleteButton
from
'
ui/shared/DeleteButton
'
;
import
TableItemActionButtons
from
'
ui/shared/TableItemActionButtons
'
;
import
EditButton
from
'
ui/shared/EditButton
'
;
interface
Props
{
interface
Props
{
item
:
TransactionTag
;
item
:
TransactionTag
;
...
@@ -41,10 +39,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
...
@@ -41,10 +39,7 @@ const AddressTagTableItem = ({ item, onEditClick, onDeleteClick }: Props) => {
</
Tooltip
>
</
Tooltip
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
HStack
spacing=
{
6
}
>
<
TableItemActionButtons
onDeleteClick=
{
onItemDeleteClick
}
onEditClick=
{
onItemEditClick
}
/>
<
EditButton
onClick=
{
onItemEditClick
}
/>
<
DeleteButton
onClick=
{
onItemDeleteClick
}
/>
</
HStack
>
</
Td
>
</
Td
>
</
Tr
>
</
Tr
>
);
);
...
...
ui/shared/AddressLinkWithTooltip.tsx
View file @
ba040562
...
@@ -12,7 +12,7 @@ const AddressLinkWithTooltip = ({ address }: {address: string}) => {
...
@@ -12,7 +12,7 @@ const AddressLinkWithTooltip = ({ address }: {address: string}) => {
const
basePath
=
useBasePath
();
const
basePath
=
useBasePath
();
const
url
=
basePath
+
'
/address/
'
+
address
+
'
/tokens#address-tabs
'
;
const
url
=
basePath
+
'
/address/
'
+
address
+
'
/tokens#address-tabs
'
;
return
(
return
(
<
HStack
spacing=
{
2
}
alignContent=
"center"
overflow=
"hidden"
>
<
HStack
spacing=
{
2
}
alignContent=
"center"
overflow=
"hidden"
maxW=
"100%"
>
<
Link
<
Link
href=
{
url
}
href=
{
url
}
target=
"_blank"
target=
"_blank"
...
...
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