diff --git a/lib/growthbook/init.ts b/lib/growthbook/init.ts index 15188c8c7c..d98b2b94b7 100644 --- a/lib/growthbook/init.ts +++ b/lib/growthbook/init.ts @@ -7,7 +7,6 @@ import { STORAGE_KEY, STORAGE_LIMIT } from './consts'; export interface GrowthBookFeatures { test_value: string; - marketplace_exp: boolean; } export const growthBook = (() => { diff --git a/ui/marketplace/MarketplaceAppCard.tsx b/ui/marketplace/MarketplaceAppCard.tsx index 19b87e7f5c..223ce5808f 100644 --- a/ui/marketplace/MarketplaceAppCard.tsx +++ b/ui/marketplace/MarketplaceAppCard.tsx @@ -4,7 +4,6 @@ import React, { useCallback } from 'react'; import type { MarketplaceAppPreview } from 'types/client/marketplace'; -import useFeatureValue from 'lib/growthbook/useFeatureValue'; import * as mixpanel from 'lib/mixpanel/index'; import type { IconName } from 'ui/shared/IconSvg'; import IconSvg from 'ui/shared/IconSvg'; @@ -31,13 +30,10 @@ const MarketplaceAppCard = ({ onInfoClick, isFavorite, onFavoriteClick, - isLoading: isDataLoading, + isLoading, showDisclaimer, internalWallet, }: Props) => { - const { value: isExperiment, isLoading: isExperimentLoading } = useFeatureValue('marketplace_exp', false); - const isLoading = isDataLoading || isExperimentLoading; - const categoriesLabel = categories.join(', '); const handleClick = useCallback((event: MouseEvent) => { @@ -59,7 +55,6 @@ const MarketplaceAppCard = ({ }, [ onFavoriteClick, id, isFavorite ]); const logoUrl = useColorModeValue(logo, logoDarkMode || logo); - const moreButtonBgGradient = `linear(to-r, ${ useColorModeValue('whiteAlpha.50', 'blackAlpha.50') }, ${ useColorModeValue('white', 'black') } 20%)`; const [ integrationIcon, integrationIconColor, integrationText ] = React.useMemo(() => { let icon: IconName = 'integration/partial'; @@ -94,14 +89,14 @@ const MarketplaceAppCard = ({ role="group" > - { isExperiment && ( - - - - ) } + + + { shortDescription } { !isLoading && ( - isExperiment ? ( - - - More info - - - ) : ( - + - - More - - - - - ) + More info + + ) } { !isLoading && ( ; - selectedCategoryId: string; - onSelect: (category: string) => void; - isLoading: boolean; -} - -const MarketplaceCategoriesMenu = ({ selectedCategoryId, onSelect, categories, isLoading }: Props) => { - const options = React.useMemo(() => ([ - MarketplaceCategory.FAVORITES, - MarketplaceCategory.ALL, - ...categories, - ]), [ categories ]); - - if (isLoading) { - return ( - - ); - } - - return ( - - - - { selectedCategoryId } - - - - - - { options.map((category: string) => ( - - )) } - - - ); -}; - -export default React.memo(MarketplaceCategoriesMenu); diff --git a/ui/marketplace/MarketplaceCategoriesMenuItem.tsx b/ui/marketplace/MarketplaceCategoriesMenuItem.tsx deleted file mode 100644 index 3d9c983c9e..0000000000 --- a/ui/marketplace/MarketplaceCategoriesMenuItem.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { MenuItem } from '@chakra-ui/react'; -import React, { useCallback } from 'react'; - -import { MarketplaceCategory } from 'types/client/marketplace'; - -import type { IconName } from 'ui/shared/IconSvg'; -import IconSvg from 'ui/shared/IconSvg'; - -type Props = { - id: string; - onClick: (category: string) => void; -} - -const ICONS: Record = { - [MarketplaceCategory.FAVORITES]: 'star_filled', -}; - -const MarketplaceCategoriesMenuItem = ({ id, onClick }: Props) => { - const handleSelection = useCallback(() => { - onClick(id); - }, [ id, onClick ]); - - return ( - - { id in ICONS && } - { id } - - ); -}; - -export default MarketplaceCategoriesMenuItem; diff --git a/ui/marketplace/MarketplaceList.tsx b/ui/marketplace/MarketplaceList.tsx index 0c780aadbe..2d491383e2 100644 --- a/ui/marketplace/MarketplaceList.tsx +++ b/ui/marketplace/MarketplaceList.tsx @@ -4,7 +4,6 @@ import React from 'react'; import type { MarketplaceAppPreview } from 'types/client/marketplace'; import { MarketplaceCategory } from 'types/client/marketplace'; -import useFeatureValue from 'lib/growthbook/useFeatureValue'; import { apos } from 'lib/html-entities'; import EmptySearchResult from 'ui/shared/EmptySearchResult'; import IconSvg from 'ui/shared/IconSvg'; @@ -22,8 +21,6 @@ type Props = { } const MarketplaceList = ({ apps, onAppClick, favoriteApps, onFavoriteClick, isLoading, showDisclaimer, selectedCategoryId }: Props) => { - const { value: isExperiment } = useFeatureValue('marketplace_exp', false); - return apps.length > 0 ? ( You don{ apos }t have any favorite apps. Click on the icon on the app{ apos }s card to add it to Favorites. diff --git a/ui/marketplace/useMarketplaceApps.tsx b/ui/marketplace/useMarketplaceApps.tsx index 7fa02aa94e..07c3d1f383 100644 --- a/ui/marketplace/useMarketplaceApps.tsx +++ b/ui/marketplace/useMarketplaceApps.tsx @@ -7,7 +7,6 @@ import { MarketplaceCategory } from 'types/client/marketplace'; import config from 'configs/app'; import type { ResourceError } from 'lib/api/resources'; import useApiFetch from 'lib/api/useApiFetch'; -import useFeatureValue from 'lib/growthbook/useFeatureValue'; import useFetch from 'lib/hooks/useFetch'; import { MARKETPLACE_APP } from 'stubs/marketplace'; @@ -23,10 +22,7 @@ function isAppCategoryMatches(category: string, app: MarketplaceAppOverview, fav app.categories.includes(category); } -function sortApps(apps: Array, isExperiment: boolean) { - if (!isExperiment) { - return apps.sort((a, b) => a.title.localeCompare(b.title)); - } +function sortApps(apps: Array) { return apps.sort((a, b) => { const priorityA = a.priority || 0; const priorityB = b.priority || 0; @@ -50,7 +46,6 @@ function sortApps(apps: Array, isExperiment: boolean) { export default function useMarketplaceApps(filter: string, selectedCategoryId: string = MarketplaceCategory.ALL, favoriteApps: Array = []) { const fetch = useFetch(); const apiFetch = useApiFetch(); - const { value: isExperiment } = useFeatureValue('marketplace_exp', false); const { isPlaceholderData, isError, error, data } = useQuery, Array>({ queryKey: [ 'marketplace-dapps' ], @@ -63,7 +58,7 @@ export default function useMarketplaceApps(filter: string, selectedCategoryId: s return apiFetch('marketplace_dapps', { pathParams: { chainId: config.chain.id } }); } }, - select: (data) => sortApps(data as Array, isExperiment), + select: (data) => sortApps(data as Array), placeholderData: feature.isEnabled ? Array(9).fill(MARKETPLACE_APP) : undefined, staleTime: Infinity, enabled: feature.isEnabled, diff --git a/ui/marketplace/useMarketplaceCategories.tsx b/ui/marketplace/useMarketplaceCategories.tsx index 1da968f6c9..68b2a8f542 100644 --- a/ui/marketplace/useMarketplaceCategories.tsx +++ b/ui/marketplace/useMarketplaceCategories.tsx @@ -5,7 +5,6 @@ import type { MarketplaceAppOverview } from 'types/client/marketplace'; import config from 'configs/app'; import type { ResourceError } from 'lib/api/resources'; -import useFeatureValue from 'lib/growthbook/useFeatureValue'; import useApiFetch from 'lib/hooks/useFetch'; import { CATEGORIES } from 'stubs/marketplace'; @@ -14,7 +13,6 @@ const categoriesUrl = (feature.isEnabled && feature.categoriesUrl) || ''; export default function useMarketplaceCategories(apps: Array | undefined, isAppsPlaceholderData: boolean) { const apiFetch = useApiFetch(); - const { value: isExperiment } = useFeatureValue('marketplace_exp', false); const { isPlaceholderData, data } = useQuery, Array>({ queryKey: [ 'marketplace-categories' ], @@ -41,7 +39,7 @@ export default function useMarketplaceCategories(apps: Array ({ name: category, count: grouped[category] || 0 })) .filter(c => c.count > 0); - }, [ apps, isAppsPlaceholderData, data, isPlaceholderData, isExperiment ]); + }, [ apps, isAppsPlaceholderData, data, isPlaceholderData ]); return React.useMemo(() => ({ isPlaceholderData: isAppsPlaceholderData || isPlaceholderData, diff --git a/ui/pages/Marketplace.tsx b/ui/pages/Marketplace.tsx index 0093cdd201..1962559368 100644 --- a/ui/pages/Marketplace.tsx +++ b/ui/pages/Marketplace.tsx @@ -6,10 +6,8 @@ import type { TabItem } from 'ui/shared/Tabs/types'; import config from 'configs/app'; import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError'; -import useFeatureValue from 'lib/growthbook/useFeatureValue'; import useIsMobile from 'lib/hooks/useIsMobile'; import MarketplaceAppModal from 'ui/marketplace/MarketplaceAppModal'; -import MarketplaceCategoriesMenu from 'ui/marketplace/MarketplaceCategoriesMenu'; import MarketplaceDisclaimerModal from 'ui/marketplace/MarketplaceDisclaimerModal'; import MarketplaceList from 'ui/marketplace/MarketplaceList'; import FilterInput from 'ui/shared/filters/FilterInput'; @@ -64,7 +62,6 @@ const Marketplace = () => { isCategoriesPlaceholderData, } = useMarketplace(); const isMobile = useIsMobile(); - const { value: isExperiment } = useFeatureValue('marketplace_exp', false); const categoryTabs = React.useMemo(() => { const tabs: Array = categories.map(category => ({ @@ -143,43 +140,28 @@ const Marketplace = () => { ) } /> - { isExperiment && ( - - { (isCategoriesPlaceholderData) ? ( - - ) : ( - - ) } - - ) } - - { !isExperiment && ( - c.name) } - selectedCategoryId={ selectedCategoryId } - onSelect={ onCategoryChange } - isLoading={ isPlaceholderData } + + { (isCategoriesPlaceholderData) ? ( + + ) : ( + ) } - - + +