diff --git a/src/containers/daoExplorer/daoExplorer.tsx b/src/containers/daoExplorer/daoExplorer.tsx index 08156a3c3..c7cdce761 100644 --- a/src/containers/daoExplorer/daoExplorer.tsx +++ b/src/containers/daoExplorer/daoExplorer.tsx @@ -25,6 +25,7 @@ import { import {Toggle, ToggleGroup} from '@aragon/ods'; import {useFeaturedDaos} from 'hooks/useFeaturedDaos'; import classNames from 'classnames'; +import {useScreen} from '@aragon/ods-old'; const followedDaoToDao = (dao: NavigationDao): IDao => ({ creatorAddress: '' as Address, @@ -42,6 +43,8 @@ export const DaoExplorer = () => { const {t} = useTranslation(); const {isConnected, address, methods} = useWallet(); + const {isMobile} = useScreen(); + const [showAdvancedFilters, setShowAdvancedFilters] = useState(false); const [activeDropdown, setActiveDropdown] = useState(false); const [filters, dispatch] = useReducer(daoFiltersReducer, DEFAULT_FILTERS); @@ -151,7 +154,7 @@ export const DaoExplorer = () => { }); }; - const showSortFilter = filters.quickFilter !== 'featuredDaos' && isConnected; + const showSortFilter = filters.quickFilter === 'allDaos'; const filterGroupClassName = classNames('flex justify-between w-full', { 'flex flex-col gap-y-3 md:flex-row md:justify-between': isConnected, @@ -166,10 +169,10 @@ export const DaoExplorer = () => { 'flex w-full justify-center md:w-fit': isConnected, }); - const buttonGroupContainerClassName = classNames('shrink-0', { + const buttonGroupContainerClassName = classNames('flex gap-x-3 justify-end', { 'flex md:w-fit': !isConnected && filters.quickFilter === 'featuredDaos', 'flex gap-x-3 w-full md:w-fit justify-between': - isConnected && filters.quickFilter !== 'featuredDaos', + isConnected && filters.quickFilter === 'allDaos', }); /************************************************* @@ -212,81 +215,90 @@ export const DaoExplorer = () => { size="md" iconLeft={IconType.FILTER} onClick={() => setShowAdvancedFilters(true)} + className="!min-w-fit" > {filtersCount} - {filters.quickFilter !== 'following' && ( - { - setActiveDropdown(e); - }} - customTrigger={ - + {isMobile && !isConnected && filters.quickFilter === 'allDaos' ? ( + + )} {noDaosFound || noFeaturedDaosFound ? ( @@ -302,29 +314,28 @@ export const DaoExplorer = () => { }} /> ) : ( - - {filters.quickFilter === 'featuredDaos' ? ( - <> - {featuredDaoList?.map( - (dao: IDao, index: React.Key | null | undefined) => ( - - ) - )} - {isLoadingFeaturedDaos && ( - - )} - - ) : ( - <> - {filteredDaoList?.map( - (dao: IDao, index: React.Key | null | undefined) => ( - - ) - )} - {isLoading && } - + <> + {((filters.quickFilter !== 'featuredDaos' && isLoading) || + (filters.quickFilter === 'featuredDaos' && + isLoadingFeaturedDaos)) && ( +
+ +
)} -
+ + {filters.quickFilter === 'featuredDaos' + ? featuredDaoList?.map( + (dao: IDao, index: React.Key | null | undefined) => ( + + ) + ) + : filteredDaoList?.map( + (dao: IDao, index: React.Key | null | undefined) => ( + + ) + )} + + )} {totalDaos != null &&