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
56800288
Commit
56800288
authored
Mar 19, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add skeletons
parent
00ed752a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
57 deletions
+97
-57
AppSecurityReport.tsx
ui/marketplace/AppSecurityReport.tsx
+9
-9
ContractListButton.tsx
ui/marketplace/ContractListButton.tsx
+19
-9
ListItem.tsx
ui/marketplace/MarketplaceListWithScores/ListItem.tsx
+15
-8
MoreInfoButton.tsx
ui/marketplace/MarketplaceListWithScores/MoreInfoButton.tsx
+17
-8
TableItem.tsx
ui/marketplace/MarketplaceListWithScores/TableItem.tsx
+37
-23
No files found.
ui/marketplace/AppSecurityReport.tsx
View file @
56800288
...
@@ -12,24 +12,24 @@ type Props = {
...
@@ -12,24 +12,24 @@ type Props = {
securityReport
?:
any
;
// eslint-disable-line @typescript-eslint/no-explicit-any
securityReport
?:
any
;
// eslint-disable-line @typescript-eslint/no-explicit-any
height
?:
string
|
undefined
;
height
?:
string
|
undefined
;
showContractList
:
()
=>
void
;
showContractList
:
()
=>
void
;
isLoading
?:
boolean
;
}
}
const
AppSecurityReport
=
({
securityReport
,
height
,
showContractList
}:
Props
)
=>
{
const
AppSecurityReport
=
({
securityReport
,
height
,
showContractList
,
isLoading
}:
Props
)
=>
{
if
(
!
securityReport
)
{
if
(
!
securityReport
&&
!
isLoading
)
{
return
null
;
return
null
;
}
}
const
{
const
{
overallInfo
:
{
securityScore
=
0
,
securityScore
,
solidityScanContractsNumber
=
0
,
solidityScanContractsNumber
,
issueSeverityDistribution
=
{},
issueSeverityDistribution
,
totalIssues
=
0
,
totalIssues
,
}
=
securityReport
?.
overallInfo
||
{};
},
}
=
securityReport
;
return
(
return
(
<
SolidityscanReportButton
<
SolidityscanReportButton
isLoading=
{
isLoading
}
height=
{
height
}
height=
{
height
}
score=
{
securityScore
}
score=
{
securityScore
}
popoverContent=
{
(
popoverContent=
{
(
...
...
ui/marketplace/ContractListButton.tsx
View file @
56800288
import
{
Link
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Link
,
Tooltip
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
...
@@ -28,9 +28,10 @@ interface Props {
...
@@ -28,9 +28,10 @@ interface Props {
children
:
string
;
children
:
string
;
onClick
:
(
event
:
MouseEvent
)
=>
void
;
onClick
:
(
event
:
MouseEvent
)
=>
void
;
variant
:
ContractListButtonVariants
;
variant
:
ContractListButtonVariants
;
isLoading
?:
boolean
;
}
}
const
ContractListButton
=
({
children
,
onClick
,
variant
}:
Props
)
=>
{
const
ContractListButton
=
({
children
,
onClick
,
variant
,
isLoading
}:
Props
)
=>
{
const
{
icon
,
iconColor
,
tooltip
}
=
values
[
variant
];
const
{
icon
,
iconColor
,
tooltip
}
=
values
[
variant
];
return
(
return
(
<
Tooltip
<
Tooltip
...
@@ -40,6 +41,14 @@ const ContractListButton = ({ children, onClick, variant }: Props) => {
...
@@ -40,6 +41,14 @@ const ContractListButton = ({ children, onClick, variant }: Props) => {
isDisabled=
{
!
tooltip
}
isDisabled=
{
!
tooltip
}
openDelay=
{
500
}
openDelay=
{
500
}
width=
"250px"
width=
"250px"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-flex"
alignItems=
"center"
width=
{
isLoading
?
'
40px
'
:
'
auto
'
}
height=
"30px"
borderRadius=
"base"
>
>
<
Link
<
Link
fontSize=
"sm"
fontSize=
"sm"
...
@@ -50,6 +59,7 @@ const ContractListButton = ({ children, onClick, variant }: Props) => {
...
@@ -50,6 +59,7 @@ const ContractListButton = ({ children, onClick, variant }: Props) => {
{
icon
&&
<
IconSvg
name=
{
icon
}
boxSize=
{
5
}
color=
{
iconColor
}
mr=
{
1
}
/>
}
{
icon
&&
<
IconSvg
name=
{
icon
}
boxSize=
{
5
}
color=
{
iconColor
}
mr=
{
1
}
/>
}
{
children
}
{
children
}
</
Link
>
</
Link
>
</
Skeleton
>
</
Tooltip
>
</
Tooltip
>
);
);
};
};
...
...
ui/marketplace/MarketplaceListWithScores/ListItem.tsx
View file @
56800288
...
@@ -93,18 +93,27 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
...
@@ -93,18 +93,27 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
</
Flex
>
</
Flex
>
<
Flex
alignItems=
"center"
>
<
Flex
alignItems=
"center"
>
<
Flex
flex=
{
1
}
gap=
{
3
}
alignItems=
"center"
>
<
Flex
flex=
{
1
}
gap=
{
3
}
alignItems=
"center"
>
{
securityReport
?
(
{
(
securityReport
||
isLoading
)
?
(
<>
<>
<
AppSecurityReport
<
AppSecurityReport
isLoading=
{
isLoading
}
securityReport=
{
securityReport
}
securityReport=
{
securityReport
}
showContractList=
{
showAnalyzedContracts
}
showContractList=
{
showAnalyzedContracts
}
height=
"30px"
height=
"30px"
/>
/>
<
ContractListButton
onClick=
{
showAllContracts
}
variant=
{
ContractListButtonVariants
.
ALL_CONTRACTS
}
>
<
ContractListButton
{
securityReport
.
overallInfo
.
totalContractsNumber
}
onClick=
{
showAllContracts
}
variant=
{
ContractListButtonVariants
.
ALL_CONTRACTS
}
isLoading=
{
isLoading
}
>
{
securityReport
?.
overallInfo
.
totalContractsNumber
}
</
ContractListButton
>
</
ContractListButton
>
<
ContractListButton
onClick=
{
showVerifiedContracts
}
variant=
{
ContractListButtonVariants
.
VERIFIED_CONTRACTS
}
>
<
ContractListButton
{
securityReport
.
overallInfo
.
verifiedNumber
}
onClick=
{
showVerifiedContracts
}
variant=
{
ContractListButtonVariants
.
VERIFIED_CONTRACTS
}
isLoading=
{
isLoading
}
>
{
securityReport
?.
overallInfo
.
verifiedNumber
}
</
ContractListButton
>
</
ContractListButton
>
</>
</>
)
:
(
)
:
(
...
@@ -113,9 +122,7 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
...
@@ -113,9 +122,7 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
</
chakra
.
span
>
</
chakra
.
span
>
)
}
)
}
</
Flex
>
</
Flex
>
{
!
isLoading
&&
(
<
MoreInfoButton
onClick=
{
handleInfoClick
}
isLoading=
{
isLoading
}
/>
<
MoreInfoButton
onClick=
{
handleInfoClick
}
/>
)
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
</
ListItemMobile
>
</
ListItemMobile
>
...
...
ui/marketplace/MarketplaceListWithScores/MoreInfoButton.tsx
View file @
56800288
import
{
Link
}
from
'
@chakra-ui/react
'
;
import
{
Link
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
interface
Props
{
interface
Props
{
onClick
:
(
event
:
MouseEvent
)
=>
void
;
onClick
:
(
event
:
MouseEvent
)
=>
void
;
isLoading
?:
boolean
;
}
}
const
MoreInfoButton
=
({
onClick
}:
Props
)
=>
(
const
MoreInfoButton
=
({
onClick
,
isLoading
}:
Props
)
=>
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-flex"
alignItems=
"center"
height=
"30px"
borderRadius=
"base"
>
<
Link
<
Link
fontSize=
"sm"
fontSize=
"sm"
onClick=
{
onClick
}
onClick=
{
onClick
}
...
@@ -15,6 +23,7 @@ const MoreInfoButton = ({ onClick }: Props) => (
...
@@ -15,6 +23,7 @@ const MoreInfoButton = ({ onClick }: Props) => (
>
>
More info
More info
</
Link
>
</
Link
>
</
Skeleton
>
);
);
export
default
MoreInfoButton
;
export
default
MoreInfoButton
;
ui/marketplace/MarketplaceListWithScores/TableItem.tsx
View file @
56800288
import
{
Td
,
Tr
,
IconButton
}
from
'
@chakra-ui/react
'
;
import
{
Td
,
Tr
,
IconButton
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
...
@@ -61,6 +61,7 @@ const TableItem = ({
...
@@ -61,6 +61,7 @@ const TableItem = ({
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
px=
{
2
}
>
<
Td
verticalAlign=
"middle"
px=
{
2
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
IconButton
<
IconButton
aria
-
label=
"Mark as favorite"
aria
-
label=
"Mark as favorite"
title=
"Mark as favorite"
title=
"Mark as favorite"
...
@@ -74,37 +75,50 @@ const TableItem = ({
...
@@ -74,37 +75,50 @@ const TableItem = ({
<
IconSvg
name=
"star_outline"
w=
{
5
}
h=
{
5
}
color=
"gray.400"
/>
<
IconSvg
name=
"star_outline"
w=
{
5
}
h=
{
5
}
color=
"gray.400"
/>
}
}
/>
/>
</
Skeleton
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
AppLink
app=
{
app
}
isLoading=
{
isLoading
}
onAppClick=
{
onAppClick
}
isLarge
/>
<
AppLink
app=
{
app
}
isLoading=
{
isLoading
}
onAppClick=
{
onAppClick
}
isLarge
/>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
{
securityReport
?
(
{
(
securityReport
||
isLoading
)
?
(
<
AppSecurityReport
securityReport=
{
securityReport
}
showContractList=
{
showAnalyzedContracts
}
/>
<
AppSecurityReport
securityReport=
{
securityReport
}
showContractList=
{
showAnalyzedContracts
}
isLoading=
{
isLoading
}
/>
)
:
(
)
:
(
<
DataNotAvailable
/>
<
DataNotAvailable
/>
)
}
)
}
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
{
securityReport
?
(
{
(
securityReport
||
isLoading
)
?
(
<
ContractListButton
onClick=
{
showAllContracts
}
variant=
{
ContractListButtonVariants
.
ALL_CONTRACTS
}
>
<
ContractListButton
{
securityReport
.
overallInfo
.
totalContractsNumber
}
onClick=
{
showAllContracts
}
variant=
{
ContractListButtonVariants
.
ALL_CONTRACTS
}
isLoading=
{
isLoading
}
>
{
securityReport
?.
overallInfo
.
totalContractsNumber
}
</
ContractListButton
>
</
ContractListButton
>
)
:
(
)
:
(
<
DataNotAvailable
/>
<
DataNotAvailable
/>
)
}
)
}
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
{
securityReport
?
(
{
(
securityReport
||
isLoading
)
?
(
<
ContractListButton
onClick=
{
showVerifiedContracts
}
variant=
{
ContractListButtonVariants
.
VERIFIED_CONTRACTS
}
>
<
ContractListButton
{
securityReport
.
overallInfo
.
verifiedNumber
}
onClick=
{
showVerifiedContracts
}
variant=
{
ContractListButtonVariants
.
VERIFIED_CONTRACTS
}
isLoading=
{
isLoading
}
>
{
securityReport
?.
overallInfo
.
verifiedNumber
}
</
ContractListButton
>
</
ContractListButton
>
)
:
(
)
:
(
<
DataNotAvailable
/>
<
DataNotAvailable
/>
)
}
)
}
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
MoreInfoButton
onClick=
{
handleInfoClick
}
/>
<
MoreInfoButton
onClick=
{
handleInfoClick
}
isLoading=
{
isLoading
}
/>
</
Td
>
</
Td
>
</
Tr
>
</
Tr
>
);
);
...
...
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