diff --git a/apps/web/src/components/Feed/SuggestedProfileCard.tsx b/apps/web/src/components/Feed/SuggestedProfileCard.tsx index c26c57a711..643c53dadb 100644 --- a/apps/web/src/components/Feed/SuggestedProfileCard.tsx +++ b/apps/web/src/components/Feed/SuggestedProfileCard.tsx @@ -178,7 +178,6 @@ const StyledSuggestedProfileCard = styled(GalleryLink)` @media only screen and ${breakpoints.desktop} { min-width: 200px; - min-height: 183px; } `; diff --git a/apps/web/src/components/Search/SearchDefault.tsx b/apps/web/src/components/Search/SearchDefault.tsx index 2af4a6f3fb..596e0ed146 100644 --- a/apps/web/src/components/Search/SearchDefault.tsx +++ b/apps/web/src/components/Search/SearchDefault.tsx @@ -1,15 +1,12 @@ -import { useMemo } from 'react'; import { graphql, useLazyLoadQuery } from 'react-relay'; import { SearchDefaultQuery } from '~/generated/SearchDefaultQuery.graphql'; import { CmsTypes } from '~/scenes/ContentPages/cms_types'; -import { HStack, VStack } from '../core/Spacer/Stack'; +import { VStack } from '../core/Spacer/Stack'; import SearchFeaturedCollectionSection from './SearchFeaturedCollectionSection'; import SearchSuggestedUsersSection from './SearchSuggestedUsersSection'; -import SearchResultsHeader from './SearchResultsHeader'; import { SearchItemType } from './types'; -import UserSearchResult from './User/UserSearchResult'; import SearchDefaultTrendingCuratorsSection from './SearchDefaultTrendingCurators'; type Props = { @@ -23,55 +20,20 @@ export default function SearchDefault({ variant = 'default', onSelect, pageConte const query = useLazyLoadQuery( graphql` query SearchDefaultQuery { - viewer @required(action: THROW) { - ... on Viewer { - suggestedUsers(first: 2) @required(action: THROW) { - __typename - edges { - node { - __typename - ... on GalleryUser { - id - __typename - } - ...SuggestedProfileCardFragment - } - } - } - } - } - ...SearchSuggestedUsersSectionFollowFragment + ...SearchSuggestedUsersSectionFragment ...SearchDefaultTrendingCuratorsSectionFragment } `, {} ); - // map edge nodes to an array of GalleryUsers - const nonNullProfiles = useMemo(() => { - const users = []; - - for (const edge of query.viewer?.suggestedUsers?.edges ?? []) { - if (edge?.node) { - users.push(edge.node); - } - } - - return users; - }, [query.viewer?.suggestedUsers?.edges]); - - if (query.viewer?.suggestedUsers?.__typename !== 'UsersConnection') { - return null; - } - const { featuredProfiles } = pageContent ?? []; - const featuredProfilesData = featuredProfiles?.slice(0, 2); return ( - + { + const users = []; + + for (const edge of query.viewer?.suggestedUsers?.edges ?? []) { + if (edge?.node) { + users.push(edge.node); + } + } + + return users; + }, [query.viewer?.suggestedUsers?.edges]); + + if (query.viewer?.suggestedUsers?.__typename !== 'UsersConnection') { + return null; + } + if (!nonNullProfiles) { + return null; } return ( <> Suggested Collectors and Creators - {profiles?.map((profile) => ( + {nonNullProfiles?.map((profile) => (