Skip to content

Commit

Permalink
feat: update map filtering display for usability
Browse files Browse the repository at this point in the history
  • Loading branch information
benfurber committed Dec 5, 2024
1 parent 50c017a commit 6c72267
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 11 additions & 5 deletions packages/components/src/MapFilterList/MapFilterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const MapFilterList = (props: IProps) => {
const isActive = (checkingFilter: string) =>
!!activeFilters.find((filter) => filter.label === checkingFilter)

const buttonLabel = `Show ${pinCount} result${pinCount === 1 ? '' : 's'}`
const buttonLabel = `${pinCount} result${pinCount === 1 ? '' : 's'} in current view`

return (
<Flex
Expand All @@ -61,9 +61,15 @@ export const MapFilterList = (props: IProps) => {
padding: 2,
}}
>
<Heading as="h3" variant="small">
So what are you looking for?
</Heading>
<Flex sx={{ flexDirection: 'column' }}>
<Heading as="h3" variant="small">
Filter what you see
</Heading>

<Text variant="quiet">
Zoom out on the map to search the whole world
</Text>
</Flex>

<ButtonIcon
data-cy="MapFilterList-CloseButton"
Expand Down Expand Up @@ -112,7 +118,7 @@ export const MapFilterList = (props: IProps) => {

{tagFilters.length > 0 && (
<Flex sx={{ gap: 1, flexDirection: 'column' }}>
<Text>Activities</Text>
<Text>Spaces activities</Text>
<MapFilterListWrapper>
{tagFilters.map((typeFilter, index) => {
const onClick = () => onFilterChange(typeFilter)
Expand Down
11 changes: 3 additions & 8 deletions packages/cypress/src/integration/map.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('[Map]', () => {
cy.get('[data-cy="CardList-desktop"]').within(() => {
cy.get('[data-cy=CardListItem-selected]').within(() => {
cy.contains(userId)
cy.get('[data-cy="MemberBadge-member"]')
cy.get('[data-cy="MemberBadge-workshop"]')
})
})
cy.get('[data-cy="PinProfile"]')
Expand Down Expand Up @@ -102,17 +102,12 @@ describe('[Map]', () => {
cy.get('[data-cy="ShowMobileListButton"]').click()
cy.get('[data-cy="CardList-mobile"]').within(() => {
cy.get('[data-cy=CardListItem]')
.last()
.first()
.within(() => {
cy.contains(userId)
cy.get('[data-cy="MemberBadge-member"]')
cy.get('[data-cy="MemberBadge-workshop"]')
})
})
cy.get('[data-cy=MapFilterProfileTypeCardList-ButtonRight]')
.last()
.click()
.click()
cy.get('[data-cy=MapListFilter]').last().click()

cy.step('Mobile list view can be hidden')
cy.get('[data-cy="ShowMapButton"]').click()
Expand Down
5 changes: 4 additions & 1 deletion src/pages/Maps/Maps.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const MapsPage = () => {

const pinDetails = allPins.map(({ creator }) => [
creator?.profileType,
...(creator?.tags ? creator.tags.map(({ _id }) => _id) : []),
// Hiding member tags for the moment
...(creator?.tags && creator?.profileType !== 'member'
? creator.tags.map(({ _id }) => _id)
: []),
...(creator?.badges
? Object.keys(creator?.badges).filter((key) => key)
: []),
Expand Down

0 comments on commit 6c72267

Please sign in to comment.