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
35f732fb
Commit
35f732fb
authored
Mar 19, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrap new components in A/B testing
parent
01b0db6d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
39 deletions
+49
-39
init.ts
lib/growthbook/init.ts
+1
-0
MarketplaceAppModal.tsx
ui/marketplace/MarketplaceAppModal.tsx
+4
-1
MarketplaceAppTopBar.tsx
ui/marketplace/MarketplaceAppTopBar.tsx
+3
-1
Marketplace.tsx
ui/pages/Marketplace.tsx
+41
-37
No files found.
lib/growthbook/init.ts
View file @
35f732fb
...
...
@@ -7,6 +7,7 @@ import { STORAGE_KEY, STORAGE_LIMIT } from './consts';
export
interface
GrowthBookFeatures
{
test_value
:
string
;
security_score_exp
:
boolean
;
}
export
const
growthBook
=
(()
=>
{
...
...
ui/marketplace/MarketplaceAppModal.tsx
View file @
35f732fb
...
...
@@ -7,6 +7,7 @@ import React, { useCallback } from 'react';
import
type
{
MarketplaceAppWithSecurityReport
}
from
'
types/client/marketplace
'
;
import
{
ContractListTypes
}
from
'
types/client/marketplace
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
{
nbsp
}
from
'
lib/html-entities
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
...
...
@@ -31,6 +32,8 @@ const MarketplaceAppModal = ({
data
,
showContractList
:
showContractListDefault
,
}:
Props
)
=>
{
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
{
id
,
title
,
...
...
@@ -169,7 +172,7 @@ const MarketplaceAppModal = ({
/>
</
Flex
>
{
securityReport
&&
(
{
(
isExperiment
&&
securityReport
)
&&
(
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
AppSecurityReport
securityReport=
{
securityReport
}
showContractList=
{
showAnalyzedContracts
}
/>
<
ContractListButton
...
...
ui/marketplace/MarketplaceAppTopBar.tsx
View file @
35f732fb
...
...
@@ -7,6 +7,7 @@ import { ContractListTypes } from 'types/client/marketplace';
import
{
route
}
from
'
nextjs-routes
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
...
...
@@ -28,6 +29,7 @@ const MarketplaceAppTopBar = ({ data, isLoading, isWalletConnected, securityRepo
const
[
showContractList
,
setShowContractList
]
=
useBoolean
(
false
);
const
appProps
=
useAppContext
();
const
isMobile
=
useIsMobile
();
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
goBackUrl
=
React
.
useMemo
(()
=>
{
if
(
appProps
.
referrer
&&
appProps
.
referrer
.
includes
(
'
/apps
'
)
&&
!
appProps
.
referrer
.
includes
(
'
/apps/
'
))
{
...
...
@@ -56,7 +58,7 @@ const MarketplaceAppTopBar = ({ data, isLoading, isWalletConnected, securityRepo
<
Skeleton
order=
{
{
base
:
2
,
md
:
3
}
}
isLoaded=
{
!
isLoading
}
>
<
MarketplaceAppInfo
data=
{
data
}
/>
</
Skeleton
>
{
(
securityReport
||
isLoading
)
&&
(
{
(
isExperiment
&&
(
securityReport
||
isLoading
)
)
&&
(
<
Box
order=
{
{
base
:
3
,
md
:
4
}
}
>
<
AppSecurityReport
securityReport=
{
securityReport
}
...
...
ui/pages/Marketplace.tsx
View file @
35f732fb
...
...
@@ -9,6 +9,7 @@ import config from 'configs/app';
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
*
as
cookies
from
'
lib/cookies
'
;
import
throwOnResourceLoadError
from
'
lib/errors/throwOnResourceLoadError
'
;
import
useFeatureValue
from
'
lib/growthbook/useFeatureValue
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
ContractListModal
from
'
ui/marketplace/ContractListModal
'
;
import
MarketplaceAppModal
from
'
ui/marketplace/MarketplaceAppModal
'
;
...
...
@@ -73,6 +74,7 @@ const Marketplace = () => {
}
=
useMarketplace
();
const
isMobile
=
useIsMobile
();
const
{
value
:
isExperiment
}
=
useFeatureValue
(
'
security_score_exp
'
,
false
);
const
categoryTabs
=
React
.
useMemo
(()
=>
{
const
tabs
:
Array
<
TabItem
>
=
categories
.
map
(
category
=>
({
...
...
@@ -181,52 +183,54 @@ const Marketplace = () => {
</
Box
>
<
Flex
direction=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
mb=
{
{
base
:
4
,
lg
:
6
}
}
gap=
{
{
base
:
4
,
lg
:
3
}
}
>
<
RadioButtonGroup
<
MarketplaceDisplayType
>
onChange=
{
handleNFTsDisplayTypeChange
}
defaultValue=
{
displayType
}
name="type"
options=
{
[
{
title
:
'
Discovery
'
,
value
:
'
default
'
,
icon
:
'
apps_xs
'
,
onlyIcon
:
false
,
},
{
title
:
'
Apps scores
'
,
value
:
'
scores
'
,
icon
:
'
apps_list
'
,
onlyIcon
:
false
,
contentAfter
:
(
<
Flex
alignItems=
"center"
h=
{
3
}
bg=
"red.400"
borderRadius=
"2px"
fontSize=
"10px"
fontWeight=
"500"
color=
"white"
px=
"2px"
ml=
{
1
}
>
{
isMobile
?
<
IconSvg
name=
"beta"
boxSize=
{
2
}
/>
:
'
beta
'
}
</
Flex
>
),
},
]
}
autoWidth
/
>
{
isExperiment
&&
(
<
RadioButtonGroup
<
MarketplaceDisplayType
>
onChange=
{
handleNFTsDisplayTypeChange
}
defaultValue=
{
displayType
}
name="type"
options=
{
[
{
title
:
'
Discovery
'
,
value
:
'
default
'
,
icon
:
'
apps_xs
'
,
onlyIcon
:
false
,
},
{
title
:
'
Apps scores
'
,
value
:
'
scores
'
,
icon
:
'
apps_list
'
,
onlyIcon
:
false
,
contentAfter
:
(
<
Flex
alignItems=
"center"
h=
{
3
}
bg=
"red.400"
borderRadius=
"2px"
fontSize=
"10px"
fontWeight=
"500"
color=
"white"
px=
"2px"
ml=
{
1
}
>
{
isMobile
?
<
IconSvg
name=
"beta"
boxSize=
{
2
}
/>
:
'
beta
'
}
</
Flex
>
),
},
]
}
autoWidth
/
>
)
}
<
FilterInput
initialValue=
{
filterQuery
}
onChange=
{
onSearchInputChange
}
placeholder=
"Find app"
isLoading=
{
isPlaceholderData
}
size=
"xs"
size=
{
isExperiment
?
'
xs
'
:
'
sm
'
}
flex=
"1"
/>
</
Flex
>
{
(
displayType
===
'
scores
'
)
?
(
{
(
displayType
===
'
scores
'
&&
isExperiment
)
?
(
<
MarketplaceListWithScores
apps=
{
displayedApps
}
showAppInfo=
{
showAppInfo
}
...
...
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