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
572f29d0
Commit
572f29d0
authored
Mar 20, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
fdea72ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
24 deletions
+42
-24
VerifiedContracts.tsx
ui/pages/VerifiedContracts.tsx
+0
-2
VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
..._/VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
+0
-0
VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
...__/VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
VerifiedContractsCounters.tsx
ui/verifiedContracts/VerifiedContractsCounters.tsx
+13
-22
VerifiedContractsCountersItem.tsx
ui/verifiedContracts/VerifiedContractsCountersItem.tsx
+29
-0
No files found.
ui/pages/VerifiedContracts.tsx
View file @
572f29d0
...
...
@@ -34,8 +34,6 @@ const VerifiedContracts = () => {
filters
:
{
q
:
debouncedSearchTerm
,
filter
:
type
},
});
// const counters = useQuery
const
handleSearchTermChange
=
React
.
useCallback
((
value
:
string
)
=>
{
onFilterChange
({
q
:
value
,
filter
:
type
});
setSearchTerm
(
value
);
...
...
ui/pages/__screenshots__/VerifiedContracts.pw.tsx_default_base-view-mobile-1.png
View replaced file @
fdea72ed
View file @
572f29d0
57 KB
|
W:
|
H:
57 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/pages/__screenshots__/VerifiedContracts.pw.tsx_mobile_base-view-mobile-1.png
View replaced file @
fdea72ed
View file @
572f29d0
70.2 KB
|
W:
|
H:
70.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/verifiedContracts/VerifiedContractsCounters.tsx
View file @
572f29d0
import
{
Box
,
Flex
,
Skeleton
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
VerifiedContractsCountersItem
from
'
./VerifiedContractsCountersItem
'
;
const
VerifiedContractsCounters
=
()
=>
{
const
countersQuery
=
useApiQuery
(
'
verified_contracts_counters
'
);
const
itemBgColor
=
useColorModeValue
(
'
blue.50
'
,
'
blue.800
'
);
const
renderItem
=
(
name
:
string
,
total
:
string
,
new24
:
string
)
=>
{
return
(
<
Box
w=
{
{
base
:
'
100%
'
,
lg
:
'
calc((100% - 12px)/2)
'
}
}
borderRadius=
"12px"
backgroundColor=
{
itemBgColor
}
p=
{
3
}
>
<
Text
variant=
"secondary"
fontSize=
"xs"
>
{
name
}
</
Text
>
<
Flex
alignItems=
"baseline"
>
<
Text
fontWeight=
{
600
}
mr=
{
2
}
fontSize=
"lg"
>
{
Number
(
total
).
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Text
fontWeight=
{
600
}
mr=
{
1
}
fontSize=
"lg"
color=
"green.500"
>
+
{
new24
}
</
Text
>
<
Text
variant=
"secondary"
fontSize=
"sm"
>
(24h)
</
Text
>
</
Flex
>
</
Box
>
);
};
if
(
countersQuery
.
isError
)
{
return
null
;
}
...
...
@@ -42,8 +25,16 @@ const VerifiedContractsCounters = () => {
return
(
<>
{
renderItem
(
'
Total contracts
'
,
countersQuery
.
data
.
smart_contracts
,
countersQuery
.
data
.
new_smart_contracts_24h
)
}
{
renderItem
(
'
Verified contracts
'
,
countersQuery
.
data
.
verified_smart_contracts
,
countersQuery
.
data
.
new_verified_smart_contracts_24h
)
}
<
VerifiedContractsCountersItem
name=
"Total contracts"
total=
{
countersQuery
.
data
.
smart_contracts
}
new24=
{
countersQuery
.
data
.
new_smart_contracts_24h
}
/>
<
VerifiedContractsCountersItem
name=
"Verified contracts"
total=
{
countersQuery
.
data
.
verified_smart_contracts
}
new24=
{
countersQuery
.
data
.
new_verified_smart_contracts_24h
}
/>
</>
);
})();
...
...
ui/verifiedContracts/VerifiedContractsCountersItem.tsx
0 → 100644
View file @
572f29d0
import
{
Box
,
Flex
,
Text
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
type
Props
=
{
name
:
string
;
total
:
string
;
new24
:
string
;
}
const
VerifiedContractsCountersItem
=
({
name
,
total
,
new24
}:
Props
)
=>
{
const
itemBgColor
=
useColorModeValue
(
'
blue.50
'
,
'
blue.800
'
);
return
(
<
Box
w=
{
{
base
:
'
100%
'
,
lg
:
'
calc((100% - 12px)/2)
'
}
}
borderRadius=
"12px"
backgroundColor=
{
itemBgColor
}
p=
{
3
}
>
<
Text
variant=
"secondary"
fontSize=
"xs"
>
{
name
}
</
Text
>
<
Flex
alignItems=
"baseline"
>
<
Text
fontWeight=
{
600
}
mr=
{
2
}
fontSize=
"lg"
>
{
Number
(
total
).
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Text
fontWeight=
{
600
}
mr=
{
1
}
fontSize=
"lg"
color=
"green.500"
>
+
{
Number
(
new24
).
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Text
variant=
"secondary"
fontSize=
"sm"
>
(24h)
</
Text
>
</
Flex
>
</
Box
>
);
};
export
default
VerifiedContractsCountersItem
;
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