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
062f16fb
Commit
062f16fb
authored
Apr 11, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tips to score, explorers, domains
parent
dd93c2bc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
44 deletions
+93
-44
AddressEnsDomains.tsx
ui/address/ensDomains/AddressEnsDomains.tsx
+37
-20
NetworkExplorers.tsx
ui/shared/NetworkExplorers.tsx
+22
-20
PopoverTriggerTooltip.tsx
ui/shared/PopoverTriggerTooltip.tsx
+30
-0
SolidityscanReportButton.tsx
ui/shared/solidityscanReport/SolidityscanReportButton.tsx
+4
-4
No files found.
ui/address/ensDomains/AddressEnsDomains.tsx
View file @
062f16fb
import
{
Box
,
Button
,
chakra
,
Flex
,
Grid
,
Hide
,
Popover
,
PopoverBody
,
PopoverContent
,
PopoverTrigger
,
Show
,
Skeleton
,
useDisclosure
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Flex
,
Grid
,
Hide
,
Popover
,
PopoverBody
,
PopoverContent
,
PopoverTrigger
,
Show
,
Skeleton
,
useDisclosure
,
chakra
,
}
from
'
@chakra-ui/react
'
;
import
_clamp
from
'
lodash/clamp
'
;
import
_clamp
from
'
lodash/clamp
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -12,6 +26,7 @@ import dayjs from 'lib/date/dayjs';
...
@@ -12,6 +26,7 @@ import dayjs from 'lib/date/dayjs';
import
EnsEntity
from
'
ui/shared/entities/ens/EnsEntity
'
;
import
EnsEntity
from
'
ui/shared/entities/ens/EnsEntity
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
PopoverTriggerTooltip
from
'
ui/shared/PopoverTriggerTooltip
'
;
interface
Props
{
interface
Props
{
addressHash
:
string
;
addressHash
:
string
;
...
@@ -90,6 +105,7 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
...
@@ -90,6 +105,7 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
return
(
return
(
<
Popover
isOpen=
{
isOpen
}
onClose=
{
onClose
}
placement=
"bottom-start"
isLazy
>
<
Popover
isOpen=
{
isOpen
}
onClose=
{
onClose
}
placement=
"bottom-start"
isLazy
>
<
PopoverTrigger
>
<
PopoverTrigger
>
<
PopoverTriggerTooltip
label=
"List of names resolved or owned by this address"
>
<
Button
<
Button
size=
"sm"
size=
"sm"
variant=
"outline"
variant=
"outline"
...
@@ -109,6 +125,7 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
...
@@ -109,6 +125,7 @@ const AddressEnsDomains = ({ addressHash, mainDomainName }: Props) => {
<
chakra
.
span
ml=
{
1
}
>
{
totalRecords
}
</
chakra
.
span
>
<
chakra
.
span
ml=
{
1
}
>
{
totalRecords
}
</
chakra
.
span
>
</
Hide
>
</
Hide
>
</
Button
>
</
Button
>
</
PopoverTriggerTooltip
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
w=
{
{
base
:
'
100vw
'
,
lg
:
'
500px
'
}
}
>
<
PopoverContent
w=
{
{
base
:
'
100vw
'
,
lg
:
'
500px
'
}
}
>
<
PopoverBody
px=
{
6
}
py=
{
5
}
fontSize=
"sm"
display=
"flex"
flexDir=
"column"
rowGap=
{
5
}
alignItems=
"flex-start"
>
<
PopoverBody
px=
{
6
}
py=
{
5
}
fontSize=
"sm"
display=
"flex"
flexDir=
"column"
rowGap=
{
5
}
alignItems=
"flex-start"
>
...
...
ui/shared/NetworkExplorers.tsx
View file @
062f16fb
...
@@ -20,6 +20,7 @@ import config from 'configs/app';
...
@@ -20,6 +20,7 @@ import config from 'configs/app';
import
stripTrailingSlash
from
'
lib/stripTrailingSlash
'
;
import
stripTrailingSlash
from
'
lib/stripTrailingSlash
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
PopoverTriggerTooltip
from
'
ui/shared/PopoverTriggerTooltip
'
;
interface
Props
{
interface
Props
{
className
?:
string
;
className
?:
string
;
...
@@ -55,8 +56,8 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
...
@@ -55,8 +56,8 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
return
(
return
(
<
Popover
isOpen=
{
isOpen
}
onClose=
{
onClose
}
placement=
"bottom-start"
isLazy
>
<
Popover
isOpen=
{
isOpen
}
onClose=
{
onClose
}
placement=
"bottom-start"
isLazy
>
<
PopoverTrigger
>
<
PopoverTrigger
>
<
PopoverTriggerTooltip
label=
"Verify with other explorers"
className=
{
className
}
>
<
Button
<
Button
className=
{
className
}
size=
"sm"
size=
"sm"
variant=
"outline"
variant=
"outline"
colorScheme=
"gray"
colorScheme=
"gray"
...
@@ -75,6 +76,7 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
...
@@ -75,6 +76,7 @@ const NetworkExplorers = ({ className, type, pathParam }: Props) => {
<
chakra
.
span
ml=
{
1
}
>
{
explorersLinks
.
length
}
</
chakra
.
span
>
<
chakra
.
span
ml=
{
1
}
>
{
explorersLinks
.
length
}
</
chakra
.
span
>
</
Hide
>
</
Hide
>
</
Button
>
</
Button
>
</
PopoverTriggerTooltip
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
w=
"auto"
>
<
PopoverContent
w=
"auto"
>
<
PopoverBody
>
<
PopoverBody
>
...
...
ui/shared/PopoverTriggerTooltip.tsx
0 → 100644
View file @
062f16fb
import
{
Skeleton
,
Tooltip
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
type
Props
=
{
label
:
string
;
isLoading
?:
boolean
;
className
?:
string
;
children
:
React
.
ReactNode
;
}
const
PopoverTriggerTooltip
=
({
label
,
isLoading
,
className
,
children
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLDivElement
>
)
=>
{
const
isMobile
=
useIsMobile
();
return
(
// tooltip need to be wrapped in div for proper popover positioning
<
Skeleton
isLoaded=
{
!
isLoading
}
borderRadius=
"base"
ref=
{
ref
}
className=
{
className
}
>
<
Tooltip
label=
{
label
}
isDisabled=
{
isMobile
}
// need a delay to avoid flickering when closing the popover
openDelay=
{
100
}
>
{
children
}
</
Tooltip
>
</
Skeleton
>
);
};
export
default
chakra
(
React
.
forwardRef
(
PopoverTriggerTooltip
));
ui/shared/solidityscanReport/SolidityscanReportButton.tsx
View file @
062f16fb
import
{
Button
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
{
Button
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
PopoverTriggerTooltip
from
'
../PopoverTriggerTooltip
'
;
import
useScoreLevelAndColor
from
'
./useScoreLevelAndColor
'
;
import
useScoreLevelAndColor
from
'
./useScoreLevelAndColor
'
;
interface
Props
{
interface
Props
{
...
@@ -21,10 +22,9 @@ const SolidityscanReportButton = (
...
@@ -21,10 +22,9 @@ const SolidityscanReportButton = (
const
{
scoreColor
}
=
useScoreLevelAndColor
(
score
);
const
{
scoreColor
}
=
useScoreLevelAndColor
(
score
);
return
(
return
(
<
Skeleton
isLoaded=
{
!
isLoading
}
borderRadius=
"base"
>
<
PopoverTriggerTooltip
label=
"Security score"
isLoading=
{
isLoading
}
className=
{
className
}
>
<
Button
<
Button
ref=
{
ref
}
ref=
{
ref
}
className=
{
className
}
color=
{
scoreColor
}
color=
{
scoreColor
}
size=
"sm"
size=
"sm"
variant=
"outline"
variant=
"outline"
...
@@ -39,7 +39,7 @@ const SolidityscanReportButton = (
...
@@ -39,7 +39,7 @@ const SolidityscanReportButton = (
<
IconSvg
name=
{
score
<
80
?
'
score/score-not-ok
'
:
'
score/score-ok
'
}
boxSize=
{
5
}
mr=
{
onlyIcon
?
0
:
1
}
/>
<
IconSvg
name=
{
score
<
80
?
'
score/score-not-ok
'
:
'
score/score-ok
'
}
boxSize=
{
5
}
mr=
{
onlyIcon
?
0
:
1
}
/>
{
onlyIcon
?
null
:
score
}
{
onlyIcon
?
null
:
score
}
</
Button
>
</
Button
>
</
Skeleton
>
</
PopoverTriggerTooltip
>
);
);
};
};
...
...
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