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
50db854a
Commit
50db854a
authored
Mar 14, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move MoreInfo button to separate component
parent
63448a8f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
10 deletions
+26
-10
LinkButton.tsx
ui/marketplace/MarketplaceListWithScores/LinkButton.tsx
+2
-8
ListItem.tsx
ui/marketplace/MarketplaceListWithScores/ListItem.tsx
+2
-1
MoreInfoButton.tsx
ui/marketplace/MarketplaceListWithScores/MoreInfoButton.tsx
+20
-0
TableItem.tsx
ui/marketplace/MarketplaceListWithScores/TableItem.tsx
+2
-1
No files found.
ui/marketplace/MarketplaceListWithScores/LinkButton.tsx
View file @
50db854a
...
@@ -7,7 +7,6 @@ import type { IconName } from 'ui/shared/IconSvg';
...
@@ -7,7 +7,6 @@ import type { IconName } from 'ui/shared/IconSvg';
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
export
enum
LinkButtonVariants
{
export
enum
LinkButtonVariants
{
DEFAULT
=
'
default
'
,
ALL_CONTRACTS
=
'
all contracts
'
,
ALL_CONTRACTS
=
'
all contracts
'
,
VERIFIED_CONTRACTS
=
'
verified contracts
'
,
VERIFIED_CONTRACTS
=
'
verified contracts
'
,
}
}
...
@@ -23,20 +22,15 @@ const values = {
...
@@ -23,20 +22,15 @@ const values = {
iconColor
:
'
green.500
'
,
iconColor
:
'
green.500
'
,
tooltip
:
`Number of verified contracts on
${
config
.
chain
.
name
}
`
,
tooltip
:
`Number of verified contracts on
${
config
.
chain
.
name
}
`
,
},
},
[
LinkButtonVariants
.
DEFAULT
]:
{
icon
:
null
,
iconColor
:
null
,
tooltip
:
null
,
},
};
};
interface
Props
{
interface
Props
{
children
:
string
;
children
:
string
;
onClick
:
(
event
:
MouseEvent
)
=>
void
;
onClick
:
(
event
:
MouseEvent
)
=>
void
;
variant
?
:
LinkButtonVariants
;
variant
:
LinkButtonVariants
;
}
}
const
LinkButton
=
({
children
,
onClick
,
variant
=
LinkButtonVariants
.
DEFAULT
}:
Props
)
=>
{
const
LinkButton
=
({
children
,
onClick
,
variant
}:
Props
)
=>
{
const
{
icon
,
iconColor
,
tooltip
}
=
values
[
variant
];
const
{
icon
,
iconColor
,
tooltip
}
=
values
[
variant
];
return
(
return
(
<
Tooltip
<
Tooltip
...
...
ui/marketplace/MarketplaceListWithScores/ListItem.tsx
View file @
50db854a
...
@@ -12,6 +12,7 @@ import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
...
@@ -12,6 +12,7 @@ import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import
AppLink
from
'
./AppLink
'
;
import
AppLink
from
'
./AppLink
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
LinkButton
,
{
LinkButtonVariants
}
from
'
./LinkButton
'
;
import
LinkButton
,
{
LinkButtonVariants
}
from
'
./LinkButton
'
;
import
MoreInfoButton
from
'
./MoreInfoButton
'
;
type
Props
=
{
type
Props
=
{
app
:
MarketplaceAppPreview
&
{
securityReport
?:
any
};
// eslint-disable-line @typescript-eslint/no-explicit-any
app
:
MarketplaceAppPreview
&
{
securityReport
?:
any
};
// eslint-disable-line @typescript-eslint/no-explicit-any
...
@@ -102,7 +103,7 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
...
@@ -102,7 +103,7 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
<
LinkButton
onClick=
{
showVerifiedContracts
}
variant=
{
LinkButtonVariants
.
VERIFIED_CONTRACTS
}
>
{
verifiedNumber
}
</
LinkButton
>
<
LinkButton
onClick=
{
showVerifiedContracts
}
variant=
{
LinkButtonVariants
.
VERIFIED_CONTRACTS
}
>
{
verifiedNumber
}
</
LinkButton
>
</
Flex
>
</
Flex
>
{
!
isLoading
&&
(
{
!
isLoading
&&
(
<
LinkButton
onClick=
{
handleInfoClick
}
>
More info
</
LinkButton
>
<
MoreInfoButton
onClick=
{
handleInfoClick
}
/
>
)
}
)
}
</
Flex
>
</
Flex
>
</
Flex
>
</
Flex
>
...
...
ui/marketplace/MarketplaceListWithScores/MoreInfoButton.tsx
0 → 100644
View file @
50db854a
import
{
Link
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
MouseEvent
}
from
'
react
'
;
interface
Props
{
onClick
:
(
event
:
MouseEvent
)
=>
void
;
}
const
MoreInfoButton
=
({
onClick
}:
Props
)
=>
(
<
Link
fontSize=
"sm"
onClick=
{
onClick
}
fontWeight=
"500"
display=
"inline-flex"
>
More info
</
Link
>
);
export
default
MoreInfoButton
;
ui/marketplace/MarketplaceListWithScores/TableItem.tsx
View file @
50db854a
...
@@ -11,6 +11,7 @@ import IconSvg from 'ui/shared/IconSvg';
...
@@ -11,6 +11,7 @@ import IconSvg from 'ui/shared/IconSvg';
import
AppLink
from
'
./AppLink
'
;
import
AppLink
from
'
./AppLink
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
AppSecurityReport
from
'
./AppSecurityReport
'
;
import
LinkButton
,
{
LinkButtonVariants
}
from
'
./LinkButton
'
;
import
LinkButton
,
{
LinkButtonVariants
}
from
'
./LinkButton
'
;
import
MoreInfoButton
from
'
./MoreInfoButton
'
;
type
Props
=
{
type
Props
=
{
app
:
MarketplaceAppPreview
&
{
securityReport
?:
any
};
// eslint-disable-line @typescript-eslint/no-explicit-any
app
:
MarketplaceAppPreview
&
{
securityReport
?:
any
};
// eslint-disable-line @typescript-eslint/no-explicit-any
...
@@ -93,7 +94,7 @@ const TableItem = ({
...
@@ -93,7 +94,7 @@ const TableItem = ({
<
LinkButton
onClick=
{
showVerifiedContracts
}
variant=
{
LinkButtonVariants
.
VERIFIED_CONTRACTS
}
>
{
verifiedNumber
}
</
LinkButton
>
<
LinkButton
onClick=
{
showVerifiedContracts
}
variant=
{
LinkButtonVariants
.
VERIFIED_CONTRACTS
}
>
{
verifiedNumber
}
</
LinkButton
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
Td
verticalAlign=
"middle"
isNumeric
>
<
LinkButton
onClick=
{
handleInfoClick
}
>
More info
</
LinkButton
>
<
MoreInfoButton
onClick=
{
handleInfoClick
}
/
>
</
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