Skip to content

Commit

Permalink
fix: sort & filter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MounirDhahri committed Nov 28, 2024
1 parent cc9ef21 commit 3e6ca48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 6 additions & 12 deletions src/app/Components/ArtworkFilter/ArtworkFilterNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ActionType, ContextModule, OwnerType, TappedCreateAlert } from "@artsy/cohesion"
import { Flex } from "@artsy/palette-mobile"
import { NavigationContainer } from "@react-navigation/native"
import { TransitionPresets, createStackNavigator } from "@react-navigation/stack"
import { CreateSavedSearchModal } from "app/Components/Artist/ArtistArtworks/CreateSavedSearchModal"
Expand Down Expand Up @@ -32,12 +31,12 @@ import { TimePeriodOptionsScreen } from "app/Components/ArtworkFilter/Filters/Ti
import { ViewAsOptionsScreen } from "app/Components/ArtworkFilter/Filters/ViewAsOptions"
import { WaysToBuyOptionsScreen } from "app/Components/ArtworkFilter/Filters/WaysToBuyOptions"
import { YearOptionsScreen } from "app/Components/ArtworkFilter/Filters/YearOptions"
import { FancyModal } from "app/Components/FancyModal/FancyModal"
import { GlobalStore } from "app/store/GlobalStore"
import { OwnerEntityTypes, PageNames } from "app/utils/track/schema"
import { useLocalizedUnit } from "app/utils/useLocalizedUnit"
import { useEffect, useState } from "react"
import { ViewProps } from "react-native"
import { Modal, ViewProps } from "react-native"
import { SafeAreaView } from "react-native-safe-area-context"
import { useTracking } from "react-tracking"
import {
FilterModalMode as ArtworkFilterMode,
Expand Down Expand Up @@ -314,13 +313,8 @@ export const ArtworkFilterNavigator: React.FC<ArtworkFilterProps> = (props) => {

return (
<NavigationContainer independent>
<FancyModal
visible={props.visible}
onBackgroundPressed={handleClosingModal}
fullScreen
animationPosition="right"
>
<Flex flex={1}>
<Modal visible={props.visible} onDismiss={handleClosingModal} animationType="slide">
<SafeAreaView edges={["top"]} style={{ flex: 1 }}>
<Stack.Navigator
// force it to not use react-native-screens, which is broken inside a react-native Modal for some reason
detachInactiveScreens={false}
Expand Down Expand Up @@ -409,8 +403,8 @@ export const ArtworkFilterNavigator: React.FC<ArtworkFilterProps> = (props) => {
attributes={attributes}
sizeMetric={filterState.sizeMetric}
/>
</Flex>
</FancyModal>
</SafeAreaView>
</Modal>
</NavigationContainer>
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/Scenes/Search/SearchArtworksGrid.tests.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { fireEvent, screen } from "@testing-library/react-native"
import { SearchArtworksGridTestsQuery } from "__generated__/SearchArtworksGridTestsQuery.graphql"
import { ArtworkFiltersStoreProvider } from "app/Components/ArtworkFilter/ArtworkFilterStore"
import { FancyModal } from "app/Components/FancyModal/FancyModal"
import { mockTrackEvent } from "app/utils/tests/globallyMockedStuff"
import { setupTestWrapper } from "app/utils/tests/setupTestWrapper"
import { Modal } from "react-native"
import { graphql } from "react-relay"
import { SearchArtworksGridPaginationContainer } from "./SearchArtworksGrid"

Expand Down Expand Up @@ -49,7 +49,7 @@ describe("SearchArtworksGrid", () => {
it("tracks filter modal closing", () => {
renderWithRelay()

screen.UNSAFE_getAllByType(FancyModal)[0].props.onBackgroundPressed()
screen.UNSAFE_getAllByType(Modal)[0].props.onDismiss()

expect(mockTrackEvent.mock.calls[0]).toMatchInlineSnapshot(`
[
Expand Down

0 comments on commit 3e6ca48

Please sign in to comment.