diff --git a/ui/marketplace/AppSecurityReport.tsx b/ui/marketplace/AppSecurityReport.tsx index 89f96612a7..8d9edb895c 100644 --- a/ui/marketplace/AppSecurityReport.tsx +++ b/ui/marketplace/AppSecurityReport.tsx @@ -74,7 +74,7 @@ const AppSecurityReport = ({ Smart contracts info - + Verified contracts diff --git a/ui/marketplace/MarketplaceAppTopBar.tsx b/ui/marketplace/MarketplaceAppTopBar.tsx index 5a7ac3f4dd..f7e5235f2d 100644 --- a/ui/marketplace/MarketplaceAppTopBar.tsx +++ b/ui/marketplace/MarketplaceAppTopBar.tsx @@ -1,8 +1,7 @@ -import { chakra, Flex, Tooltip, Skeleton, useBoolean } from '@chakra-ui/react'; +import { chakra, Flex, Tooltip, Skeleton } from '@chakra-ui/react'; import React from 'react'; -import type { MarketplaceAppOverview, MarketplaceAppSecurityReport } from 'types/client/marketplace'; -import { ContractListTypes } from 'types/client/marketplace'; +import type { MarketplaceAppOverview, MarketplaceAppSecurityReport, ContractListTypes } from 'types/client/marketplace'; import { route } from 'nextjs-routes'; @@ -27,8 +26,7 @@ type Props = { } const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => { - const [ isContractListShown, setIsContractListShown ] = useBoolean(false); - const [ contractListType, setContractListType ] = React.useState(ContractListTypes.ALL); + const [ contractListType, setContractListType ] = React.useState(); const appProps = useAppContext(); const isMobile = useIsMobile(); @@ -45,10 +43,8 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => { } catch (err) {} } - const showContractList = React.useCallback((id: string, type: ContractListTypes) => { - setIsContractListShown.on(); - setContractListType(type); - }, [ setIsContractListShown ]); + const showContractList = React.useCallback((id: string, type: ContractListTypes) => setContractListType(type), []); + const hideContractList = React.useCallback(() => setContractListType(undefined), []); return ( <> @@ -93,11 +89,11 @@ const MarketplaceAppTopBar = ({ data, isLoading, securityReport }: Props) => { ) } - { isContractListShown && ( + { contractListType && ( ) } diff --git a/ui/shared/sort/ButtonDesktop.tsx b/ui/shared/sort/ButtonDesktop.tsx index 7679016d6e..e127a5e9db 100644 --- a/ui/shared/sort/ButtonDesktop.tsx +++ b/ui/shared/sort/ButtonDesktop.tsx @@ -10,14 +10,14 @@ import React from 'react'; import IconSvg from 'ui/shared/IconSvg'; type ButtonProps = { - isMenuOpen: boolean; + isActive: boolean; onClick: () => void; isLoading?: boolean; children: React.ReactNode; className?: string; }; -const ButtonDesktop = ({ children, isMenuOpen, onClick, isLoading, className }: ButtonProps, ref: React.ForwardedRef) => { +const ButtonDesktop = ({ children, isActive, onClick, isLoading, className }: ButtonProps, ref: React.ForwardedRef) => { const primaryColor = useColorModeValue('blackAlpha.800', 'whiteAlpha.800'); const secondaryColor = useColorModeValue('blackAlpha.600', 'whiteAlpha.600'); @@ -33,21 +33,21 @@ const ButtonDesktop = ({ children, isMenuOpen, onClick, isLoading, className }: fontWeight="600" borderColor="transparent" px={ 2 } - data-selected={ isMenuOpen } + data-selected={ isActive } > Sort by { children } diff --git a/ui/shared/sort/Sort.tsx b/ui/shared/sort/Sort.tsx index 5285245613..abb2fe6f6a 100644 --- a/ui/shared/sort/Sort.tsx +++ b/ui/shared/sort/Sort.tsx @@ -47,7 +47,7 @@ const Sort = ({ name, options, isLoading, onChange, default { isMobile ? ( ) : ( - + { options.find((option: TOption) => option.id === value || (!option.id && !value))?.title } ) }