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
a304f4bb
Commit
a304f4bb
authored
Mar 19, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dapp page top bar for mobiles
parent
56800288
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
15 deletions
+28
-15
AppSecurityReport.tsx
ui/marketplace/AppSecurityReport.tsx
+3
-1
MarketplaceAppInfo.tsx
ui/marketplace/MarketplaceAppInfo.tsx
+1
-1
TriggerButton.tsx
ui/marketplace/MarketplaceAppInfo/TriggerButton.tsx
+5
-4
MarketplaceAppTopBar.tsx
ui/marketplace/MarketplaceAppTopBar.tsx
+15
-6
SolidityscanReportButton.tsx
ui/shared/solidityscanReport/SolidityscanReportButton.tsx
+4
-3
No files found.
ui/marketplace/AppSecurityReport.tsx
View file @
a304f4bb
...
@@ -13,9 +13,10 @@ type Props = {
...
@@ -13,9 +13,10 @@ type Props = {
height
?:
string
|
undefined
;
height
?:
string
|
undefined
;
showContractList
:
()
=>
void
;
showContractList
:
()
=>
void
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
onlyIcon
?:
boolean
;
}
}
const
AppSecurityReport
=
({
securityReport
,
height
,
showContractList
,
isLoading
}:
Props
)
=>
{
const
AppSecurityReport
=
({
securityReport
,
height
,
showContractList
,
isLoading
,
onlyIcon
}:
Props
)
=>
{
if
(
!
securityReport
&&
!
isLoading
)
{
if
(
!
securityReport
&&
!
isLoading
)
{
return
null
;
return
null
;
}
}
...
@@ -32,6 +33,7 @@ const AppSecurityReport = ({ securityReport, height, showContractList, isLoading
...
@@ -32,6 +33,7 @@ const AppSecurityReport = ({ securityReport, height, showContractList, isLoading
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
height=
{
height
}
height=
{
height
}
score=
{
securityScore
}
score=
{
securityScore
}
onlyIcon=
{
onlyIcon
}
popoverContent=
{
(
popoverContent=
{
(
<>
<>
<
Box
mb=
{
5
}
>
<
Box
mb=
{
5
}
>
...
...
ui/marketplace/MarketplaceAppInfo.tsx
View file @
a304f4bb
...
@@ -22,7 +22,7 @@ const MarketplaceAppInfo = ({ data }: Props) => {
...
@@ -22,7 +22,7 @@ const MarketplaceAppInfo = ({ data }: Props) => {
if
(
isMobile
)
{
if
(
isMobile
)
{
return
(
return
(
<>
<>
<
TriggerButton
onClick=
{
onToggle
}
/>
<
TriggerButton
onClick=
{
onToggle
}
onlyIcon
/>
<
Modal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
size=
"full"
>
<
Modal
isOpen=
{
isOpen
}
onClose=
{
onClose
}
size=
"full"
>
<
ModalContent
>
<
ModalContent
>
<
ModalCloseButton
/>
<
ModalCloseButton
/>
...
...
ui/marketplace/MarketplaceAppInfo/TriggerButton.tsx
View file @
a304f4bb
...
@@ -5,9 +5,10 @@ import IconSvg from 'ui/shared/IconSvg';
...
@@ -5,9 +5,10 @@ import IconSvg from 'ui/shared/IconSvg';
interface
Props
{
interface
Props
{
onClick
:
()
=>
void
;
onClick
:
()
=>
void
;
onlyIcon
?:
boolean
;
}
}
const
TriggerButton
=
({
onClick
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLButtonElement
>
)
=>
{
const
TriggerButton
=
({
onClick
,
onlyIcon
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTMLButtonElement
>
)
=>
{
return
(
return
(
<
Button
<
Button
ref=
{
ref
}
ref=
{
ref
}
...
@@ -17,11 +18,11 @@ const TriggerButton = ({ onClick }: Props, ref: React.ForwardedRef<HTMLButtonEle
...
@@ -17,11 +18,11 @@ const TriggerButton = ({ onClick }: Props, ref: React.ForwardedRef<HTMLButtonEle
onClick=
{
onClick
}
onClick=
{
onClick
}
aria
-
label=
"Show project info"
aria
-
label=
"Show project info"
fontWeight=
{
500
}
fontWeight=
{
500
}
px=
{
2
}
px=
{
onlyIcon
?
1
:
2
}
h=
"32px"
h=
"32px"
>
>
<
IconSvg
name=
"info"
boxSize=
{
6
}
mr=
{
1
}
/>
<
IconSvg
name=
"info"
boxSize=
{
6
}
mr=
{
onlyIcon
?
0
:
1
}
/>
<
span
>
Info
</
span
>
{
!
onlyIcon
&&
<
span
>
Info
</
span
>
}
</
Button
>
</
Button
>
);
);
};
};
...
...
ui/marketplace/MarketplaceAppTopBar.tsx
View file @
a304f4bb
import
{
chakra
,
Flex
,
Tooltip
,
Skeleton
,
useBoolean
}
from
'
@chakra-ui/react
'
;
import
{
chakra
,
Flex
,
Tooltip
,
Skeleton
,
useBoolean
,
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
MarketplaceAppOverview
}
from
'
types/client/marketplace
'
;
import
type
{
MarketplaceAppOverview
}
from
'
types/client/marketplace
'
;
...
@@ -7,6 +7,7 @@ import { ContractListTypes } from 'types/client/marketplace';
...
@@ -7,6 +7,7 @@ import { ContractListTypes } from 'types/client/marketplace';
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
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
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
...
@@ -26,6 +27,7 @@ type Props = {
...
@@ -26,6 +27,7 @@ type Props = {
const
MarketplaceAppTopBar
=
({
data
,
isLoading
,
isWalletConnected
,
securityReport
}:
Props
)
=>
{
const
MarketplaceAppTopBar
=
({
data
,
isLoading
,
isWalletConnected
,
securityReport
}:
Props
)
=>
{
const
[
showContractList
,
setShowContractList
]
=
useBoolean
(
false
);
const
[
showContractList
,
setShowContractList
]
=
useBoolean
(
false
);
const
appProps
=
useAppContext
();
const
appProps
=
useAppContext
();
const
isMobile
=
useIsMobile
();
const
goBackUrl
=
React
.
useMemo
(()
=>
{
const
goBackUrl
=
React
.
useMemo
(()
=>
{
if
(
appProps
.
referrer
&&
appProps
.
referrer
.
includes
(
'
/apps
'
)
&&
!
appProps
.
referrer
.
includes
(
'
/apps/
'
))
{
if
(
appProps
.
referrer
&&
appProps
.
referrer
.
includes
(
'
/apps
'
)
&&
!
appProps
.
referrer
.
includes
(
'
/apps/
'
))
{
...
@@ -48,17 +50,24 @@ const MarketplaceAppTopBar = ({ data, isLoading, isWalletConnected, securityRepo
...
@@ -48,17 +50,24 @@ const MarketplaceAppTopBar = ({ data, isLoading, isWalletConnected, securityRepo
<
IconSvg
name=
"arrows/east"
boxSize=
{
6
}
transform=
"rotate(180deg)"
margin=
"auto"
color=
"gray.400"
/>
<
IconSvg
name=
"arrows/east"
boxSize=
{
6
}
transform=
"rotate(180deg)"
margin=
"auto"
color=
"gray.400"
/>
</
LinkInternal
>
</
LinkInternal
>
</
Tooltip
>
</
Tooltip
>
<
Skeleton
width=
{
{
base
:
'
100%
'
,
md
:
'
auto
'
}
}
order=
{
{
base
:
4
,
md
:
2
}
}
isLoaded=
{
!
isLoading
}
>
<
Skeleton
width=
{
{
base
:
'
100%
'
,
md
:
'
auto
'
}
}
order=
{
{
base
:
5
,
md
:
2
}
}
isLoaded=
{
!
isLoading
}
>
<
MarketplaceAppAlert
internalWallet=
{
data
?.
internalWallet
}
isWalletConnected=
{
isWalletConnected
}
/>
<
MarketplaceAppAlert
internalWallet=
{
data
?.
internalWallet
}
isWalletConnected=
{
isWalletConnected
}
/>
</
Skeleton
>
</
Skeleton
>
<
Skeleton
order=
{
{
base
:
2
,
md
:
3
}
}
isLoaded=
{
!
isLoading
}
>
<
Skeleton
order=
{
{
base
:
2
,
md
:
3
}
}
isLoaded=
{
!
isLoading
}
>
<
MarketplaceAppInfo
data=
{
data
}
/>
<
MarketplaceAppInfo
data=
{
data
}
/>
</
Skeleton
>
</
Skeleton
>
<
Skeleton
order=
{
{
base
:
2
,
md
:
3
}
}
isLoaded=
{
!
isLoading
}
>
{
(
securityReport
||
isLoading
)
&&
(
<
AppSecurityReport
securityReport=
{
securityReport
}
showContractList=
{
setShowContractList
.
on
}
/>
<
Box
order=
{
{
base
:
3
,
md
:
4
}
}
>
</
Skeleton
>
<
AppSecurityReport
securityReport=
{
securityReport
}
showContractList=
{
setShowContractList
.
on
}
isLoading=
{
isLoading
}
onlyIcon=
{
isMobile
}
/>
</
Box
>
)
}
<
LinkExternal
<
LinkExternal
order=
{
{
base
:
3
,
md
:
4
}
}
order=
{
{
base
:
4
,
md
:
5
}
}
href=
{
data
?.
url
}
href=
{
data
?.
url
}
variant=
"subtle"
variant=
"subtle"
fontSize=
"sm"
fontSize=
"sm"
...
...
ui/shared/solidityscanReport/SolidityscanReportButton.tsx
View file @
a304f4bb
...
@@ -20,9 +20,10 @@ interface Props {
...
@@ -20,9 +20,10 @@ interface Props {
popoverContent
?:
React
.
ReactNode
;
popoverContent
?:
React
.
ReactNode
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
height
?:
string
;
height
?:
string
;
onlyIcon
?:
boolean
;
}
}
const
SolidityscanReportButton
=
({
className
,
score
,
popoverContent
,
isLoading
,
height
=
'
32px
'
}:
Props
)
=>
{
const
SolidityscanReportButton
=
({
className
,
score
,
popoverContent
,
isLoading
,
height
=
'
32px
'
,
onlyIcon
}:
Props
)
=>
{
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onToggle
,
onClose
}
=
useDisclosure
();
const
{
scoreColor
}
=
useScoreLevelAndColor
(
score
);
const
{
scoreColor
}
=
useScoreLevelAndColor
(
score
);
...
@@ -43,8 +44,8 @@ const SolidityscanReportButton = ({ className, score, popoverContent, isLoading,
...
@@ -43,8 +44,8 @@ const SolidityscanReportButton = ({ className, score, popoverContent, isLoading,
h=
{
height
}
h=
{
height
}
flexShrink=
{
0
}
flexShrink=
{
0
}
>
>
<
IconSvg
name=
{
score
<
80
?
'
score/score-not-ok
'
:
'
score/score-ok
'
}
boxSize=
{
5
}
mr=
{
1
}
/>
<
IconSvg
name=
{
score
<
80
?
'
score/score-not-ok
'
:
'
score/score-ok
'
}
boxSize=
{
5
}
mr=
{
onlyIcon
?
0
:
1
}
/>
{
score
}
{
onlyIcon
?
null
:
score
}
</
Button
>
</
Button
>
</
Skeleton
>
</
Skeleton
>
</
PopoverTrigger
>
</
PopoverTrigger
>
...
...
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