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
ad5908a5
Commit
ad5908a5
authored
Sep 05, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton example and custom abi form extends
parent
5fc3bf9c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
CustomAbiForm.tsx
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
+1
-0
PrivateAddressTags.tsx
ui/privateTags/PrivateAddressTags.tsx
+23
-4
No files found.
ui/customAbi/CustomAbiModal/CustomAbiForm.tsx
View file @
ad5908a5
...
@@ -128,6 +128,7 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
...
@@ -128,6 +128,7 @@ const CustomAbiForm: React.FC<Props> = ({ data, onClose, setAlertVisible }) => {
<
Textarea
<
Textarea
{
...
field
}
{
...
field
}
size=
"lg"
size=
"lg"
minH=
"300px"
isInvalid=
{
Boolean
(
errors
.
abi
)
}
isInvalid=
{
Boolean
(
errors
.
abi
)
}
/>
/>
<
FormLabel
>
{
getPlaceholderWithError
(
`Custom ABI [{...}] (JSON format)`
,
errors
.
abi
?.
message
)
}
</
FormLabel
>
<
FormLabel
>
{
getPlaceholderWithError
(
`Custom ABI [{...}] (JSON format)`
,
errors
.
abi
?.
message
)
}
</
FormLabel
>
...
...
ui/privateTags/PrivateAddressTags.tsx
View file @
ad5908a5
import
{
Box
,
Button
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Flex
,
Skeleton
,
SkeletonCircle
,
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
delay
from
'
lib/delay
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
AccountPageDescription
from
'
ui/shared/AccountPageDescription
'
;
import
ContentLoader
from
'
ui/shared/ContentLoader
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
import
SkeletonTable
from
'
ui/shared/SkeletonTable
'
;
...
@@ -18,7 +18,13 @@ import DeletePrivateTagModal from './DeletePrivateTagModal';
...
@@ -18,7 +18,13 @@ import DeletePrivateTagModal from './DeletePrivateTagModal';
const
PrivateAddressTags
=
()
=>
{
const
PrivateAddressTags
=
()
=>
{
const
{
data
:
addressTagsData
,
isLoading
,
isError
}
=
const
{
data
:
addressTagsData
,
isLoading
,
isError
}
=
useQuery
<
unknown
,
unknown
,
AddressTags
>
([
'
address-tags
'
],
async
()
=>
fetch
(
'
/api/account/private-tags/address
'
),
{
refetchOnMount
:
false
});
useQuery
<
unknown
,
unknown
,
AddressTags
>
([
'
address-tags
'
],
async
()
=>
{
const
[
result
]
=
await
Promise
.
all
([
fetch
(
'
/api/account/private-tags/address
'
),
delay
(
5
_000
),
]);
return
result
;
},
{
refetchOnMount
:
false
});
const
addressModalProps
=
useDisclosure
();
const
addressModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
const
deleteModalProps
=
useDisclosure
();
...
@@ -55,7 +61,20 @@ const PrivateAddressTags = () => {
...
@@ -55,7 +61,20 @@ const PrivateAddressTags = () => {
);
);
if
(
isLoading
&&
!
addressTagsData
)
{
if
(
isLoading
&&
!
addressTagsData
)
{
const
loader
=
isMobile
?
<
ContentLoader
/>
:
(
const
loader
=
isMobile
?
(
<
Flex
rowGap=
{
3
}
flexDirection=
"column"
>
<
Flex
columnGap=
{
2
}
w=
"100%"
alignItems=
"center"
>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
Skeleton
h=
{
4
}
w=
"100%"
/>
</
Flex
>
<
Skeleton
h=
{
4
}
w=
"164px"
/>
<
Skeleton
h=
{
4
}
w=
"164px"
/>
<
Flex
columnGap=
{
3
}
alignSelf=
"flex-end"
mt=
{
7
}
>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
<
SkeletonCircle
size=
"6"
flexShrink=
"0"
/>
</
Flex
>
</
Flex
>
)
:
(
<>
<>
<
SkeletonTable
columns=
{
[
'
60%
'
,
'
40%
'
,
'
108px
'
]
}
/>
<
SkeletonTable
columns=
{
[
'
60%
'
,
'
40%
'
,
'
108px
'
]
}
/>
<
Skeleton
height=
"44px"
width=
"156px"
marginTop=
{
8
}
/>
<
Skeleton
height=
"44px"
width=
"156px"
marginTop=
{
8
}
/>
...
...
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